【问题标题】:Bundle exec rake db:migrate does not work (and neither does rake db:migrate), UbuntuBundle exec rake db:migrate 不起作用(rake db:migrate 也不起作用),Ubuntu
【发布时间】:2012-04-08 14:39:15
【问题描述】:

我在 Ubuntu (EC2) 上运行 Rails 3 应用程序,我已将 rake 锁定在 0.8.7 版本,当我执行 rake db:migrate 时,我得到了通常的结果:

  You have already activated rake 0.9.2.2, but your Gemfile requires rake 0.8.7. Using bundle exec may solve this.

但是,当我执行 bundle exec rake db:migrate 时,我得到了相同的响应..

??

【问题讨论】:

    标签: ruby ruby-on-rails-3 ubuntu rake bundler


    【解决方案1】:

    您可以尝试以下几种方法:

    1. 将 Ruby 升级到 1.9.3,这将提供 Rake 0.9.2.2

    2. 将此添加到您的 Gemfile gem 'rake' , '>= 0.9.2' 并再次运行 bundle update

    3. 最坏的情况,删除您的 Gemfile.lock 并使用 bundle install 重新生成它

    【讨论】:

    • 这些可能允许 Stpn 继续,但真正的问题是为什么 0.9.2.2 被激活,因为它是以 bundle exec rake ... 运行的
    • 我现在正在尝试 Gemfile.lock 删除方法,因为我实际上需要 Rake 0.8.7(其他一些 gem 依赖于它)。
    猜你喜欢
    • 2012-01-07
    • 2014-04-30
    • 2015-02-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-05-15
    • 2012-04-18
    相关资源
    最近更新 更多