我目前正在使用Symfony2进行编程(遵循本教程:tutorial.symblog.co.uk,当我执行:
php app/console doctrine:schema:create
Run Code Online (Sandbox Code Playgroud)
我明白了:
[PDOException]
SQLSTATE[HY000] [2002] Not a directory
Run Code Online (Sandbox Code Playgroud)
这是我的parameters.yml文件:
parameters:
database_driver: pdo_mysql
database_host: localhost
database_port: '3306'
database_name: symblog
database_user: root
database_password: ~
database_path: /Applications/MAMP/tmp/mysql/mysql.sock
mailer_transport: gmail
mailer_host: smtp.gmail.com
mailer_user: ~
mailer_password: ~
locale: en
secret: ~
Run Code Online (Sandbox Code Playgroud)
我知道用户名和密码对于数据库和邮件程序都是正确的.
正如你所看到的,我正在使用MAMP,我的phpMyAdmin能够连接,其他一切都很好.请帮忙.
提前致谢!
我尝试运行时遇到GruntJS错误grunt watch.它工作正常,直到它正在观看的文件发生变化,然后,它看起来像这样:
Running "watch" task
Waiting...[1] 2464 bus error grunt watch
Run Code Online (Sandbox Code Playgroud)
号码2464改变了.它似乎是grunt正在观看的端口?但是,我不确定.这是我的Gruntfile:
module.exports = function (grunt) {
"use strict";
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
sass: {
dist: {
options: {
style: 'compact'
},
files: {
'css/style.css': 'sass/style.scss',
}
}
},
watch: {
files: 'sass/style.scss',
tasks: ['sass']
}
});
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('default', ['sass']);
};
Run Code Online (Sandbox Code Playgroud)
在此先感谢您的帮助!
我在Symfony中有一个应用程序,当用户发表评论时,会存储评论的创建时间.然后,使用twig将其转换为正确的格式,如下所示:
{{ comment.created|date('m-d-Y H:i:s a') }}
Run Code Online (Sandbox Code Playgroud)
唯一的问题是,如果用户在下午4点提交评论,则会在下午16点提交
我希望它只显示下午4点
在此先感谢您的帮助!
当rails server我尝试在我当前的目录(这是一个新的rails项目)中运行时,它说我需要安装mysql2gem.起初,我不知道这意味着什么......然后,我做了一些戳,最后决定安装宝石.但是,我得到了这个超级麻烦的错误(因为我只花了2个小时试图调查,并解决了另一个错误).我处于放弃的边缘,但我真的想试试铁轨.请帮忙!
目前,如果我跑sudo gem install mysql2,或者甚至有些人告诉我在网上做gem install mysql -- \ --with-mysql-config=/Applications/MAMP/Library/bin/mysql_config(我有MAMP),它会给我以下错误:
Building native extensions. This could take a while...
ERROR: Error installing mysql2:
ERROR: Failed to build gem native extension.
/Users/vicky/.rvm/rubies/ruby-2.0.0-p247/bin/ruby extconf.rb
checking for ruby/thread.h... yes
checking for rb_thread_call_without_gvl() in ruby/thread.h... yes
checking for rb_thread_blocking_region()... yes
checking for rb_wait_for_single_fd()... yes
checking for rb_hash_dup()... yes
checking for rb_intern3()... yes
-----
Using mysql_config at /Applications/MAMP/Library/bin/mysql_config
-----
checking for mysql.h... yes
checking for errmsg.h... yes …Run Code Online (Sandbox Code Playgroud) mysql ×2
php ×2
symfony ×2
command-line ×1
date ×1
doctrine-orm ×1
gem ×1
gruntjs ×1
macos ×1
mamp ×1
mysql.sock ×1
sass ×1
terminal ×1
twig ×1
watch ×1