2013-07-26 234 views
2

我已經安裝了ruby和rails一段時間,並在一些項目上工作。最近,我安裝了Xcode 5開發人員預覽版,以便讓我的應用程序能夠準備好用於iOS 7.我只是提到了這一點,以防新Xcode搞砸了。RVM ruby​​安裝問題

在Rails項目目錄試圖

rake asets:precompile 

,當我第一次注意到這個錯誤。它給出以下錯誤:

/Users/User/.rvm/bin/ruby:line 6:/Users/User/.rvm/bin/ruby:參數列表太長 /Users/User/.rvm/箱/紅寶石:行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/[email protected]:/Users/User/.rvm/gems/ruby-2.0.0-p247:/Users/User/.rvm/gems/[email protected] 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​​ /終端命令,或者更確切地說,這個ruby安裝路徑權限的東西對我來說還是很新的。非常感謝您的寶貴時間!

回答

4

確保您的RVM是最新的:

rvm get stable 

,那麼你需要運行:

rvm use ruby 

這將確保您的環境設置正確,但它確實顯示警告如果出現問題,您需要始終閱讀警告 - 並按照指示

至m剎車採用紅寶石持續下一個shell會話使用:

rvm use --default ruby 

它會創建RVM時開始

+0

謝謝,這是一個拯救生命的:) – Unrealist

1

看起來像是錯誤發生在你的寶石路徑。你確定@global gemset存在嗎?運行以下內容應該可以解決問題。

rvm gemset create global 
+0

我不知道這是加載default別名,我不知道這一切的手段;-)當我輸入時,出現以下錯誤:'不能創建gemset'@global',它包含一個「@」。順便說一下,你能向我推薦什麼幫助我學習這些東西嗎?謝謝你的幫助! – Linus

+0

@LinusAn對不起。嘗試刪除「@」。 – ryanSrich

+0

好吧,現在它說:'gemset創建全球\t => /用戶/ nikolajandersen/.rvm/gems/ruby​​-2.0.0-rc2 @ global'。但是現在當我輸入'rvm get stable'時,它再次表示不允許操作。 – Linus