我一直试图安装乘客但还没有成功。
我已经安装了gem,但是当我运行时
passenger-install-apache2-module
它告诉我
This installer must be able to write to the following directory:
/Users/myname/.rvm/gems/ruby-1.9.2-p0/gems/passenger-3.0.0
But it can't do that, because you're running the installer as myname.
Please re-run this installer as root.
但如果我这样做
sudo passenger-install-apache2-module
我得到了
/Users/myname/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/rubygems.rb:762:in `report_activate_error': Could not find RubyGem passenger (>= 0) (Gem::LoadError)
来自/Users/myname/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/rubygems.rb:219:in activate'
from /Users/myname/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/rubygems.rb:1065:in
gem'
来自/Users/myname/.rvm/gems/ruby-1.9.2-p0/bin/passenger-install-apache2-module:18:in`'
我试图查看这些文件,但无法理解错误。
你可以帮忙吗?谢谢,P
答案 0 :(得分:32)
两种解决方案:
答案 1 :(得分:0)
我认为您可以使用系统ruby代替RVM ruby来安装乘客:
rvm use default
sudo gem install passenger
sudo passenger-install-apache2-module
答案 2 :(得分:0)
我实际上按照Shingara的建议chmod该文件夹并且它有效。
我唯一不明白的是为什么用sudo发出命令会导致问题:(
感谢您的帮助!