「rake routes」を使用して rake コマンドを実行したい
しかし、レールは次のエラーを生成します
** Invoke routes (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
uninitialized constant ActiveAdmin
/Users/aaalsubaie/Sites/Posnegs/config/initializers/active_admin.rb:1
/Library/Ruby/Gems/1.8/gems/railties-3.2.3/lib/rails/engine.rb:588
/Library/Ruby/Gems/1.8/gems/railties-3.2.3/lib/rails/engine.rb:587:in `each'
/Library/Ruby/Gems/1.8/gems/railties-3.2.3/lib/rails/engine.rb:587
/Library/Ruby/Gems/1.8/gems/railties-3.2.3/lib/rails/initializable.rb:30:in `instance_exec'
/Library/Ruby/Gems/1.8/gems/railties-3.2.3/lib/rails/initializable.rb:30:in `run'
/Library/Ruby/Gems/1.8/gems/railties-3.2.3/lib/rails/initializable.rb:55:in `run_initializers'
/Library/Ruby/Gems/1.8/gems/railties-3.2.3/lib/rails/initializable.rb:54:in `each'
/Library/Ruby/Gems/1.8/gems/railties-3.2.3/lib/rails/initializable.rb:54:in `run_initializers'
/Library/Ruby/Gems/1.8/gems/railties-3.2.3/lib/rails/application.rb:136:in `initialize!'
/Library/Ruby/Gems/1.8/gems/railties-3.2.3/lib/rails/railtie/configurable.rb:30:in `send'
/Library/Ruby/Gems/1.8/gems/railties-3.2.3/lib/rails/railtie/configurable.rb:30:in `method_missing'
/Users/aaalsubaie/Sites/Posnegs/config/environment.rb:5
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in `require'
/Library/Ruby/Gems/1.8/gems/railties-3.2.3/lib/rails/application.rb:103:in `require_environment!'
/Library/Ruby/Gems/1.8/gems/railties-3.2.3/lib/rails/application.rb:292:in `initialize_tasks'
/Library/Ruby/Gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/Library/Ruby/Gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `execute'
/Library/Ruby/Gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/Library/Ruby/Gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/Library/Ruby/Gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `invoke_with_call_chain'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/Library/Ruby/Gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Library/Ruby/Gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:176:in `invoke_prerequisites'
/Library/Ruby/Gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `each'
/Library/Ruby/Gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `invoke_prerequisites'
/Library/Ruby/Gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:157:in `invoke_with_call_chain'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/Library/Ruby/Gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Library/Ruby/Gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/Library/Ruby/Gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/Library/Ruby/Gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `top_level'
/Library/Ruby/Gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/Library/Ruby/Gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `top_level'
/Library/Ruby/Gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Library/Ruby/Gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/Library/Ruby/Gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `run'
/Library/Ruby/Gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Library/Ruby/Gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/Library/Ruby/Gems/1.8/gems/rake-0.9.2.2/bin/rake:33
/usr/bin/rake:23:in `load'
/usr/bin/rake:23
Tasks: TOP => routes => environment
奇妙なことに、「bundle exec rake routes」を実行すると
正しく動作します。開発/運用環境でこのエラーに直面しています