安裝Rbenv和Ruby 1.9.2和1.8.7並將當前項目設置爲使用1.9.2(以前使用1.8.7)後,Rake將不會長時間運行。乳寧bundle install
後安裝rbenv並更改Ruby版本後,Rake不再運行
Could not find rake-0.8.7 in any of the sources
Run `bundle install` to install missing gems.
此:運行rake routes
給出的消息。
試圖bundle exec rake routes
(這是之前安裝Rbenv所使用的方法),產生如下錯誤:
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /Library/Ruby/Gems/1.8/gems/bundler-1.0.9/lib/bundler/shared_helpers.rb:3.
Invalid gemspec in [/Users/jackrg/Documents/Novelty-Stats/vendor/local/ruby/1.8/specifications/jquery-rails-1.0.19.gemspec]: invalid date format in specification: "2011-11-26 00:00:00.000000000Z"
Invalid gemspec in [/Users/jackrg/Documents/Novelty-Stats/vendor/local/ruby/1.8/specifications/tilt-1.3.3.gemspec]: invalid date format in specification: "2011-08-25 00:00:00.000000000Z"
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /Library/Ruby/Gems/1.8/gems/bundler-1.0.9/lib/bundler/source.rb:161.
NOTE: Gem::SourceIndex#each is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#each called from /Library/Ruby/Gems/1.8/gems/bundler-1.0.9/lib/bundler/source.rb:161.
Could not find rake-0.8.7 in any of the sources
注意,應用程序本身運行沒有在發展期(rails c
,rails s
等)。
另請注意gem list
列出耙子(0.8.7)作爲本地寶石。
如果我更改gemfile來請求rake版本0.9.2,然後更新bundle(bundle update rake),我會得到相同的錯誤,只不過他們現在引用rake 0.9.2而不是0.8.7。
你在安裝紅寶石後運行'rbenv rehash'嗎?另外,您是否遵循了將shims目錄添加到路徑的說明? – aceofspades 2012-03-14 03:16:03
正如Sam Stephenson關於安裝rbenv的文檔2.1節的第3步和第4步所描述的那樣,我做了'echo'eval「$(rbenv init - )」>>〜/ .bash_profile',後面跟着'exec $ SHELL',如果這是你是什麼意思。我不知道有任何其他步驟來啓用墊片。是否有獨立的方式來測試墊片是否啓用? – 2012-03-15 18:42:09