annotate找不到rake可执行文件

时间:2011-07-22 19:27:51

标签: ruby-on-rails-3 rake annotate

我正在使用ctran/annotate_models来注释我的模型和路由文件。我现在收到一个错误:

$ annotate -r
$ROOT/usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/shared_helpers.rb:151:in `block in cripple_rubygems': can't find executable rake (Gem::Exception)
from $ROOT/usr/lib/ruby/gems/1.9.1/bin/rake:19:in `<main>'
Route file annotated.

...结果annotate将注释块添加到config / routes.db,但注释为空。该消息表明annotate无法找到rake,但rake肯定存在:

$ which rake
$ROOT/usr/bin/rake

以下是rake对当前配置的说法:

$ rake about
About your application's environment
Ruby version              1.9.2 (x86_64-darwin10.6.0)
RubyGems version          1.3.7
Rack version              1.2
Rails version             3.0.5
Active Record version     3.0.5
Action Pack version       3.0.5
Active Resource version   3.0.5
Action Mailer version     3.0.5
Active Support version    3.0.5
Application root          .../myapp
Environment               development

我的Gemfile中唯一有点奇怪的是我指定了以前版本的rake:

# file: Gemfile
source 'http://rubygems.org'
gem 'rails', '3.0.5'
gem 'rake', '0.8.7'             # workaround "uninitialized constant Rake::DSL" bug
...
gem 'annotate', '2.4.0'

关于什么是错的任何想法?

1 个答案:

答案 0 :(得分:-1)

请尝试使用bundle exec rake