Ruby 升级权限错误(Errno::EACCES)
Ruby Upgrade permission error(Errno::EACCES)
我安装了 ruby v1.9(并且 运行 安装了一些 rails 应用程序,例如:redmine)。我想安装 GitLab,它需要 ruby >2.0。所以我按照 this 指南(从源代码编译)安装了 ruby。现在在 GitLab 安装完成后我重新启动了 apache,现在 redmine 已经停止工作。尝试了 运行ning gem install bundler
和 bundle 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 路径,该路径不可用。有人可以提供解决此问题的解决方案吗?
短期内,我建议你安装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 以使用它。
所以我发现了问题。主要问题是 /etc/apache2/apache2.conf
的 passenger
路径错误。这是 apache 日志错误的主要原因。我通过重新 运行 sudo passenger-install-apache2-module
解决了这个问题。正如@Srdjan 所指出的,我必须安装特定于 ruby 版本的乘客。之后就成功了。
我安装了 ruby v1.9(并且 运行 安装了一些 rails 应用程序,例如:redmine)。我想安装 GitLab,它需要 ruby >2.0。所以我按照 this 指南(从源代码编译)安装了 ruby。现在在 GitLab 安装完成后我重新启动了 apache,现在 redmine 已经停止工作。尝试了 运行ning gem install bundler
和 bundle 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 路径,该路径不可用。有人可以提供解决此问题的解决方案吗?
短期内,我建议你安装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 以使用它。
所以我发现了问题。主要问题是 /etc/apache2/apache2.conf
的 passenger
路径错误。这是 apache 日志错误的主要原因。我通过重新 运行 sudo passenger-install-apache2-module
解决了这个问题。正如@Srdjan 所指出的,我必须安装特定于 ruby 版本的乘客。之后就成功了。