RailsアプリをCapistrano3でデプロイしようとしています。
開発はRails5.1.3で行っていたのですが5.1.7になってしまっていたのと開発環境でブラウザにアクセス出来なくなってしまい解決方法がわからないのでご教示お願いします。
Capistranoの設定をしてbundle installしたらRailsのバージョンがRails5.1.7になってしまいました。
Gemfileは以下の内容になっています。
gem 'rails', '~> 5.1.3' gem 'capistrano-rails', require: false
hostsファイルの設定は以下のようにしています。 127.0.0.1 example.com abcde-gate.com # 開発環境 XXX.XXX.XXX.XX abcde-gate.com # VPS
開発側にunicornをインストールと設定
config/unicorn.rb worker_processes Integer(ENV["WEB_CONCURRENCY"] || 3) timeout 15 preload_app true listen '/home/vagrant/XXXX/XXXX/tmp/unicorn.sock' pid '/home/vagrant/XXXX/XXXX/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 stderr_path File.expand_path('log/unicorn.log', ENV['RAILS_ROOT']) stdout_path File.expand_path('log/unicorn.log', ENV['RAILS_ROOT'])
~/.bash_profileにRAILS_ROOT記述
export RAILS_ROOT=/home/vagrant/XXXX/XXXX/
以上のようにしました。
VPS側では特に問題なしです。
デプロイはできていないのでVPSでアプリ画面の表示はできていませんがNginxの初期画面はhttpsで表示できています。(https//abcde-gate.comでアクセス完了)
画面表示を確認してみようと開発環境でアプリ画面を開こうと $ rails s を実行しました。
$ rails s => Booting Puma => Rails 5.1.7 application starting in development => Run `rails server -h` for more startup options Puma starting in single mode... * Version 3.12.1 (ruby 2.3.1-p112), codename: Llamas in Pajamas * Min threads: 5, max threads: 5 * Environment: development * Listening on tcp://localhost:3000 Use Ctrl-C to stop
Railsのバージョンが5.1.3から5.1.7になっていました。
gem 'capistrano-rails', require: false でバージョンが変わってしまったのでしょうか?
rails sを実行すると=> Rails 5.1.7 application starting in development on http://localhost:3000
となっていると思ったのですが
=> Rails 5.1.7 application starting in development で終わっています。
railsがhttp://localhost:3000で起動していないのでは?
この状態のままブラウザでアクセスすると、
このサイトにアクセスできません http://abcde-gate.com:3000/ のウェブページは一時的に停止しているか、新しいウェブアドレスに移動した可能性があります。 ERR_SOCKET_NOT_CONNECTED
hostsファイルの VPS側のXXX.XXX.XXX.XX abcde-gate.comをコメントアウトしても同じでした。
Railsのバージョンを5.3.1のままにしておくにはどうしたらいいのでしょうか?
http://abcde-gate.com:3000で起動し、アクセスするにはどうすればいいのでしょうか?
unicornを開発環境にインストールしたのが原因なのでしょうか?
どなたかご教示お願いします。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/04/11 01:16