Rails& Puma Server启动错误

时间:2016-05-17 07:11:26

标签: ruby-on-rails puma

使用Puma运行rails s命令时收到以下错误。

这是我的错误日志:

`➜  AdminInterface git:(master) ✗ rails s
=> Booting Puma
=> Rails 4.2.6 application starting in development on http://localhost:3000
=> Run 'rails server -h' for more startup options
=> Ctrl-C to shutdown server
[76311] Puma starting in cluster mode...
[76311] * Version 3.4.0 (ruby 2.3.0-p0), codename: Owl Bowl Brawl
[76311] * Min threads: 1, max threads: 6
[76311] * Environment: development
[76311] * Process workers: 1
[76311] * Phased restart available
[76311] * Listening on tcp://localhost:3000
[76311] Use Ctrl-C to stop
/Users/Paradise/.rvm/gems/ruby-2.3.0/gems/puma-3.4.0/lib/puma/runner.rb:103:in 'reopen': No such file or directory @ rb_io_reopen - /Users/Paradise/Documents/Dev/salon-spa-pass/AdminInterface/shared/log/puma.stdout.log (Errno::ENOENT)
    from /Users/Paradise/.rvm/gems/ruby-2.3.0/gems/puma-3.4.0/lib/puma/runner.rb:103:in 'redirect_io'
    from /Users/Paradise/.rvm/gems/ruby-2.3.0/gems/puma-3.4.0/lib/puma/cluster.rb:40:in 'redirect_io'
    from /Users/Paradise/.rvm/gems/ruby-2.3.0/gems/puma-3.4.0/lib/puma/cluster.rb:414:in 'run'
    from /Users/Paradise/.rvm/gems/ruby-2.3.0/gems/puma-3.4.0/lib/puma/launcher.rb:172:in 'run'
    from /Users/Paradise/.rvm/gems/ruby-2.3.0/gems/puma-3.4.0/lib/rack/handler/puma.rb:51:in 'run'
    from /Users/Paradise/.rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/server.rb:286:in 'start'
    from /Users/Paradise/.rvm/gems/ruby-2.3.0/gems/railties-4.2.6/lib/rails/commands/server.rb:80:in 'start'
    from /Users/Paradise/.rvm/gems/ruby-2.3.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:80:in 'block in server'
    from /Users/Paradise/.rvm/gems/ruby-2.3.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:75:in 'tap'
    from /Users/Paradise/.rvm/gems/ruby-2.3.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:75:in 'server'
    from /Users/Paradise/.rvm/gems/ruby-2.3.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:39:in 'run_command!'
    from /Users/Paradise/.rvm/gems/ruby-2.3.0/gems/railties-4.2.6/lib/rails/commands.rb:17:in '<top (required)>'
    from bin/rails:4:in 'require'
    from bin/rails:4:in '<main>'

1 个答案:

答案 0 :(得分:2)

Puma抱怨找不到/Users/Paradise/Documents/Dev/salon-spa-pass/AdminInterface/shared/log/puma.std‌​out.log。在unix / linux / Mac OS X系统上,这可能意味着进程(或其用户)没有该文件的权限。

检查文件是否存在以及是否正确设置了权限。如果文件不存在,你可以在Unix系统上做这样的事情来创建路径中的文件夹和一个空白文件:

mkdir -p /Users/Paradise/Documents/Dev/salon-spa-pass/AdminInterface/shared/log/ && touch /Users/Paradise/Documents/Dev/salon-spa-pass/AdminInterface/shared/log/puma.std‌​out.log

这将确保正确创建文件。执行此操作后,请务必再次验证文件权限。