2011-03-23 189 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