2013-07-26 30 views
1

我的應用程序在部署後的今天下午開始崩潰。應用程序崩潰:active_support/dependencies.rb:251:在'require'中:無法加載這樣的文件 - JSON(LoadError)

這裏的堆棧:

2013-07-26T17:56:41.137752+00:00 app[web.1]: ** [NewRelic][07/26/13 17:56:41 +0000 b35a7e48-4d93-4e0d-af43-376dec33f34b (2)] INFO : Starting Agent shutdown 
2013-07-26T17:56:41.467644+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require': cannot load such file -- JSON (LoadError) 
2013-07-26T17:56:41.467644+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require' 
2013-07-26T17:56:41.467644+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require' 
2013-07-26T17:56:41.467644+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency' 
2013-07-26T17:56:41.467644+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency' 
2013-07-26T17:56:41.467644+00:00 app[web.1]: from /app/lib/wwtk/device_api.rb:1:in `<top (required)>' 
2013-07-26T17:56:41.467644+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require' 
2013-07-26T17:56:41.467644+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require' 
2013-07-26T17:56:41.467829+00:00 app[web.1]: from/
app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/inflector/methods.rb:230:in `block in constantize' 
2013-07-26T17:56:41.467829+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/inflector/methods.rb:229:in `each' 
2013-07-26T17:56:41.467644+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require' 
2013-07-26T17:56:41.467644+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:359:in `require_or_load' 
2013-07-26T17:56:41.467829+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:502:in `load_missing_constant' 
2013-07-26T17:56:41.467829+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:192:in `block in const_missing' 
2013-07-26T17:56:41.467829+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:190:in `each' 
2013-07-26T17:56:41.467829+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/inflector/methods.rb:229:in `constantize' 
2013-07-26T17:56:41.467981+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/application/finisher.rb:31:in `block in <module:Finisher>' 
2013-07-26T17:56:41.467829+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:190:in `const_missing' 
2013-07-26T17:56:41.467829+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:554:in `get' 
2013-07-26T17:56:41.467829+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/middleware/stack.rb:24:in `klass' 
2013-07-26T17:56:41.467829+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/middleware/stack.rb:43:in `build' 
2013-07-26T17:56:41.467981+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/middleware/stack.rb:113:in `block in build' 
2013-07-26T17:56:41.467981+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/middleware/stack.rb:113:in `each' 
2013-07-26T17:56:41.467981+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/middleware/stack.rb:113:in `inject' 
2013-07-26T17:56:41.468517+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:51:in `initialize' 
2013-07-26T17:56:41.468517+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/railtie/configurable.rb:30:in `method_missing' 
2013-07-26T17:56:41.468517+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `run_initializers' 
2013-07-26T17:56:41.468517+00:00 app[web.1]: from /app/config/environment.rb:5:in `<top (required)>' 
2013-07-26T17:56:41.468517+00:00 app[web.1]: from config.ru:1:in `<main>' 
2013-07-26T17:56:41.468682+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/unicorn-4.6.2/lib/unicorn/http_server.rb:140:in `start' 
2013-07-26T17:56:41.468517+00:00 app[web.1]: from config.ru:1:in `new' 
2013-07-26T17:56:41.467981+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `instance_exec' 
2013-07-26T17:56:41.467981+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/middleware/stack.rb:113:in `build' 
2013-07-26T17:56:41.467981+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `run' 
2013-07-26T17:56:41.467981+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/engine.rb:470:in `app' 
2013-07-26T17:56:41.467981+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `each' 
2013-07-26T17:56:41.468517+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/application.rb:136:in `initialize!' 
2013-07-26T17:56:41.468517+00:00 app[web.1]: from config.ru:4:in `block in <main>' 
2013-07-26T17:56:41.468517+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:51:in `instance_eval' 
2013-07-26T17:56:41.467981+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/initializable.rb:55:in `block in run_initializers' 
2013-07-26T17:56:41.468682+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/unicorn-4.6.2/lib/unicorn.rb:44:in `block in builder' 
2013-07-26T17:56:41.468682+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/unicorn-4.6.2/lib/unicorn/http_server.rb:722:in `call' 
2013-07-26T17:56:41.468682+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/unicorn-4.6.2/lib/unicorn/http_server.rb:722:in `build_app!' 
2013-07-26T17:56:41.468682+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/unicorn-4.6.2/bin/unicorn:126:in `<top (required)>' 
2013-07-26T17:56:41.468517+00:00 app[web.1]: from config.ru:4:in `require' 
2013-07-26T17:56:41.468682+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/unicorn-4.6.2/lib/unicorn.rb:44:in `eval' 
2013-07-26T17:56:41.468682+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/bin/unicorn:23:in `<main>' 
2013-07-26T17:56:41.468682+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/bin/unicorn:23:in `load' 
2013-07-26T17:56:43.135205+00:00 heroku[web.1]: State changed from starting to crashed 

我們還沒有真正改變了我們的Gemfile。

的Gemfile.lock的已經包含了JSON:

> grep json Gemfile.lock 
     multi_json (~> 1.0) 
     multi_json (~> 1.0) 
     json 
    json (1.8.0) 
     multi_json (>= 1.5) 
    multi_json (1.7.6) 
     multi_json (~> 1.0) 
     multi_json (~> 1.3) 
     json (~> 1.4) 
     multi_json (~> 1.0) 
     multi_json (~> 1.0) 
     multi_json (~> 1.0, >= 1.0.2) 

我試圖重新啓動應用程序或使用Heroku的回購:purge_cache。沒什麼幫助。

回答

1

Arg。這是在我們的要求之一區分大小寫的問題

-require 'JSON' 
+require 'json' 

修正了它。開發環境對此並不敏感。

+0

您是如何發現這是問題的? Heroku在'active_support'文件系統中爲我提供了一個神祕的錯誤,告訴我這是我的控制器中的語法錯誤 - 這是錯誤的。 – Brian

相關問題