Is it possible to change Passenger Ruby version without recompiling?

只谈情不闲聊 提交于 2019-11-29 17:47:05

问题


I tried changing the default ruby command to 1.9.2 but Passenger keeps running 1.8.7

Is Passenger compiled with Ruby embedded?


回答1:


To set the Ruby version add this line to your vhost file:

PassengerRuby /path/to/the/ruby/version/you/want/to/use



回答2:


Whenever a "bundle update" updates the version of the passenger gem, I do

sudo su -
passenger-install-apache2-module

At the end of that process, it spits out the full blob of stuff that you need to put at the top or your Apache config. E.g. something like:

LoadModule passenger_module /usr/local/rvm/gems/ruby-1.9.2-p180@rails31/gems/passenger-3.0.9/ext/apache2/mod_passenger.so
PassengerRoot /usr/local/rvm/gems/ruby-1.9.2-p180@rails31/gems/passenger-3.0.9
PassengerRuby /usr/local/rvm/wrappers/ruby-1.9.2-p180@rails31/ruby

I update the blob of stuff, restart Apache and all seems well.

I imagine that this same process is necessary after updating Ruby.




回答3:


Set PassengerRuby before the <Directory> tag.

Example:

PassengerRuby /home/ubuntu/.rvm/wrappers/ruby-2.3.1/ruby

It is working for me!

Find more detail in this post.



来源:https://stackoverflow.com/questions/8102095/is-it-possible-to-change-passenger-ruby-version-without-recompiling

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!