Ruby升级权限错误(Errno :: EACCES)

时间:2015-07-22 17:54:48

标签: ruby-on-rails ruby linux apache passenger

我安装了ruby v1.9(我正在运行一些rails应用程序,例如:redmine)。我想安装GitLab,它需要ruby> 2.0。所以我按照this指南(从源代码编译)安装了ruby。现在GitLab安装完成后我重新启动了apache,现在redmine已经停止工作了。尝试运行gem install bundlerbundle install两者都出现以下错误:

ERROR:  While executing gem ... (Errno::EACCES)
Permission denied @ rb_sysopen - /usr/local/lib/ruby/gems/2.1.0/gems/bundler-1.10.5/.gitignore

我猜我无法运行它们,因为它们位于只有root可以访问的文件夹中。无论如何,现在运行sudo并没有解决问题。 Apache日志显示以下错误:

[ 2015-07-22 13:51:30.0223 377/7f2ed6b49700 

age/Cor/Req/CheckoutSession.cpp:252 ]: [Client 1-82] Cannot checkout session because a spawning error occurred. The identifier of the error is f16d292b. Please see earlier logs for details about the error.
App 4932 stderr: *** ERROR ***: Cannot execute /usr/bin/ruby1.9.1: No such file or directory (2)
App 4932 stdout: 
[ 2015-07-22 13:51:30.4210 377/7f2ed40bf700 App/Implementation.cpp:303 ]: Could not spawn process for application /sites/www/6Qj8BHSbtswjs5gJXv1lXpao: An error occurred while starting up the preloader. It exited before signalling successful startup back to Phusion Passenger.
  Error ID: b9bbbe68
  Error details saved to: /tmp/passenger-error-OA4S88.html
  Message from application: An error occurred while starting up the preloader. It exited before signalling successful startup back to Phusion Passenger. Please read <a href="https://github.com/phusion/passenger/wiki/Debugging-application-startup-problems">this article</a> for more information about this problem.<br>
<h2>Raw process output:</h2>
<pre>*** ERROR ***: Cannot execute /usr/bin/ruby1.9.1: No such file or directory (2)

</pre>

[ 2015-07-22 13:51:30.4274 377/7f2ed62c7700 age/Cor/Req/CheckoutSession.cpp:252 ]: [Client 2-82] Cannot checkout session because a spawning error occurred. The identifier of the error is b9bbbe68. Please see earlier logs for details about the error.

我猜这个应用程序正在尝试使用旧的ruby路径,这是不可用的。有人能提供解决这个问题的解决方案吗?

1 个答案:

答案 0 :(得分:1)

在短期内,我建议您安装rvm,https://rvm.io然后使用它,安装Ruby 1.9。

这样,你可以通过在其目录中设置一个自动选择1.9版本的.ruby_version文件来保持redmine 1.9。系统的其余部分将使用系统ruby,它是2.x。

从长远来看,您需要了解如何升级redmine以使用2.x Ruby。此外,您可能需要安装特定于2.x Ruby的Phusion Passenger并将Apache配置为使用它。