我使用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'
知道怎么了吗?
尝试使用bundle exec rake