2

I'm trying to install rails on Ubuntu 10.10, but get File not found: lib every time. Ruby and Rubygems have been installed correctly. I've seen this problem posted all over the web but no solutions work for me. I reinstalled rdoc and I still get the same result.

$ 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
John
  • 5,835
  • 8
  • 28
  • 36

2 Answers2

4

I wrote a detailed how-to guide on installing Ruby and Rails on Ubuntu 10.10 that will help you with this.

Guaranteed, or your money back!

Ryan Bigg
  • 106,965
  • 23
  • 235
  • 261
  • 1
    Thanks a lot, Looks like a very useful site. I will try this as soon as Ubuntu installs. – John Mar 23 '11 at 02:58
  • is there a similar solution for mac? – John Apr 08 '11 at 23:18
  • @John: you can follow most of the same steps for Mac, except you will have to replace the `apt-get` stuff with whatever is required on Mac. I'd recommend using the homebrew package management system for that. – Ryan Bigg Apr 09 '11 at 00:52
  • This is what I get. bash: line 1: html: No such file or directory bash: line 2: syntax error near unexpected token `<' 'ash: line 2: `301 Moved Permanently when I run bash < <(curl.....) command, any ideas? – ericbae Apr 11 '11 at 07:15
1

You should avoid the packaged version of Ruby (i.e., avoid the version of Ruby that comes from apt-get install ruby). The Debian packaging system (which Ubuntu uses) conflicts with what Ruby expects.

Instead, you should install Ruby from source.

There's a nice tool called RVM to help you do this.

# 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
yfeldblum
  • 65,165
  • 12
  • 129
  • 169
  • thanks, but i think on ubuntu10.10 it's a bit different. i was unable to find bash_profile but there is bashrc – John Mar 23 '11 at 03:05