現在、Railsで開発を行い、アプリケーションサーバにunicorn
、デプロイツールにcapistrano3
、
Webサーバにnginx
を利用しているのですが、deploy時のunicornのreloadで修正したソースが反映されず、ハマっております。。。
検索したところ、なかなか回答に結び付く事ができませんでしたので、こちらに質問させていただきます。
環境
- unicorn (5.1.0)
- capistrano (~> 3.5)
- rails (~> 5.0.0)
- nginx (1.11.3)
発生している問題・エラーメッセージ
unicornのerror_logを見たところ、下記の様なメッセージが出力されます。
Your bundle is locked to oj (2.17.4), but that version could not be found in any of the sources listed in your Gemfile. If you haven't changed sources, that means the author of oj (2.17.4) has removed it. You'll need to update your bundle to a different version of oj (2.17.4) that hasn't been removed in order to install. (Bundler::GemNotFound)
該当のソースコード
- config/unicorn.rb(一部)
ruby
1 2before_exec do |server| 3 ENV["BUNDLE_GEMFILE"] = rails_root + "/Gemfile" 4end 5 6before_fork do |server, worker| 7 8 # 古いプロセスを終了 9 old_pid = "#{server.config[:pid]}.oldbin" 10 if File.exist?(old_pid) && server.pid != old_pid 11 begin 12 sig = (worker.nr + 1) >= server.worker_processes ? :QUIT : :TTOU 13 Process.kill(sig, File.read(old_pid).to_i) 14 rescue Errno::ENOENT, Errno::ESRCH 15 end 16 end 17 18 # RDBMS disconnect 19 ActiveRecord::Base.configurations.each do |connection_key, config| 20 ActiveRecord::Base.remove_connection(connection_key.to_sym) 21 end 22 23end 24 25after_fork do |server, worker| 26 27 # RDBMS connect (readonly) 28 ActiveRecord::Base.configurations.each do |connection_key, config| 29 ActiveRecord::Base.establish_connection(connection_key.to_sym) unless (connection_key =~ /_readonly/).nil? 30 end 31 32end 33
試したこと
同じようなエラーで、mysql2
も同様に出ていたので、Gemfileにversionを固定化したところ、該当のエラーは消えました。
これを穀潰しの用にやっていくのは辛いので、何か方法は無いものかと模索しております。
以上、よろしくお願いします。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。