前提・実現したいこと
VPS(Conoha)を使用して、railsのアプリをデプロイしたいです。
unicornの起動(bundle exec rake unicorn:start)をすると以下のような
メッセージが出現します。
発生している問題・エラーメッセージ
bundle exec unicorn_rails -c /Users/naotomatsunaga/App/Portfolio/config/unicorn.rb -E production -D bundler: failed to load command: unicorn_rails (/Users/naotomatsunaga/.rbenv/versions/3.0.0/bin/unicorn_rails) /Users/naotomatsunaga/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/unicorn-6.0.0/lib/unicorn/configurator.rb:85:in `read': No such file or directory @ rb_sysopen - /Users/naotomatsunaga/App/Portfolio/config/unicorn.rb (Errno::ENOENT) from /Users/naotomatsunaga/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/unicorn-6.0.0/lib/unicorn/configurator.rb:85:in `reload' from /Users/naotomatsunaga/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/unicorn-6.0.0/lib/unicorn/configurator.rb:78:in `initialize' from /Users/naotomatsunaga/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/unicorn-6.0.0/lib/unicorn/http_server.rb:78:in `new' from /Users/naotomatsunaga/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/unicorn-6.0.0/lib/unicorn/http_server.rb:78:in `initialize' from /Users/naotomatsunaga/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/unicorn-6.0.0/bin/unicorn_rails:209:in `new' from /Users/naotomatsunaga/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/unicorn-6.0.0/bin/unicorn_rails:209:in `<top (required)>' from /Users/naotomatsunaga/.rbenv/versions/3.0.0/bin/unicorn_rails:23:in `load' from /Users/naotomatsunaga/.rbenv/versions/3.0.0/bin/unicorn_rails:23:in `<top (required)>' from /Users/naotomatsunaga/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/bundler-2.2.3/lib/bundler/cli/exec.rb:63:in `load' from /Users/naotomatsunaga/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/bundler-2.2.3/lib/bundler/cli/exec.rb:63:in `kernel_load' from /Users/naotomatsunaga/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/bundler-2.2.3/lib/bundler/cli/exec.rb:28:in `run' from /Users/naotomatsunaga/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/bundler-2.2.3/lib/bundler/cli.rb:497:in `exec' from /Users/naotomatsunaga/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/bundler-2.2.3/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run' from /Users/naotomatsunaga/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/bundler-2.2.3/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command' from /Users/naotomatsunaga/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/bundler-2.2.3/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch' from /Users/naotomatsunaga/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/bundler-2.2.3/lib/bundler/cli.rb:30:in `dispatch' from /Users/naotomatsunaga/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/bundler-2.2.3/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start' from /Users/naotomatsunaga/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/bundler-2.2.3/lib/bundler/cli.rb:24:in `start' from /Users/naotomatsunaga/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/bundler-2.2.3/exe/bundle:49:in `block in <top (required)>' from /Users/naotomatsunaga/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/bundler-2.2.3/lib/bundler/friendly_errors.rb:130:in `with_friendly_errors' from /Users/naotomatsunaga/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/bundler-2.2.3/exe/bundle:37:in `<top (required)>' from /Users/naotomatsunaga/.rbenv/versions/3.0.0/bin/bundle:23:in `load' from /Users/naotomatsunaga/.rbenv/versions/3.0.0/bin/bundle:23:in `<main>' master failed to start, check stderr log for details rake aborted! Command failed with status (1): [bundle exec unicorn_rails -c /Users/naotom...] /Users/naotomatsunaga/App/Portfolio/lib/tasks/unicorn.rake:8:in `block (2 levels) in <main>' /Users/naotomatsunaga/.rbenv/versions/3.0.0/bin/bundle:23:in `load' /Users/naotomatsunaga/.rbenv/versions/3.0.0/bin/bundle:23:in `<main>' Tasks: TOP => unicorn:start (See full trace by running task with --trace)
unicorn.rb
worker_processes Integer(ENV["WEB_CONCURRENCY"] || 3) timeout 15 preload_app true # Unicornのsock、pidファイルのパスを指定 listen "/home/App/Portfolio/tmp/unicorn.sock" pid "/home/App/Portfolio/tmp/unicorn.pid" before_fork do |server, worker| Signal.trap 'TERM' do puts 'Unicorn master intercepting TERM and sending myself QUIT instead' Process.kill 'QUIT', Process.pid end defined?(ActiveRecord::Base) and ActiveRecord::Base.connection.disconnect! end after_fork do |server, worker| Signal.trap 'TERM' do puts 'Unicorn worker intercepting TERM and doing nothing. Wait for master to send QUIT' end defined?(ActiveRecord::Base) and ActiveRecord::Base.establish_connection end # Unicornのログのパスを指定 stderr_path File.expand_path('log/unicorn.log', ENV['RAILS_ROOT']) stdout_path File.expand_path('log/unicorn.log', ENV['RAILS_ROOT'])
試したこと
listenやpidのpathを変更したりしましたが、上手くいかなかったです。。。
補足情報
初心者で、申し訳ないです。
他に必要な情報がありましたら、ご教授ください。
あなたの回答
tips
プレビュー