我只是想尝试新的Padrino画架。我按照here给出的步骤进行了操作。 我坚持执行rake任务。 我使用Mysql作为我的数据库。我使用命令创建了项目 padrino g项目sample_blog -t shoulda -e haml -c sass -s jquery -d activerecord -a mysql padrino g admin
我按顺序拥有所有依赖项,我做了捆绑安装以确保它。 然后,当我运行rake任务时,我得到了这个错误。
$ padrino rake ar:create --trace
=>执行Rake ar:create --trace ...
**调用ar:create(first_time)
**调用环境(first_time)
**执行环境
**执行ar:创建
耙子流产!
未定义的方法[]' for nil:NilClass
create_database'
/usr/lib/ruby/gems/1.8/gems/padrino-gen-0.9.14/lib/padrino-gen/padrino-tasks/activerecord.rb:56:in
/usr/lib/ruby/gems/1.8/gems/padrino-gen-0.9.14/lib/padrino-gen/padrino-tasks/activerecord.rb:31
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in call'
执行'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in each'
执行'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in invoke_with_call_chain'
同步'
/usr/lib/ruby/1.8/monitor.rb:242:in
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in invoke_with_call_chain'
调用'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in invoke_task'
top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in each'
top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in standard_exception_handling'
top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in
/usr/lib/ruby/gems/1.8/gems/padrino-core-0.9.14/lib/padrino-core/cli/rake.rb:9:in init'
rake'
/usr/lib/ruby/gems/1.8/gems/padrino-core-0.9.14/lib/padrino-core/cli/base.rb:50:in
/usr/lib/ruby/gems/1.8/gems/thor-0.13.4/lib/thor/task.rb:33:in send'
运行'
/usr/lib/ruby/gems/1.8/gems/thor-0.13.4/lib/thor/task.rb:33:in
/usr/lib/ruby/gems/1.8/gems/thor-0.13.4/lib/thor/invocation.rb:109:in invoke'
调用'
/usr/lib/ruby/gems/1.8/gems/thor-0.13.4/lib/thor/invocation.rb:116:in
/usr/lib/ruby/gems/1.8/gems/thor-0.13.4/lib/thor/invocation.rb:116:in invoke'
/usr/lib/ruby/gems/1.8/gems/thor-0.13.4/lib/thor.rb:137:in
开始'
/usr/lib/ruby/gems/1.8/gems/thor-0.13.4/lib/thor/base.rb:378:in start'
开始'
/usr/lib/ruby/gems/1.8/gems/thor-0.13.4/lib/thor.rb:124:in
/usr/lib/ruby/gems/1.8/gems/padrino-core-0.9.14/bin/padrino:24
/ usr / bin / padrino:19:在'load'中
/ usr / bin / padrino:19
$ padrino rake ar:migrate --trace
=>执行Rake ar:migrate --trace ...
**调用ar:migrate(first_time)
**调用环境(first_time)
**执行环境
**执行ar:迁移
耙子流产!
ActiveRecord的:: ConnectionNotEstablished
/home/deepak/.bundle/ruby/1.8/gems/activerecord- 2.3.8 / lib / active_record / connection_adapters / abstract / connection_pool.rb:326:in retrieve_connection'
retrieve_connection'
/home/deepak/.bundle/ruby/1.8/gems/activerecord- 2.3.8/lib/active_record/connection_adapters/abstract/connection_specification.rb:123:in
/home/deepak/.bundle/ruby/1.8/gems/activerecord- 2.3.8 / lib / active_record / connection_adapters / abstract / connection_specification.rb:115:在connection'
初始化'
/home/deepak/.bundle/ruby/1.8/gems/activerecord-2.3.8/lib/active_record/migration.rb:440:in
/home/deepak/.bundle/ruby/1.8/gems/activerecord-2.3.8/lib/active_record/migration.rb:401:in new'
up'
/home/deepak/.bundle/ruby/1.8/gems/activerecord-2.3.8/lib/active_record/migration.rb:401:in
/home/deepak/.bundle/ruby/1.8/gems/activerecord-2.3.8/lib/active_record/migration.rb:383:in migrate'
来电'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in
/usr/lib/ruby/gems/1.8/gems/padrino-gen-0.9.14/lib/padrino-gen/padrino-tasks/activerecord.rb:136
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:inexecute'
每个'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:inexecute'
invoke_with_call_chain'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in
/usr/lib/ruby/1.8/monitor.rb:242:in synchronize'
invoke_with_call_chain'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in invoke'
invoke_task'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in top_level'
每个'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:intop_level'
standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in top_level'
init'
/usr/lib/ruby/gems/1.8/gems/padrino-core-0.9.14/lib/padrino-core/cli/rake.rb:9:in
/usr/lib/ruby/gems/1.8/gems/padrino-core-0.9.14/lib/padrino-core/cli/base.rb:50:in rake'
发送'
/usr/lib/ruby/gems/1.8/gems/thor-0.13.4/lib/thor/task.rb:33:in
/usr/lib/ruby/gems/1.8/gems/thor-0.13.4/lib/thor/task.rb:33:in run'
调用'
/usr/lib/ruby/gems/1.8/gems/thor-0.13.4/lib/thor/invocation.rb:109:in
/usr/lib/ruby/gems/1.8/gems/thor-0.13.4/lib/thor/invocation.rb:116:in call'
调用'
/usr/lib/ruby/gems/1.8/gems/thor-0.13.4/lib/thor/invocation.rb:116:in
/usr/lib/ruby/gems/1.8/gems/thor-0.13.4/lib/thor.rb:137:in start'
开始'
/usr/lib/ruby/gems/1.8/gems/thor-0.13.4/lib/thor/base.rb:378:in
/usr/lib/ruby/gems/1.8/gems/thor-0.13.4/lib/thor.rb:124:in start'
load'
/usr/lib/ruby/gems/1.8/gems/padrino-core-0.9.14/bin/padrino:24
/usr/bin/padrino:19:in
/ usr / bin / padrino:19
答案 0 :(得分:0)
的ActiveRecord :: ConnectionNotEstablished
您是否在MySQL.rb中输入了MySQL用户名和密码信息?