0

can't convert nil to String尝试使用rake db:create:all我的 postgresql 数据库时出现错误。

当我跑步时,rake db:create:all我得到

“您已经激活了 rake 0.9.2.2,但您的 Gemfile 需要 rake 0.9.2。使用 bundle exec 可以解决这个问题。”

当我跑步时,bundle exec rake db:create:all --trace我得到

/Users/verdi/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/runtime.rb:211: warning: Insecure world writable dir /usr/local in PATH, mode 040777
/Users/verdi/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/runtime.rb:211: warning: Insecure world writable dir /usr/local in PATH, mode 040777
(in /Users/verdi/Documents/Rails/Terminal)
/Users/verdi/.rvm/gems/ruby-1.9.3-p194/gems/net-ping-1.5.0/lib/net/ping/external.rb:4: Use RbConfig instead of obsolete and deprecated Config.
rake aborted!
can't convert nil into String
/Users/verdi/.rvm/gems/ruby-1.9.3-p194/gems/cucumber-rails-0.5.2/lib/cucumber/rails3.rb:3:in `dirname'
/Users/verdi/.rvm/gems/ruby-1.9.3-p194/gems/cucumber-rails-0.5.2/lib/cucumber/rails3.rb:3:in `<top (required)>'
/Users/verdi/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.9/lib/active_support/dependencies.rb:239:in `require'
/Users/verdi/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.9/lib/active_support/dependencies.rb:239:in `block in require'
/Users/verdi/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.9/lib/active_support/dependencies.rb:225:in `block in load_dependency'
/Users/verdi/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.9/lib/active_support/dependencies.rb:596:in `new_constants_in'
/Users/verdi/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.9/lib/active_support/dependencies.rb:225:in `load_dependency'
/Users/verdi/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.9/lib/active_support/dependencies.rb:239:in `require'
/Users/verdi/.rvm/gems/ruby-1.9.3-p194/gems/cucumber-rails-0.5.2/lib/cucumber/rails.rb:2:in `<top (required)>'
/Users/verdi/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/runtime.rb:74:in `require'
/Users/verdi/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/runtime.rb:74:in `rescue in block in require'
/Users/verdi/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/runtime.rb:62:in `block in require'
/Users/verdi/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/runtime.rb:55:in `each'
/Users/verdi/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/runtime.rb:55:in `require'
/Users/verdi/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler.rb:119:in `require'
/Users/verdi/Documents/Rails/Terminal/config/application.rb:7:in `<top (required)>'
/Users/verdi/Documents/Rails/Terminal/Rakefile:4:in `require'
/Users/verdi/Documents/Rails/Terminal/Rakefile:4:in `<top (required)>'
/Users/verdi/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2/lib/rake/rake_module.rb:25:in `load'
/Users/verdi/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2/lib/rake/rake_module.rb:25:in `load_rakefile'
/Users/verdi/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2/lib/rake/application.rb:495:in `raw_load_rakefile'
/Users/verdi/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2/lib/rake/application.rb:78:in `block in load_rakefile'
/Users/verdi/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/Users/verdi/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2/lib/rake/application.rb:77:in `load_rakefile'
/Users/verdi/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2/lib/rake/application.rb:61:in `block in run'
/Users/verdi/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/Users/verdi/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2/lib/rake/application.rb:59:in `run'
/Users/verdi/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2/bin/rake:32:in `<top (required)>'
/Users/verdi/.rvm/gems/ruby-1.9.3-p194/bin/rake:23:in `load'
/Users/verdi/.rvm/gems/ruby-1.9.3-p194/bin/rake:23:in `<main>'

我正在关注我 git 克隆的现有应用程序的 Ryan Bates 教程: http ://railscasts.com/episodes/342-migrating-to-postgresql?view=asciicast

4

1 回答 1

1

仔细检查您的 database.yaml 文件以确保所有值都存在

于 2012-05-03T00:00:48.383 回答