Rails-сервер сразу же выходит - Rails 5.2.0 и Ruby 2.5.1

Felipe Marcon спросил: 28 марта 2018 в 01:57 в: ruby-on-rails

Я использовал Rails 5.2.0 и Ruby 2.4.0. Все работало нормально. Поэтому я обновил свой Ruby до 2.5.1 и снова запустил пакет. После этого Когда я запускаю "Rails S", у меня есть ошибка:

rails s
=> Booting Puma
=> Rails 5.2.0 application starting in development 
=> Run `rails server -h` for more startup options
Exiting
Traceback (most recent call last):
        34: from bin/rails:3:in `<main>'
        33: from bin/rails:3:in `load'
        32: from /Users/felipemarcon/projects/marcon_portfolio/bin/spring:15:in `<top (required)>'
        31: from /Users/felipemarcon/projects/marcon_portfolio/bin/spring:15:in `require'
        30: from /Users/felipemarcon/.rvm/gems/ruby-2.5.1@marconPortfolio/gems/spring-2.0.2/lib/spring/binstub.rb:31:in `<top (required)>'
        29: from /Users/felipemarcon/.rvm/gems/ruby-2.5.1@marconPortfolio/gems/spring-2.0.2/lib/spring/binstub.rb:31:in `load'
        28: from /Users/felipemarcon/.rvm/gems/ruby-2.5.1@marconPortfolio/gems/spring-2.0.2/bin/spring:49:in `<top (required)>'
        27: from /Users/felipemarcon/.rvm/gems/ruby-2.5.1@marconPortfolio/gems/spring-2.0.2/lib/spring/client.rb:30:in `run'
        26: from /Users/felipemarcon/.rvm/gems/ruby-2.5.1@marconPortfolio/gems/spring-2.0.2/lib/spring/client/command.rb:7:in `call'
        25: from /Users/felipemarcon/.rvm/gems/ruby-2.5.1@marconPortfolio/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in `call'
        24: from /Users/felipemarcon/.rvm/gems/ruby-2.5.1@marconPortfolio/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in `load'
        23: from /Users/felipemarcon/projects/marcon_portfolio/bin/rails:9:in `<top (required)>'
        22: from /Users/felipemarcon/.rvm/gems/ruby-2.5.1@marconPortfolio/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in `require'
        21: from /Users/felipemarcon/.rvm/gems/ruby-2.5.1@marconPortfolio/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:249:in `load_dependency'
        20: from /Users/felipemarcon/.rvm/gems/ruby-2.5.1@marconPortfolio/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in `block in require'
        19: from /Users/felipemarcon/.rvm/gems/ruby-2.5.1@marconPortfolio/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
        18: from /Users/felipemarcon/.rvm/gems/ruby-2.5.1@marconPortfolio/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
        17: from /Users/felipemarcon/.rvm/gems/ruby-2.5.1@marconPortfolio/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
        16: from /Users/felipemarcon/.rvm/gems/ruby-2.5.1@marconPortfolio/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
        15: from /Users/felipemarcon/.rvm/gems/ruby-2.5.1@marconPortfolio/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
        14: from /Users/felipemarcon/.rvm/gems/ruby-2.5.1@marconPortfolio/gems/railties-5.2.0/lib/rails/commands.rb:18:in `<main>'
        13: from /Users/felipemarcon/.rvm/gems/ruby-2.5.1@marconPortfolio/gems/railties-5.2.0/lib/rails/command.rb:46:in `invoke'
        12: from /Users/felipemarcon/.rvm/gems/ruby-2.5.1@marconPortfolio/gems/railties-5.2.0/lib/rails/command/base.rb:65:in `perform'
        11: from /Users/felipemarcon/.rvm/gems/ruby-2.5.1@marconPortfolio/gems/thor-0.20.0/lib/thor.rb:387:in `dispatch'
        10: from /Users/felipemarcon/.rvm/gems/ruby-2.5.1@marconPortfolio/gems/thor-0.20.0/lib/thor/invocation.rb:126:in `invoke_command'
         9: from /Users/felipemarcon/.rvm/gems/ruby-2.5.1@marconPortfolio/gems/thor-0.20.0/lib/thor/command.rb:27:in `run'
         8: from /Users/felipemarcon/.rvm/gems/ruby-2.5.1@marconPortfolio/gems/railties-5.2.0/lib/rails/commands/server/server_command.rb:142:in `perform'
         7: from /Users/felipemarcon/.rvm/gems/ruby-2.5.1@marconPortfolio/gems/railties-5.2.0/lib/rails/commands/server/server_command.rb:142:in `tap'
         6: from /Users/felipemarcon/.rvm/gems/ruby-2.5.1@marconPortfolio/gems/railties-5.2.0/lib/rails/commands/server/server_command.rb:147:in `block in perform'
         5: from /Users/felipemarcon/.rvm/gems/ruby-2.5.1@marconPortfolio/gems/railties-5.2.0/lib/rails/commands/server/server_command.rb:53:in `start'
         4: from /Users/felipemarcon/.rvm/gems/ruby-2.5.1@marconPortfolio/gems/rack-2.0.4/lib/rack/server.rb:297:in `start'
         3: from /Users/felipemarcon/.rvm/gems/ruby-2.5.1@marconPortfolio/gems/puma-3.11.4/lib/rack/handler/puma.rb:66:in `run'
         2: from /Users/felipemarcon/.rvm/gems/ruby-2.5.1@marconPortfolio/gems/puma-3.11.4/lib/rack/handler/puma.rb:66:in `new'
         1: from /Users/felipemarcon/.rvm/gems/ruby-2.5.1@marconPortfolio/gems/puma-3.11.4/lib/puma/launcher.rb:74:in `initialize'
/Users/felipemarcon/.rvm/gems/ruby-2.5.1@marconPortfolio/gems/puma-3.11.4/lib/puma/launcher.rb:74:in `chdir': No such file or directory @ dir_s_chdir - /{path_to_your_app}/current (Errno::ENOENT)  

Что случилось? Как я могу это решить?

Спасибо.

1 ответ

Есть решение
Felipe Marcon ответил: 29 марта 2018 в 04:07

Я должен решить это. Это просто проблема с файлом config / puma.rb. Теперь все работает нормально, с Ruby 2.5.1 и Rails 5.2.0.

Мой puma.rb был такой:

environment "production"bind  "unix:///{path_to_your_app}/shared/tmp/sockets/puma.sock"
pidfile "/{path_to_your_app}/shared/tmp/pids/puma.pid"
state_path "/{path_to_your_app}/shared/tmp/sockets/puma.state"
directory "/{path_to_your_app}/current"workers 2
threads 1,2daemonize trueactivate_control_app 'unix:///{path_to_your_app}/shared/tmp/sockets/pumactl.sock'prune_bundler

Я просто перехожу на ( начальная конфигурация):

threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
threads threads_count, threads_countport        ENV.fetch("PORT") { 3000 }environment ENV.fetch("RAILS_ENV") { "development" }plugin :tmp_restartbind "unix:/home/rails/marcon/shared/tmp/sockets/puma.sock" if ENV.fetch("RAILS_ENV") == 'production'

В любом случае, спасибо всем, кто ответил.