我安装了 ruby v1.9(并且正在运行一些 Rails 应用程序,例如:redmine)。我想安装 GitLab,它需要 ruby >2.0。所以我在 this 之后安装了 ruby指南(从源代码编译)。现在在 GitLab 安装完成后我重新启动了 apache,现在 redmine 已经停止工作。尝试运行 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 以使用它。
关于ruby-on-rails - Ruby 升级权限错误(Errno::EACCES),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31570544/