EC2内でrailsを起動できません。
[ec2-user@ip-172-31-45-189 newneu-hp]$ bundle exec unicorn_rails -c config/unicorn.rb -E production -D
master failed to start, check stderr log for details
EC2でエラーlogを確認しました。
[ec2-user@ip-172-31-45-189 log]$ cat unicorn.stderr.log
…
DEPRECATION WARNING: Including LoggerSilence is deprecated and will be removed in Rails 6.1. Please use ActiveSupport::LoggerSilence
instead (called from <top (required)> at /var/www/newneu-hp/config/application.rb:7)
…
bundler: failed to load command: unicorn_rails (/home/ec2-user/.rbenv/versions/2.6.5/bin/unicorn_rails)
ArgumentError: Already running on PID:13986 (or pid=/var/www/newneu-hp/tmp/pids/unicorn.pid is stale))
知識が乏しくActiveSupport :: LoggerSilence
の使用の仕方が分かりません。
ご教授頂けますと幸いです。
該当のソースコード
application.rb
1require_relative 'boot' 2 3require 'rails/all' 4 5# Require the gems listed in Gemfile, including any gems 6# you've limited to :test, :development, or :production. 7Bundler.require(*Rails.groups) 8 9module NewneuHp 10 class Application < Rails::Application 11 # Initialize configuration defaults for originally generated Rails version. 12 config.load_defaults 6.0 13 14 # Settings in config/environments/* take precedence over those specified here. 15 # Application configuration can go into files in config/initializers 16 # -- all .rb files in that directory are automatically loaded after loading 17 # the framework and any gems in your application. 18 end 19end
# MySQL. Versions 5.5.8 and up are supported. # # Install the MySQL driver # gem install mysql2 # # Ensure the MySQL gem is defined in your Gemfile # gem 'mysql2' # # And be sure to use new-style password hashing: # https://dev.mysql.com/doc/refman/5.7/en/password-hashing.html # default: &default adapter: mysql2 encoding: utf8mb4 pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> username: root password: <%= ENV['NEWNEU_HP_DATABASE_PASSWORD'] %> socket: /tmp/mysql.sock development: <<: *default database: newneu_hp_development # Warning: The database defined as "test" will be erased and # re-generated from your development database when you run "rake". # Do not set this db to the same as development or production. test: <<: *default database: newneu_hp_test # As with config/credentials.yml, you never want to store sensitive information, # like your database password, in your source code. If your source code is # ever seen by anyone, they now have access to your database. # # Instead, provide the password as a unix environment variable when you boot # the app. Read https://guides.rubyonrails.org/configuring.html#configuring-a-database # for a full rundown on how to provide these environment variables in a # production deployment. # # On Heroku and other platform providers, you may have a full connection URL # available as an environment variable. For example: # # DATABASE_URL="mysql2://myuser:mypass@localhost/somedatabase" # # You can use this database configuration with: # # production: # url: <%= ENV['DATABASE_URL'] %> # production: <<: *default database: newneu_hp_production username: root password: <%= ENV['DATABASE_PASSWORD'] %> socket: /var/lib/mysql/mysql.sock
動作中のプロセスに対してkillコマンドを使って全て停止させましたがエラーは変わりませんでしたがエラー文は変わりませんでした。
[ec2-user@ip-172-31-45-189 newneu-hp]$ kill 19975
[ec2-user@ip-172-31-45-189 newneu-hp]$ ps aux | grep unicorn
ec2-user 20174 0.0 0.0 119436 956 pts/0 S+ 01:07 0:00 grep --color=auto unicorn
###バージョン
unicorn (5.4.1)
回答2件
あなたの回答
tips
プレビュー