Ruby 버전 업데이트 후 Apache/Passenger 에러 발생시
디플로이 해서 서비스가 돌고 있던 우분투 서버에서, 루비 버전을 업데이트 한 뒤에 서비스에 문제가 발생 하였다.
tail -f /var/log/apache2/error.log
명령어로 로그를 확인 한 결과 아래와 같았다.
App 3467 output: Documentation:
App 3467 output:
App 3467 output: rvm wrapper [help]
App 3467 output:
App 3467 output: For additional documentation please visit https://rvm.io
App 3467 output:
App 3467 output: Error: The application encountered the following error: Your Ruby version is 2.7.0, but your Gemfile specified 3.0.2 (Bundler::RubyVersionMismatch)
App 3467 output: /usr/share/rvm/rubies/ruby-2.7.0/lib/ruby/site_ruby/2.7.0/bundler/definition.rb:447:in `validate_ruby!'
App 3467 output: /usr/share/rvm/rubies/ruby-2.7.0/lib/ruby/site_ruby/2.7.0/bundler/definition.rb:422:in `validate_runtime!'
App 3467 output: /usr/share/rvm/rubies/ruby-2.7.0/lib/ruby/site_ruby/2.7.0/bundler.rb:144:in `setup'
App 3467 output: /usr/share/rvm/rubies/ruby-2.7.0/lib/ruby/site_ruby/2.7.0/bundler/setup.rb:20:in `block in <top (required)>'
App 3467 output: /usr/share/rvm/rubies/ruby-2.7.0/lib/ruby/site_ruby/2.7.0/bundler/ui/shell.rb:136:in `with_level'
App 3467 output: /usr/share/rvm/rubies/ruby-2.7.0/lib/ruby/site_ruby/2.7.0/bundler/ui/shell.rb:88:in `silence'
App 3467 output: /usr/share/rvm/rubies/ruby-2.7.0/lib/ruby/site_ruby/2.7.0/bundler/setup.rb:20:in `<top (required)>'
App 3467 output: /usr/share/rvm/rubies/ruby-2.7.0/lib/ruby/site_ruby/2.7.0/rubygems/core_ext/kernel_require.rb:85:in `require'
App 3467 output: /usr/share/rvm/rubies/ruby-2.7.0/lib/ruby/site_ruby/2.7.0/rubygems/core_ext/kernel_require.rb:85:in `require'
App 3467 output: /usr/share/rvm/gems/ruby-2.7.0/gems/passenger-6.0.12/src/ruby_supportlib/phusion_passenger/loader_shared_helpers.rb:380:in `activate_gem'
App 3467 output: /usr/share/rvm/gems/ruby-2.7.0/gems/passenger-6.0.12/src/ruby_supportlib/phusion_passenger/loader_shared_helpers.rb:221:in `block in run_load_path_setup_code'
App 3467 output: /usr/share/rvm/gems/ruby-2.7.0/gems/passenger-6.0.12/src/ruby_supportlib/phusion_passenger/loader_shared_helpers.rb:544:in `running_bundler'
App 3467 output: /usr/share/rvm/gems/ruby-2.7.0/gems/passenger-6.0.12/src/ruby_supportlib/phusion_passenger/loader_shared_helpers.rb:220:in `run_load_path_setup_code'
App 3467 output: /usr/share/rvm/gems/ruby-2.7.0/gems/passenger-6.0.12/src/helper-scripts/rack-preloader.rb:91:in `preload_app'
App 3467 output: /usr/share/rvm/gems/ruby-2.7.0/gems/passenger-6.0.12/src/helper-scripts/rack-preloader.rb:189:in `block in <module:App>'
App 3467 output: /usr/share/rvm/gems/ruby-2.7.0/gems/passenger-6.0.12/src/ruby_supportlib/phusion_passenger/loader_shared_helpers.rb:397:in `run_block_and_record_step_progress'
App 3467 output: /usr/share/rvm/gems/ruby-2.7.0/gems/passenger-6.0.12/src/helper-scripts/rack-preloader.rb:188:in `<module:App>'
App 3467 output: /usr/share/rvm/gems/ruby-2.7.0/gems/passenger-6.0.12/src/helper-scripts/rack-preloader.rb:30:in `<module:PhusionPassenger>'
App 3467 output: /usr/share/rvm/gems/ruby-2.7.0/gems/passenger-6.0.12/src/helper-scripts/rack-preloader.rb:29:in `<main>'
[ E 2021-11-16 06:32:06.8713 2732/Tp age/Cor/App/Implementation.cpp:221 ]: Could not spawn process for application /var/www/html: The application encountered the following error: Your Ruby version is 2.7.0, but your Gemfile specified 3.0.2 (Bundler::RubyVersionMismatch)
Error ID: acc7d584
Error details saved to: /tmp/passenger-error-K2NioF.html
해결책
이를 해결 하기 위해서, 업데이트된 루비에 맞게 패신저 잼을 새로 깔고 셋업을 해주어야 한다.
gem install passenger
passenger-install-apache2-module
sudo vim /etc/apache2/apache2.conf
파일에 아래 내용을 넣어 준다.
정상 동작 하는 것을 확인할 수 있다.
Author And Source
이 문제에 관하여(Ruby 버전 업데이트 후 Apache/Passenger 에러 발생시), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://velog.io/@rails/Ruby-버전-업데이트-후-ApachePassenger-에러-발생시저자 귀속: 원작자 정보가 원작자 URL에 포함되어 있으며 저작권은 원작자 소유입니다.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)