0

我正在使用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,但注释为空。该消息表明annotatecan't find 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'

有什么想法吗?

4

1 回答 1

-1

尝试bundle exec rake改用。

于 2011-07-22T19:30:49.657 回答