简体   繁体   中英

Ruby on Rails install on ubuntu fail. I can has help?

I am trying to install Ruby, RubyGems, and the Ruby on Rails framework so that it will play nicely with my system. I am having issues with my installation. Could somebody help me? Here are the details of my system and how I went about installation.

Currently I am running ubuntu 10.10 using the Linux Kernel 2.6.35-28-generic. My server is Apache 2.2.16 and I use MySQL 5.1.49.

So, I went to my synaptic package manager and selected the following packages to download: * ruby1.8 – installs Ruby 1.8.4 * libmysql-ruby – additional libraries to access MySQL * libruby1.8-dbg – debugging library * ri – Ruby Interactive Reference * ruby1.8-dev – header files for building extensions * rails – Ruby On Rails framework

Once that ran successfully, I downloaded rubygems from http://rubyforge.org/projects/rubygems/ . Then I unpacked it, got in the terminal, ran a cd to get in the directory of the newly downloaded rubygems directory, and typed 'sudo ruby setup.rb' That ran with no problem and RubyGems 1.8.5 was installed. Then I ran 'sudo gem install rubygems-update' with no problem.

But when I ran 'sudo gem install rails –include-dependencies' I got the following output: Fetching: activesupport-3.0.8.gem (100%) Fetching: rails-3.0.8.gem (100%) Successfully installed activesupport-3.0.8 Successfully installed rails-3.0.8 2 gems installed Installing ri documentation for activesupport-3.0.8... Installing ri documentation for rails-3.0.8... File not found: lib ERROR: While generating documentation for rails-3.0.8... MESSAGE: exit... RDOC args: --ri --op /var/www/testingwww/rubygems-1.8.5/nclude-dependencies/doc/rails-3.0.8/ri lib --title rails-3.0.8 Documentation --quiet

When I run 'rails -v' I get 'Rails 3.0.8' so it seems to have installed despite the error. But when I try to make a rails app by typing 'rails./helloWorld' I get the manual page for the rails keyword.

I have looked around for two days now on how to fix this issue, but can't seem to figure it out. Does anybody know how to fix this?

Rails 3 requires version 1.8.7 or 1.9.2.

I'd recommend using RVM to manage your Ruby installation and environments. It will really help to get you going quickly and is simple. It's as simple as

curl -L https://get.rvm.io | bash

to install RVM and then rvm install 1.9.2 will get you going.

Have a look at https://rvm.io for more information.

In addition to Matthew's good Answer , I don't know why you're doing rails./helloWorld . To generate a new app in Rails 3, you should do rails new helloWorld .

If you need a complete guide to getting rolling with Rails under Ubuntu, you can find a short guide here: http://blog.dcxn.com/2011/06/21/rolling-with-rails-3-on-ubuntu-11-04/

The gist is:

  1. Install RVM (The Ruby version manager)
  2. Install Rails from gem
  3. Get going with Rails

It's a simple process but there are a few things you need to do for it to be completely smooth like making sure you have the pre-requisites for rvm installed via apt before install rvm.

Good luck!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM