我在Heroku上運行Rails 2.3.11應用程序。然而,耙任務不再在Heroku工作:Heroku使用錯誤版本的耙子(0.9.0而不是0.8.7)
rake aborted!
You have already activated rake 0.9.0, but your Gemfile requires rake 0.8.7. Consider using bundle exec.
耙本地工作的罰款。我指定耙0.8.7在我的Gemfile:
gem 'rake', '0.8.7'
我Gemfile.lock的文件是我的混帳回購協議的一部分(不gitignored)。我檢查了我的Gemfile.lock尋找提到的0.9.0耙,但找不到任何。
看起來Heroku保留了0.9.0的rake副本,但我找不到擺脫它的方法。下面是完整的跟蹤:
$ heroku rake -T --trace
rake aborted!
You have already activated rake 0.9.0, but your Gemfile requires rake 0.8.7. Consider using bundle exec.
/usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/runtime.rb:27:in `setup'
/usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/spec_set.rb:12:in `each'
/usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/spec_set.rb:12:in `each'
/usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/runtime.rb:17:in `setup'
/usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler.rb:100:in `setup'
/app/config/../config/preinitializer.rb:16
/app/config/boot.rb:28:in `load'
/app/config/boot.rb:28:in `preinitialize'
/app/config/boot.rb:10:in `boot!'
/app/config/boot.rb:124
/usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/app/Rakefile:4
/app/.bundle/gems/ruby/1.8/gems/rake-0.9.0/lib/rake/rake_module.rb:25:in `load'
/app/.bundle/gems/ruby/1.8/gems/rake-0.9.0/lib/rake/rake_module.rb:25:in `load_rakefile'
/app/.bundle/gems/ruby/1.8/gems/rake-0.9.0/lib/rake/application.rb:495:in `raw_load_rakefile'
/app/.bundle/gems/ruby/1.8/gems/rake-0.9.0/lib/rake/application.rb:78:in `load_rakefile'
/app/.bundle/gems/ruby/1.8/gems/rake-0.9.0/lib/rake/application.rb:129:in `standard_exception_handling'
/app/.bundle/gems/ruby/1.8/gems/rake-0.9.0/lib/rake/application.rb:77:in `load_rakefile'
/app/.bundle/gems/ruby/1.8/gems/rake-0.9.0/lib/rake/application.rb:61:in `run'
/app/.bundle/gems/ruby/1.8/gems/rake-0.9.0/lib/rake/application.rb:129:in `standard_exception_handling'
/app/.bundle/gems/ruby/1.8/gems/rake-0.9.0/lib/rake/application.rb:59:in `run'
/app/.bundle/gems/ruby/1.8/gems/rake-0.9.0/bin/rake:31
/usr/ruby1.8.7/bin/rake:19:in `load'
/usr/ruby1.8.7/bin/rake:19
它看起來像在以下提到的問題,但像他這樣的人終於實現了我寧可不創建一個新的應用程序:
Gem not uninstalling on Heroku
你如何重新安裝你的捆綁在heroku上?我只是做了你的建議,並將我的應用程序重新推送到heroku,但是我的耙子仍然不起作用... – Alex 2011-06-29 23:07:09
@Alex:確保您看到'檢測到未解析的依賴關係;安裝...'當你推動你的應用程序。否則,您的包不會被重新安裝。不過,我不確定是否有辦法強制捆綁軟件重新安裝,而無需更改Gemfile。 – 2011-07-02 22:37:25
感謝Etienne,我在此期間聯繫了Heroku,他們清除了我的寶石,並且下次我將它重新正確地重新安裝並且它可以正常工作(在我添加了bundle_without選項後)。 – Alex 2011-07-04 02:42:15