【问题标题】:Rails install fails on Ubuntu 10.10Rails 在 Ubuntu 10.10 上安装失败
【发布时间】:2011-07-20 23:49:30
【问题描述】:

我正在尝试在 Ubuntu 10.10 上安装 rails,但每次都得到 File not found: lib。 Ruby 和 Rubygems 已正确安装。我在网上看到过这个问题,但没有任何解决方案适合我。我重新安装了 rdoc,仍然得到相同的结果。

$ 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

【问题讨论】:

  • 细节太少了。至少在 shell 中发布输出。另外,什么红宝石版本?什么轨道版本?你在使用捆绑器吗?
  • 已添加。我没有使用捆绑器。我正在运行 sudo gem install rails。

标签: ruby-on-rails ruby-on-rails-3 ubuntu-10.10 rdoc


【解决方案1】:

我写了一个detailed how-to guide on installing Ruby and Rails on Ubuntu 10.10 来帮助你解决这个问题。

保证,否则退款!

【讨论】:

  • 非常感谢,看起来非常有用的网站。我会在 Ubuntu 安装后立即尝试。
  • mac有类似的解决方案吗?
  • @John:对于 Mac,您可以按照大多数相同的步骤进行操作,但您必须将 apt-get 替换为 Mac 上所需的任何内容。我建议使用自制软件包管理系统。
  • 这就是我得到的。 bash:第 1 行:html:没有这样的文件或目录 bash:第 2 行:当我运行 bash
【解决方案2】:

您应该避免使用打包版本的 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

【讨论】:

  • 谢谢,但我认为在 ubuntu10.10 上有点不同。我找不到 bash_profile 但有 bashrc
猜你喜欢
  • 2011-08-11
  • 2011-05-18
  • 1970-01-01
  • 1970-01-01
  • 2010-10-20
  • 2011-07-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多