我过去常常推迟工作,但自从我把它从Gemfile
中删除后。
我今天已经包含了newrelic_rpm
gem并运行bundle install
。
从那以后,我无法启动服务器,我得到了以下严重的错误堆栈:
/home/nitrous/my_app/.bundle/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `require': cannot load such file -- delayed_job (LoadError)
from /home/nitrous/my_app/.bundle/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `block in require'
from /home/nitrous/my_app/.bundle/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:240:in `load_dependency'
from /home/nitrous/my_app/.bundle/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `require'
from /home/nitrous/my_app/.bundle/gems/activejob-4.2.4/lib/active_job/queue_adapters/delayed_job_adapter.rb:1:in `<top (required)>'
from /home/nitrous/my_app/.bundle/gems/activesupport-4.2.4/lib/active_support/inflector/methods.rb:263:in `const_get'
from /home/nitrous/my_app/.bundle/gems/activesupport-4.2.4/lib/active_support/inflector/methods.rb:263:in `block in constantize'
from /home/nitrous/my_app/.bundle/gems/activesupport-4.2.4/lib/active_support/inflector/methods.rb:259:in `each'
from /home/nitrous/my_app/.bundle/gems/activesupport-4.2.4/lib/active_support/inflector/methods.rb:259:in `inject'
from /home/nitrous/my_app/.bundle/gems/activesupport-4.2.4/lib/active_support/inflector/methods.rb:259:in `constantize'
from /home/nitrous/my_app/.bundle/gems/activesupport-4.2.4/lib/active_support/core_ext/string/inflections.rb:66:in `constantize'
from /home/nitrous/my_app/.bundle/gems/activejob-4.2.4/lib/active_job/queue_adapter.rb:31:in `load_adapter'
from /home/nitrous/my_app/.bundle/gems/activejob-4.2.4/lib/active_job/queue_adapter.rb:23:in `queue_adapter='
from /home/nitrous/my_app/.bundle/gems/activejob-4.2.4/lib/active_job/railtie.rb:18:in `block (3 levels) in <class:Railtie>'
from /home/nitrous/my_app/.bundle/gems/activejob-4.2.4/lib/active_job/railtie.rb:18:in `each'
from /home/nitrous/my_app/.bundle/gems/activejob-4.2.4/lib/active_job/railtie.rb:18:in `block (2 levels) in <class:Railtie>'
from /home/nitrous/my_app/.bundle/gems/activesupport-4.2.4/lib/active_support/lazy_load_hooks.rb:38:in `instance_eval'
from /home/nitrous/my_app/.bundle/gems/activesupport-4.2.4/lib/active_support/lazy_load_hooks.rb:38:in `execute_hook'
from /home/nitrous/my_app/.bundle/gems/activesupport-4.2.4/lib/active_support/lazy_load_hooks.rb:45:in `block in run_load_hooks'
from /home/nitrous/my_app/.bundle/gems/activesupport-4.2.4/lib/active_support/lazy_load_hooks.rb:44:in `each'
from /home/nitrous/my_app/.bundle/gems/activesupport-4.2.4/lib/active_support/lazy_load_hooks.rb:44:in `run_load_hooks'
from /home/nitrous/my_app/.bundle/gems/activejob-4.2.4/lib/active_job/base.rb:66:in `<class:Base>'
from /home/nitrous/my_app/.bundle/gems/activejob-4.2.4/lib/active_job/base.rb:56:in `<module:ActiveJob>'
from /home/nitrous/my_app/.bundle/gems/activejob-4.2.4/lib/active_job/base.rb:10:in `<top (required)>'
from /home/nitrous/my_app/.bundle/gems/newrelic_rpm-3.13.0.299/lib/new_relic/agent/instrumentation/active_job.rb:15:in `block (2 levels) in <top (required)>'
from /home/nitrous/my_app/.bundle/gems/newrelic_rpm-3.13.0.299/vendor/gems/dependency_detection-0.0.1.build/lib/dependency_detection.rb:74:in `call'
from /home/nitrous/my_app/.bundle/gems/newrelic_rpm-3.13.0.299/vendor/gems/dependency_detection-0.0.1.build/lib/dependency_detection.rb:74:in `block in execute'
from /home/nitrous/my_app/.bundle/gems/newrelic_rpm-3.13.0.299/vendor/gems/dependency_detection-0.0.1.build/lib/dependency_detection.rb:72:in `each'
from /home/nitrous/my_app/.bundle/gems/newrelic_rpm-3.13.0.299/vendor/gems/dependency_detection-0.0.1.build/lib/dependency_detection.rb:72:in `execute'
from /home/nitrous/my_app/.bundle/gems/newrelic_rpm-3.13.0.299/vendor/gems/dependency_detection-0.0.1.build/lib/dependency_detection.rb:30:in `block in detect!'
from /home/nitrous/my_app/.bundle/gems/newrelic_rpm-3.13.0.299/vendor/gems/dependency_detection-0.0.1.build/lib/dependency_detection.rb:28:in `each'
from /home/nitrous/my_app/.bundle/gems/newrelic_rpm-3.13.0.299/vendor/gems/dependency_detection-0.0.1.build/lib/dependency_detection.rb:28:in `detect!'
from /home/nitrous/my_app/.bundle/gems/newrelic_rpm-3.13.0.299/lib/new_relic/control/instrumentation.rb:65:in `_install_instrumentation'
from /home/nitrous/my_app/.bundle/gems/newrelic_rpm-3.13.0.299/lib/new_relic/control/instrumentation.rb:48:in `install_instrumentation'
from /home/nitrous/my_app/.bundle/gems/newrelic_rpm-3.13.0.299/lib/new_relic/control/instance_methods.rb:73:in `init_plugin'
from /home/nitrous/my_app/.bundle/gems/newrelic_rpm-3.13.0.299/lib/newrelic_rpm.rb:41:in `block in <class:Railtie>'
from /home/nitrous/my_app/.bundle/gems/railties-4.2.4/lib/rails/initializable.rb:30:in `instance_exec'
from /home/nitrous/my_app/.bundle/gems/railties-4.2.4/lib/rails/initializable.rb:30:in `run'
from /home/nitrous/my_app/.bundle/gems/railties-4.2.4/lib/rails/initializable.rb:55:in `block in run_initializers'
from /usr/local/opt/rbenv/versions/2.2.1/lib/ruby/2.2.0/tsort.rb:226:in `block in tsort_each'
from /usr/local/opt/rbenv/versions/2.2.1/lib/ruby/2.2.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
from /usr/local/opt/rbenv/versions/2.2.1/lib/ruby/2.2.0/tsort.rb:429:in `each_strongly_connected_component_from'
from /usr/local/opt/rbenv/versions/2.2.1/lib/ruby/2.2.0/tsort.rb:347:in `block in each_strongly_connected_component'
from /usr/local/opt/rbenv/versions/2.2.1/lib/ruby/2.2.0/tsort.rb:345:in `each'
from /usr/local/opt/rbenv/versions/2.2.1/lib/ruby/2.2.0/tsort.rb:345:in `call'
from /usr/local/opt/rbenv/versions/2.2.1/lib/ruby/2.2.0/tsort.rb:345:in `each_strongly_connected_component'
from /usr/local/opt/rbenv/versions/2.2.1/lib/ruby/2.2.0/tsort.rb:224:in `tsort_each'
from /usr/local/opt/rbenv/versions/2.2.1/lib/ruby/2.2.0/tsort.rb:203:in `tsort_each'
from /home/nitrous/my_app/.bundle/gems/railties-4.2.4/lib/rails/initializable.rb:54:in `run_initializers'
from /home/nitrous/my_app/.bundle/gems/railties-4.2.4/lib/rails/application.rb:352:in `initialize!'
from /home/nitrous/my_app/config/environment.rb:5:in `<top (required)>'
from /home/nitrous/my_app/.bundle/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `require'
from /home/nitrous/my_app/.bundle/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `block in require'
from /home/nitrous/my_app/.bundle/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:240:in `load_dependency'
from /home/nitrous/my_app/.bundle/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `require'
from /home/nitrous/my_app/config.ru:3:in `block in <main>'
from /home/nitrous/my_app/.bundle/gems/rack-1.6.4/lib/rack/builder.rb:55:in `instance_eval'
from /home/nitrous/my_app/.bundle/gems/rack-1.6.4/lib/rack/builder.rb:55:in `initialize'
from /home/nitrous/my_app/config.ru:in `new'
from /home/nitrous/my_app/config.ru:in `<main>'
from /home/nitrous/my_app/.bundle/gems/rack-1.6.4/lib/rack/builder.rb:49:in `eval'
from /home/nitrous/my_app/.bundle/gems/rack-1.6.4/lib/rack/builder.rb:49:in `new_from_string'
from /home/nitrous/my_app/.bundle/gems/rack-1.6.4/lib/rack/builder.rb:40:in `parse_file'
from /home/nitrous/my_app/.bundle/gems/rack-1.6.4/lib/rack/server.rb:299:in `build_app_and_options_from_config'
from /home/nitrous/my_app/.bundle/gems/rack-1.6.4/lib/rack/server.rb:208:in `app'
from /home/nitrous/my_app/.bundle/gems/railties-4.2.4/lib/rails/commands/server.rb:61:in `app'
from /home/nitrous/my_app/.bundle/gems/rack-1.6.4/lib/rack/server.rb:336:in `wrapped_app'
from /home/nitrous/my_app/.bundle/gems/railties-4.2.4/lib/rails/commands/server.rb:139:in `log_to_stdout'
from /home/nitrous/my_app/.bundle/gems/railties-4.2.4/lib/rails/commands/server.rb:78:in `start'
from /home/nitrous/my_app/.bundle/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:80:in `block in server'
from /home/nitrous/my_app/.bundle/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:75:in `tap'
from /home/nitrous/my_app/.bundle/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:75:in `server'
from /home/nitrous/my_app/.bundle/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /home/nitrous/my_app/.bundle/gems/railties-4.2.4/lib/rails/commands.rb:17:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
我是不是丢了什么东西?
最佳答案
找到它,
如果有人遇到同样的问题,我会把答案贴在这里
仅从delayed_job
中删除Gemfile
是不够的。
如文档中所示:https://github.com/collectiveidea/delayed_job,您必须删除相应的db:migrate
任务(或还原它),并编辑application.rb
文件以删除以下行:(如果使用rails 4.2)
config.active_job.queue_adapter = :delayed_job
关于ruby-on-rails - NewRelic认为我已经安装了DelayedJob,但是我没有,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/32446798/