是否可以在不重新编译的情况下更改 Passenger Ruby 版本?

发布于 2024-12-15 12:16:35 字数 105 浏览 2 评论 0原文

我尝试将默认的 ruby 命令更改为 1.9.2,但 Passenger 一直运行 1.8.7

Passenger 是否使用嵌入的 Ruby 进行编译?

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

Is Passenger compiled with Ruby embedded?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

居里长安 2024-12-22 12:16:35

要设置 Ruby 版本,请将此行添加到您的 vhost 文件中:

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

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

PassengerRuby /path/to/the/ruby/version/you/want/to/use
李不 2024-12-22 12:16:35

每当“捆绑更新”更新乘客 gem 的版本时,我都会

sudo su -
passenger-install-apache2-module

在该过程结束时吐出您需要放在顶部或 Apache 配置的完整内容。例如:

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

我更新了一些东西,重新启动 Apache,一切看起来都很好。

我想在更新 Ruby 后,同样的过程也是必要的。

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.

花落人断肠 2024-12-22 12:16:35

将 PassengerRuby 设置在 标记之前。

示例:

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

它对我有用!

这篇文章中查找更多详细信息。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文