1

在生产中部署我的应用程序时遇到问题...我的 Gemfile 包含 gem 'devise' 并且在开发中一切正常...

这是我的 unicorn_stderr.log 文件,其中 [XXXXXX] 是我的 rails 应用程序文件夹。

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

我不明白这个问题......我用谷歌搜索了这个但我发现没有任何帮助,我希望有人能帮助我!

4

2 回答 2

1

我修复了它......我的script/rails并且config/unicorn_init.sh不可执行,所以chmod u+x这些文件的简单解决了我的问题。这不是设计的问题!

于 2013-02-12T14:01:07.337 回答
0

在我使用 Devise 部署新版本后,今天在生产服务器上遇到了同样的问题。我阅读了很多主题,检查了所有配置文件,一切正常,但独角兽在日志文件中写入了下一个:

错误——:未初始化的常量设计(NameError)

我的解决方案是:停止并启动独角兽守护进程。重新启动没有帮助。作为成功的标志 - 您需要检查 /tmp/pids/ 文件夹。当您停止该过程时,此文件夹将变为空。

于 2019-06-04T06:39:23.970 回答