Rails 4.0.0,Gemfile需要rake 10.1.0 for Rake

时间:2014-01-19 17:49:09

标签: ruby-on-rails ruby-on-rails-4 rubygems rake

我目前正在运行Rails 4.0.0,ruby 1.9.3p392(2013-02-22修订版39386)[x86_64-darwin10.8.0],使用Rake 10.1.1

我正在为Rails中的一个类开发应用程序,当我去运行rake数据库迁移时,我收到以下错误消息:

Joses-MacBook-Air:crumblr JRV$ rake db:migrate
rake aborted!
You have already activated rake 10.1.1, but your Gemfile requires rake 10.1.0. Using      bundle exec may solve this.
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/bundler-1.3.5/lib/bundler/runtime.rb:33:in `block   in setup'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/bundler-1.3.5/lib/bundler/runtime.rb:19:in `setup'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/bundler-1.3.5/lib/bundler.rb:120:in `setup'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/bundler-1.3.5/lib/bundler/setup.rb:7:in `<top    (required)>'
/Users/JRV/crumblr/config/boot.rb:4:in `<top (required)>'
/Users/JRV/crumblr/config/application.rb:1:in `<top (required)>'
/Users/JRV/crumblr/Rakefile:4:in `<top (required)>'
(See full trace by running task with --trace)

恢复或覆盖此问题以允许迁移的解决方案是什么?

1 个答案:

答案 0 :(得分:5)

就像它建议的那样,你可以bundle exec rake db:migrate

对于不需要添加前缀的解决方案,请尝试执行bundle update rake