2011-03-23 186 views
2

我試圖在Ubuntu 10.10上安裝Rails,但每次都得到File not found:lib。 Ruby和Rubygems已經正確安裝。我已經看到這個問題遍佈整個網絡,但沒有解決方案爲我工作。我重新安裝了rdoc,我仍然得到相同的結果。在Ubuntu 10.10上安裝Rails失敗

$ sudo gem install rails 
... 
Successfully installed rails-3.0.1 
24 gems installed 
... 
Installing ri documentation for builder-2.1.2... 
ERROR: While generating documentation for builder-2.1.2 
... MESSAGE: Unhandled special: Special: type=17, text="<!-- HI -->" 
... RDOC args: --ri --op /var/lib/gems/1.8/doc/builder-2.1.2/ri --title Builder -- Easy XML Building --main README --line-numbers --quiet lib CHANGES Rakefile README doc/releases/builder-1.2.4.rdoc doc/releases/builder-2.0.0.rdoc doc/releases/builder-2.1.1.rdoc --title builder-2.1.2 Documentation 
(continuing with the rest of the installation) 
... 
Installing ri documentation for rails-3.0.1... 
File not found: lib 

$ rails -v 
The program 'rails' is currently not installed. You can install it by typing: 
sudo apt-get install rails 
+1

方式太細節。至少在shell中輸出。另外,什麼紅寶石版本?什麼鐵軌版本?你在使用捆綁器嗎?添加了 – 2011-03-23 02:40:34

+0

。我沒有使用捆綁器。我正在運行sudo gem install rails。 – John 2011-03-23 02:50:16

回答

4

我寫了一個detailed how-to guide on installing Ruby and Rails on Ubuntu 10.10,這將有助於你與此有關。

有保證,還是您的退款!

+1

非常感謝,看起來像一個非常有用的網站。我會盡快安裝Ubuntu。 – John 2011-03-23 02:58:39

+0

是否有類似的mac解決方案? – John 2011-04-08 23:18:22

+0

@John:您可以遵循Mac的大部分相同步驟,除非您必須用Mac上所需的任何東西替換「apt-get」。我建議使用自制軟件包管理系統。 – 2011-04-09 00:52:10

1

您應該避免打包的Ruby版本(即避免來自apt-get install ruby的Ruby版本)。 Debian的打包系統(Ubuntu使用的)與Ruby的期望相沖突。

相反,您應該從源代碼安裝Ruby。

有一個很好的工具RVM來幫助你做到這一點。

# Install prerequisites 
$ sudo apt-get install git curl wget 

# Download and install RVM 
$ bash < <(curl http://rvm.beginrescueend.com/releases/rvm-install-latest) 

# Install RVM into your .bash_profile 
$ cat >> ~/.bash_profile <<-PROFILE 
> [[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" 
> PROFILE 

# Load RVM into the current shell 
$ rvm reload 

# Install prerequisites 
$ rvm notes 
$ sudo apt-get install \ 
> build-essential bison openssl libreadline6 libreadline6-dev curl \ 
> git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 \ 
> libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev \ 
> ncurses-dev 

# Install Ruby 
$ rvm install ruby-1.9.2-p180 # latest version as of now 
$ rvm use ruby-1.9.2-p180 --default 

# Check it 
$ ruby -v 
$ which ruby 
$ gem install rails 
+0

謝謝,但我認爲在Ubuntu10.10它有點不同。我無法找到bash_profile,但有bashrc – John 2011-03-23 03:05:52