2012-08-05 97 views
1

當我運行了Annotate Model Gem命令註釋我的模型,我得到了下面的錯誤,我用這兩種方式來安裝寶石:註釋寶石:沒有這樣的文件加載?

$ annotate --exclude tests, fixtures 
c:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': 
     from c:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:i 
     from c:/Ruby192/lib/ruby/gems/1.9.1/gems/annotate-2.5.0/bin/annotate:3:i 
     from c:/Ruby192/bin/annotate:19:in `load' 
     from c:/Ruby192/bin/annotate:19:in `<main>' 

$ bundle exec annotate --exclude tests, fixtures 
c:/Ruby192/lib/ruby/gems/1.9.1/gems/annotate-2.5.0/bin/annotate:3:in `require': no such file to load -- rake/dsl_definition (LoadError) 
     from c:/Ruby192/lib/ruby/gems/1.9.1/gems/annotate-2.5.0/bin/annotate:3:in `<top (required)>' 
     from c:/Ruby192/lib/ruby/gems/1.9.1/bin/annotate:19:in `load' 
     from c:/Ruby192/lib/ruby/gems/1.9.1/bin/annotate:19:in `<main>' 

的Gemfile

gem "rails", "3.1.0" 
gem "rake", "0.8.7" 

group :development do 
    gem "annotate", "2.5.0" 
end 

命令行:

$ gem install annotate 
Successfully installed annotate-2.5.0 
1 gem installed 

怎麼可以我得到這個寶石工作?

+0

該組是否在Gemfile中是blob?如果是這樣,你可能只需要在捆綁exec之前捆綁安裝。 – 2012-08-05 18:33:25

+0

@MattGlover是的。讓我編輯我的問題。 – LearningRoR 2012-08-05 18:36:25

+0

您使用的是什麼版本的rake? 'bundle exec耙 - 版本' – iltempo 2012-08-05 18:36:42

回答

4

請更新耙子。 Rake::DSL已在版本0.9中引入。

bundle update rake 
+0

好酷。我卸載了'rake 0.8.7',並進入''rake「,」0.9.2.2「'。謝謝。 – LearningRoR 2012-08-05 18:52:55

相關問題