【问题标题】:RVM ruby installation issueRVM ruby​​ 安装问题
【发布时间】:2013-07-26 15:33:23
【问题描述】:

我已经安装了 ruby​​ 和 rails 一段时间,并参与了一些项目。最近我安装了 Xcode 5 开发者预览版,以便让我的应用程序为 iOS 7 做好准备。我只是提到这一点,以防新的 Xcode 搞砸了。

我在尝试时首先注意到了错误

rake asets:precompile

在 rails 项目目录中。它给出了以下错误:

/Users/User/.rvm/bin/ruby:第 6 行:/Users/User/.rvm/bin/ruby:参数列表太长 /Users/User/.rvm/bin/ruby:第 6 行:/Users/User/.rvm/bin/ruby:未定义错误:0

当我尝试时:

ruby -v

终端窗口一开始没有反应,终端标题在“bash”和“env”之间闪烁,然后显示如下错误:

/Users/User/.rvm/bin/ruby: line 6: /Users/User/.rvm/bin/ruby: Argument list too long
/Users/User/.rvm/bin/ruby: line 6: /Users/User/.rvm/bin/ruby: Undefined error: 0

当我尝试时

rvm get stable

我明白了:

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   184  100   184    0     0     67      0  0:00:02  0:00:02 --:--:--   163
100 13774  100 13774    0     0   3469      0  0:00:03  0:00:03 --:--:-- 75267
Downloading RVM from wayneeseguin branch stable
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   124  100   124    0     0    227      0 --:--:-- --:--:-- --:--:--   306
100 1080k  100 1080k    0     0   286k      0  0:00:03  0:00:03 --:--:--  491k

Upgrading the RVM installation in /Users/User/.rvm/
chmod: Unable to change file mode on /Users/User/.rvm/scripts/aliases: Operation not permitted
chmod: Unable to change file mode on /Users/User/.rvm/scripts/fix-permissions: Operation not permitted
chmod: Unable to change file mode on /Users/User/.rvm/scripts/irbrc: Operation not permitted
chmod: Unable to change file mode on /Users/User/.rvm/scripts/irbrc.rb: Operation not permitted
    Failed to set permissions of: /Users/User/.rvm/scripts/aliases /Users/User/.rvm/scripts/fix-permissions /Users/User/.rvm/scripts/irbrc /Users/User/.rvm/scripts/irbrc.rb, prefix the command with 'rvmsudo' to fix it, if the situation persist report a bug.
    RVM PATH line found in /Users/User/.bashrc /Users/User/.zshrc.
    RVM sourcing line found in /Users/User/.bash_profile /Users/User/.zprofile.
Upgrade of RVM in /Users/User/.rvm/ is complete.

# User,
#
#   Thank you for using RVM!
#   I sincerely hope that RVM helps to make your life easier and more enjoyable!!!
#
# ~Wayne

# In case of problems:
#      run and read: rvm notes
#         read docs: http://rvm.io/
#        talk to us: http://webchat.freenode.net/?channels=rvm (http://freenode.net/faq.shtml#plusr)
#   read cheatsheet: http://cheat.errtheblog.com/s/rvm
#  watch screencast: http://screencasts.org/episodes/how-to-use-rvm
# open a bug report: https://github.com/wayneeseguin/rvm/issues

Upgrade Notes:

  * No new notes to display.

RVM reloaded!

最后,当我进入时:

rvm install ruby-2.0.0-p247

我明白了:

Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.8/x86_64/ruby-2.0.0-p247.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Installing Ruby from source to: /Users/User/.rvm/rubies/ruby-2.0.0-p247, this may take a while depending on your cpu(s)...
ruby-2.0.0-p247 - #downloading ruby-2.0.0-p247, this may take a while depending on your connection...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 10.3M  100 10.3M    0     0   129k      0  0:01:21  0:01:21 --:--:--  264k
ruby-2.0.0-p247 - #extracting ruby-2.0.0-p247 to /Users/User/.rvm/src/ruby-2.0.0-p247
ruby-2.0.0-p247 - #extracted to /Users/User/.rvm/src/ruby-2.0.0-p247
ruby-2.0.0-p247 - #configuring....................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
ruby-2.0.0-p247 - #compiling........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
ruby-2.0.0-p247 - #installing..................................................................................................................................
Retrieving rubygems-2.0.6
Extracting rubygems-2.0.6 ...
Removing old Rubygems files...
Installing rubygems-2.0.6 for ruby-2.0.0-p247...................................
Error running 'env GEM_PATH=/Users/User/.rvm/gems/ruby-2.0.0-p247:/Users/User/.rvm/gems/ruby-2.0.0-p247@global:/Users/User/.rvm/gems/ruby-2.0.0-p247:/Users/User/.rvm/gems/ruby-2.0.0-p247@global GEM_HOME=/Users/User/.rvm/gems/ruby-2.0.0-p247 /Users/User/.rvm/rubies/ruby-2.0.0-p247/bin/ruby -d /Users/User/.rvm/src/rubygems-2.0.6/setup.rb',
please read /Users/User/.rvm/log/ruby-2.0.0-p247/1374852277_rubygems.install.log
Installation of rubygems did not complete successfully.
Saving wrappers to '/Users/User/.rvm/wrappers/ruby-2.0.0-p247'........

ruby-2.0.0-p247 - #adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
ruby-2.0.0-p247 - #importing default gemsets, this may take time...............................
Install of ruby-2.0.0-p247 - #complete 

但还是和以前一样。

据我所知,我没有对系统进行任何更改,我只安装了新的 Xcode。有人知道这里有什么问题吗?不幸的是,这些 rvm / ruby​​ / terminal 命令,或者更准确地说,这个 ruby​​ install path-permission-rights 东西对我来说仍然很新。非常感谢您的宝贵时间!

【问题讨论】:

    标签: ruby-on-rails ruby terminal rvm


    【解决方案1】:

    确保您的 rvm 是最新的:

    rvm get stable
    

    那么你需要运行:

    rvm use ruby
    

    这将确保您的环境设置正确,如果出现问题,它会显示警告,您需要始终阅读警告 - 并按照说明进行操作

    让使用 ruby​​ 持续到下一个 shell 会话使用:

    rvm use --default ruby
    

    它将创建在 rvm 启动时加载的 default 别名

    【讨论】:

    • 谢谢,这是一个救命稻草 :)
    【解决方案2】:

    您的 gem 路径中似乎出现了错误。你确定@global gemset 存在吗?运行以下命令应该可以解决问题。

    rvm gemset create global
    

    【讨论】:

    • 我不确定,我不确定这一切意味着什么 ;-) 当我输入它时,我收到以下错误:Can not create gemset '@global', it contains a "@". 顺便说一句,你能推荐什么给我哪个可以帮助我学习这些东西?感谢您的帮助!
    • @LinusAn 对此感到抱歉。尝试删除“@”。
    • 好的,现在它说:gemset created global => /Users/nikolajandersen/.rvm/gems/ruby-2.0.0-rc2@global。但是当我现在输入rvm get stable时,它又说不允许操作。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-07-04
    相关资源
    最近更新 更多