在生产中部署我的应用程序时出现问题...我的Gemfile包含gem'depaise',一切正常,在开发中...
这是我的unicorn_stderr.log文件,其中[XXXXXX]是我的rails app文件夹。
I, [2013-02-05T13:49:10.820924 #18780] INFO -- : Refreshing Gem list
E, [2013-02-05T13:49:14.488684 #18777] ERROR -- : uninitialized constant Devise (NameError)
[XXXXXX]/releases/20130205012052/config/initializers/devise.rb:3:in `<top (required)>'
[XXXXXX]/shared/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/engine.rb:588:in `block (2 levels) in <class:Engine>'
[XXXXXX]/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/engine.rb:587:in `each'
[XXXXXX]/shared/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/engine.rb:587:in `block in <class:Engine>'
[XXXXXX]/shared/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/initializable.rb:30:in `instance_exec'
[XXXXXX]/shared/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/initializable.rb:30:in `run'
[XXXXXX]/shared/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/initializable.rb:55:in `block in run_initializers'
[XXXXXX]/shared/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/initializable.rb:54:in `each'
[XXXXXX]/shared/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/initializable.rb:54:in `run_initializers'
[XXXXXX]/shared/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/application.rb:136:in `initialize!'
[XXXXXX]/shared/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/railtie/configurable.rb:30:in `method_missing'
[XXXXXX]/releases/20130205012052/config/environment.rb:5:in `<top (required)>'
config.ru:4:in `require'
config.ru:4:in `block in <main>'
[XXXXXX]/shared/bundle/ruby/1.9.1/gems/rack-1.4.4/lib/rack/builder.rb:51:in `instance_eval'
[XXXXXX]/shared/bundle/ruby/1.9.1/gems/rack-1.4.4/lib/rack/builder.rb:51:in `initialize'
config.ru:1:in `new'
config.ru:1:in `<main>'
[XXXXXX]/shared/bundle/ruby/1.9.1/gems/unicorn-4.5.0/lib/unicorn.rb:44:in `eval'
[XXXXXX]/shared/bundle/ruby/1.9.1/gems/unicorn-4.5.0/lib/unicorn.rb:44:in `block in builder'
[XXXXXX]/shared/bundle/ruby/1.9.1/gems/unicorn-4.5.0/lib/unicorn/http_server.rb:718:in `call'
[XXXXXX]/shared/bundle/ruby/1.9.1/gems/unicorn-4.5.0/lib/unicorn/http_server.rb:718:in `build_app!'
[XXXXXX]/shared/bundle/ruby/1.9.1/gems/unicorn-4.5.0/lib/unicorn/http_server.rb:591:in `init_worker_process'
[XXXXXX]/shared/bundle/ruby/1.9.1/gems/unicorn-4.5.0/lib/unicorn/http_server.rb:611:in `worker_loop'
[XXXXXX]/shared/bundle/ruby/1.9.1/gems/unicorn-4.5.0/lib/unicorn/http_server.rb:500:in `spawn_missing_workers'
[XXXXXX]/shared/bundle/ruby/1.9.1/gems/unicorn-4.5.0/lib/unicorn/http_server.rb:511:in `maintain_worker_count'
[XXXXXX]/shared/bundle/ruby/1.9.1/gems/unicorn-4.5.0/lib/unicorn/http_server.rb:277:in `join'
[XXXXXX]/shared/bundle/ruby/1.9.1/gems/unicorn-4.5.0/bin/unicorn:121:in `<top (required)>'
[XXXXXX]/shared/bundle/ruby/1.9.1/bin/unicorn:23:in `load'
[XXXXXX]/shared/bundle/ruby/1.9.1/bin/unicorn:23:in `<main>'
E, [2013-02-05T13:49:14.502380 #17308] ERROR -- : reaped #<Process::Status: pid 18777 exit 1> worker=1
I, [2013-02-05T13:49:14.502544 #17308] INFO -- : worker=1 spawning...
I, [2013-02-05T13:49:14.512618 #18783] INFO -- : worker=1 spawned pid=18783
I, [2013-02-05T13:49:14.512882 #18783] INFO -- : Refreshing Gem list
我不明白这个问题......我用谷歌搜索了这个,但我发现什么都没有帮助我,我希望有人可以帮助我!
答案 0 :(得分:1)
我修复了它...我的script/rails
和config/unicorn_init.sh
不可执行,因此这些文件上的简单chmod u+x
解决了我的问题。设计不是问题!
答案 1 :(得分:0)
在我使用Devise部署新版本后,今天在生产服务器上也遇到了同样的问题。我读了很多主题,检查了所有配置文件,一切正常,但unicorn在日志文件中写了下一个:
错误-:未初始化的常量设计(NameError)
我的解决方案是:停止并启动独角兽守护程序。重新启动没有帮助。作为成功的标志-您需要检查/ tmp / pids /文件夹。当您停止该过程时,该文件夹将变为空。