2013-01-22 33 views
1

我遇到了Ruby On Rails的問題。每次我打開一個新的終端輸入一個Rails命令我得到這個錯誤:爲什麼每次打開新終端時都必須安裝Rails?

rails --version 
Sorry, command-not-found has crashed! Please file a bug report at: 
https://bugs.launchpad.net/command-not-found/+filebug 
Please include the following information with the report: 

command-not-found version: 0.3 
Python version: 3.2.3 final 0 
Distributor ID: Ubuntu 
Description: Ubuntu 12.10 
Release: 12.10 
Codename: quantal 
Exception information: 

unsupported locale setting 
Traceback (most recent call last): 
    File "/usr/lib/python3/dist-packages/CommandNotFound/util.py", line 24, in crash_guard 
    callback() 
    File "/usr/lib/command-not-found", line 69, in main 
    enable_i18n() 
    File "/usr/lib/command-not-found", line 40, in enable_i18n 
    locale.setlocale(locale.LC_ALL, '') 
    File "/usr/lib/python3.2/locale.py", line 541, in setlocale 
    return _setlocale(category, locale) 
locale.Error: unsupported locale setting 

我能避免這個問題的唯一方法是重新安裝Ruby和Rails,我有點累了這樣做的,因爲每次我打開一個新的終端時都必須這樣做。

我試圖做一個完整的卸載使用下面的命令:

rvm implode 

,但沒有成功。

我也嘗試了這些命令,但仍然沒有成功:

rvm --default use 1.9.2 (or whatever you want your default ruby interpreter to be) 
rvm gemset create rails-3.0.3 
rvm use [email protected] --default 
gem install rails 
+0

將'rvm info'的輸出追加到您的問題中。 –

+0

你如何安裝導軌? –

+0

你似乎有一個量子問題 – prusswan

回答

3

可能您只需將RVM添加到PATH中進行腳本編寫即可。

將以下行添加到〜/ .bashrc文件中。

PATH=$PATH:$HOME/bin/sublime_text/:$HOME/bin/cad_cuda/:$HOME/.rvm/bin 
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" 
1

它看起來像您嘗試使用RVM - 檢查安裝文檔,並確保您的代碼添加到您的shell啓動過程當您啓動一個新的shell時會設置RVM。

https://rvm.io/rvm/install/

尋找「2.將RVM到你的shell會話的功能」

相關問題