本文介绍了服务器中的默认红宝石的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的服务器中,当我运行 ruby -v 我得到:}

In my server, when I run ruby -v I get:}

ruby 1.9.2p290 (2011-07-09 revision 32553) [i686-linux]

但是当我运行 sudo ruby​​ -v 我得到

but when I run sudo ruby -v I get

ruby 1.8.7 (2010-01-10 patchlevel 249) [i486-linux]

我已尝试按照此处的建议设置替代方案,但我刚刚收到一条错误消息.我也试过 默认选项和 rvm,但也没有用

I have tried setting the alternatives as suggested here, but I just got an error message.I have also tried the default option with rvm, but didn't work either

由于我尝试在服务器中执行此操作,因此我没有 root 权限 (su),因此有些事情我无法尝试.

Since I'm trying to do this in the server, I don't have root permission (su) so there are some things I can't try.

如何使用 ruby​​ 1.9.2?我收到消息

What can I do to use ruby 1.9.2?I am getting the message

Could not find paperclip-3.0.3 in any of the sources (Bundler::GemNotFound)

Exception class:
PhusionPassenger::UnknownError
and I am sure it is caused by the ruby version.

也许我只需要按照建议设置乘客的 ruby​​ 路径 here,但我似乎找不到应该在其中设置PassengerRuby的文件vhost

Maybe I just need to set Passenger's ruby path as suggested here, but I can't seem to find the file vhost where I should set PassengerRuby

推荐答案

意图失败 8 小时后,这就是解决它的方法:

After 8 hours of failed intents, this is what solved it:

我所要做的就是再次配置 Apache/Passenger.

All I had to do was configure Apache/Passenger again.

rvm use 1.9.2
gem install passenger --pre
passenger-install-apache2-module

按照说明安装apache.然后按照之前的说明配置文件apache2.conf.在这里我粘贴了指令中给出的代码行(并发现了其他引用 ruby​​1.8 的行,所以现在引用 ruby​​ 1.9.2)

followed the instructions to install apache. Then configured the file apache2.conf as told my the instructions before. Here I pasted the lines of code given in the instruction (and found out other lines that made reference to ruby1.8 so now the refer to ruby 1.9.2)

然后用

 sudo apache2ctl restart

感谢这篇文章 但我不需要按照站点中的建议编辑 vhost 文件(我找不到),重新安装、添加新行并重新启动 apache 解决了问题

thanks to this post but I didnt need to edit the vhost file (that I was unable to find) as suggested in the site, with reinstalling, adding the new lines and restarting apache solved the problem

这篇关于服务器中的默认红宝石的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-11 00:51