当我用 unicorn 启动 Rails 应用程序时出现奇怪的错误
当我尝试使用 unicorn 启动 Rails 应用程序时,出现了这个非常奇怪的错误。有人见过这个吗?
[root@Web01 mp_app]# unicorn_rails -c config/unicorn.rb -E production -D -d
{:daemonize=>true,
:app=>
#<Proc:0x00002b14fff8c890@/usr/local/lib/ruby/gems/1.8/gems/unicorn-4.0.1/bin/unicorn_rails:135>,
:unicorn_options=>{:config_file=>"config/unicorn.rb", :listeners=>[]}}
Exception `Errno::ENOENT' at /usr/local/lib/ruby/1.8/fileutils.rb:243 - No such file or directory - tmp/cache
Exception `Errno::EEXIST' at /usr/local/lib/ruby/1.8/fileutils.rb:243 - File exists - .
Exception `EOFError' at /usr/local/lib/ruby/gems/1.8/gems/unicorn-4.0.1/lib/unicorn/launcher.rb:46 - end of file reached
编辑
感谢 jdeseno,我已经通过自己创建 tmp 文件夹解决了这个问题。但现在我收到了一个不同的错误:
{:daemonize=>true,
:app=>
#<Proc:0x00002b90ee5098a8@/usr/local/lib/ruby/gems/1.8/gems/unicorn-4.1.1/bin/unicorn_rails:135>,
:unicorn_options=>{:config_file=>"config/unicorn.rb", :listeners=>[]}}
Exception `EOFError' at /usr/local/lib/ruby/gems/1.8/gems/unicorn-4.1.1/lib/unicorn/launcher.rb:46 - end of file reached
对此错误有什么想法吗?错误消息没有提供太多帮助。
I'm getting this very strange error when I attempt to start my rails application with unicorn. Has anyone seen this before?
[root@Web01 mp_app]# unicorn_rails -c config/unicorn.rb -E production -D -d
{:daemonize=>true,
:app=>
#<Proc:0x00002b14fff8c890@/usr/local/lib/ruby/gems/1.8/gems/unicorn-4.0.1/bin/unicorn_rails:135>,
:unicorn_options=>{:config_file=>"config/unicorn.rb", :listeners=>[]}}
Exception `Errno::ENOENT' at /usr/local/lib/ruby/1.8/fileutils.rb:243 - No such file or directory - tmp/cache
Exception `Errno::EEXIST' at /usr/local/lib/ruby/1.8/fileutils.rb:243 - File exists - .
Exception `EOFError' at /usr/local/lib/ruby/gems/1.8/gems/unicorn-4.0.1/lib/unicorn/launcher.rb:46 - end of file reached
EDIT
Thanks to jdeseno, I've solved this by creating the tmp folder myself. But now I'm getting a different error:
{:daemonize=>true,
:app=>
#<Proc:0x00002b90ee5098a8@/usr/local/lib/ruby/gems/1.8/gems/unicorn-4.1.1/bin/unicorn_rails:135>,
:unicorn_options=>{:config_file=>"config/unicorn.rb", :listeners=>[]}}
Exception `EOFError' at /usr/local/lib/ruby/gems/1.8/gems/unicorn-4.1.1/lib/unicorn/launcher.rb:46 - end of file reached
Any ideas on this error? The error message doesn't give much help.
在使用 Unicorn 部署 Rails 站点时,我曾两次遇到来自
launcher.rb:46
的EOFError
问题。在每种情况下,解决方案都是删除/tmp
并让 Unicorn 创建它。我知道您专门手动创建了
/tmp
来解决不同的问题...但也许真正的问题是文件权限或类似的东西阻止 Unicorn 创建/tmp
。I've encountered the
EOFError
fromlauncher.rb:46
problem twice when deploying Rails sites using Unicorn. In each case, the solution was to delete/tmp
and let Unicorn create it.I know that you created
/tmp
manually specifically to solve a different problem... but maybe the real problem was that file permissions or something similar was stopping Unicorn from creating/tmp
.