1

卸载了 RVM并使用单用户安装重新安装:

\curl -L https://get.rvm.io | bash -s stable

When I do bundle, it prompts for:

Enter your password to install the bundled RubyGems to your system:

I tried using the answer in "ERROR: While executing gem … (Gem::FilePermissionError)" which did not fix it.

Then, while trying to install the gem manually, I got:

Gem::InstallError: nokogiri requires Ruby version >= 1.9.2.
An error occurred while installing nokogiri (1.6.0), and Bundler cannot continue.
Make sure that `gem install nokogiri -v '1.6.0'` succeeds before bundling.

then running gem install nokogiri -v '1.6.0' returned:

ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions into the /Library/Ruby/Gems/1.8 directory.

I checked all the similar posts on SO, but they didn't solve the problem. What am I missing?

4

2 回答 2

1

确保使用此命令更新您的系统 ruby​​gems sudo gem update --system --no-user-install:。

bundler使用它代替您的本地版本,并且您的 bundler 版本可能与您的系统 ruby​​gems 不兼容。

这个对我有用 ;)

于 2013-08-21T23:16:14.593 回答
0

安装 RVM 后,您还需要几个步骤:

  1. 将 RVM 加载到当前 shell:

    source ~/.rvm/scripts/rvm
    

    如果您再次关闭并打开终端,通常不需要这样做

  2. 安装红宝石:

    rvm install ruby
    
  3. 使用红宝石:

    rvm use ruby
    

最后一步非常重要,因为您的错误消息提到系统红宝石不是由 RVM 控制的。

于 2013-08-21T19:28:03.167 回答