rake db:在postgresql中创建错误

时间:2014-02-16 18:33:59

标签: ruby-on-rails ruby rake

我正在使用ubuntu。对于我的rails应用程序,在bundle install之后,我键入了rake db:create,然后显示以下错误:

/home/imtiaz/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:298:in `to_specs': Could not find 'rake' (>= 0) among 0 total gem(s) (Gem::LoadError)
    from /home/imtiaz/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:309:in `to_spec'
    from /home/imtiaz/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_gem.rb:53:in `gem'
    from /home/imtiaz/.rvm/gems/ruby-1.9.3-p484/bin/rake:22:in `<main>'
    from /home/imtiaz/.rvm/gems/ruby-1.9.3-p484/bin/ruby_executable_hooks:15:in `eval'
    from /home/imtiaz/.rvm/gems/ruby-1.9.3-p484/bin/ruby_executable_hooks:15:in `<main>'

我已尝试which ruby which rake which bundle命令。这给了我答案:

/home/imtiaz/.rvm/gems/ruby-1.9.3-p484@global/bin/bundle  for `which bundle`
/home/imtiaz/.rvm/gems/ruby-1.9.3-p484/bin/rake for `which rake`
/home/imtiaz/.rvm/rubies/ruby-1.9.3-p484/bin/ruby for `which ruby`

我现在能做什么???

1 个答案:

答案 0 :(得分:0)

请改为尝试:

bundle exec rake db:create

将使用随捆绑安装的rake副本。对于属于捆绑包的任何bin文件都是如此。