[英]Phusion Passenger error with Rails 4 and ruby 2.5
Ubuntu 16.04
Rails 4.2.10
Ruby 2.5.0
SERVER_SOFTWARE = Apache/2.4.18 (Ubuntu) Phusion_Passenger/5.2.2
I installed ruby using rbenv, and when I do 我使用rbenv安装了ruby,当我这样做时
ruby -v
I get 我懂了
ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-linux]
I installed Phusion Passenger as follows: 我按如下方式安装了Phusion Passenger:
sudo apt-get install -y dirmngr gnupg
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 561F9B9CAC40B2F7
sudo apt-get install -y apt-transport-https ca-certificates
sudo sh -c 'echo deb https://oss-binaries.phusionpassenger.com/apt/passenger trusty main > /etc/apt/sources.list.d/passenger.list'
sudo apt-get update
sudo apt-get install -y libapache2-mod-passenger
sudo a2enmod passenger
sudo apache2ctl restart
When I do: 当我做:
sudo /usr/bin/passenger-config validate-install
I get: 我得到:
* Checking whether this Passenger install is in PATH... ✓
* Checking whether there are no other Passenger installations... ✓
Everything looks good. :-)
However, when I try to start my application, I get an error message: 但是,当我尝试启动我的应用程序时,出现错误消息:
Web application could not be started
Web application could not be started by the Phusion Passenger application server.
From the /var/log/apache2/error.log, I get: 从/var/log/apache2/error.log中,我得到:
Error ID: d8f774a0
Error details saved to: /tmp/passenger-error-ShCphj.html
Message from application: cannot load such file -- bundler/setup (LoadError)
/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:456:in `activate_gem'
/usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:323:in `block in run_load_path_setup_code'
/usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:461:in `running_bundler'
/usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:322:in `run_load_path_setup_code'
/usr/share/passenger/helper-scripts/rack-preloader.rb:100:in `preload_app'
/usr/share/passenger/helper-scripts/rack-preloader.rb:156:in `<module:App>'
/usr/share/passenger/helper-scripts/rack-preloader.rb:30:in `<module:PhusionPassenger>'
/usr/share/passenger/helper-scripts/rack-preloader.rb:29:in `<main>'
================================ ================================
The answer is to uninstall stand alone Phusion Passenger, and install it as a gem, as follows: 答案是卸载独立的Phusion Passenger,并将其安装为gem,如下所示:
sudo apt-get remove -y passenger libapache2-mod-passenger
Then installing the gem 然后安装宝石
gem install passenger --no-rdoc --no-ri
passenger-install-apache2-module
Follow the install directions 遵循安装说明
Try this, 尝试这个,
gem install bundler
and 和
bundle install
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.