0

I am trying to run a

rails new demo

But am told:

Rails is not currently installed on this system. To get the latest version, simply type:
$ sudo gem install rails
You can then rerun your "rails" command.

I run that command, and many 'fetching' lines followed by many 'Installing RDoc documentation for...' are run, but then the last lines say:

Installing RDoc documentation for rails-3.2.13...
file 'lib' not found

and then it stops running, and the 'rails' command (see above) doesn't work still. Why is Rails not installed? What else should I do? Thanks

Lucy Weatherford
  • 5,452
  • 16
  • 50
  • 76
  • did you installed rails on your machine. – ѕтƒ Mar 28 '13 at 09:11
  • I did, but apparently in the wrong place - see below, I just posted an answer, it works now – Lucy Weatherford Mar 28 '13 at 09:14
  • Lucy, probably you can use this bash script to install each and every possible tools needed for you to make a development environment up and running with rails: github.com/joshfng/railsready – Surya Mar 28 '13 at 17:03

3 Answers3

0

Looks like this is rdoc related. Short version, try :

gem install rdoc

And then launch the install of rails again.

Look at this answer that seems to have helper a lot of people with this exact problem.

Community
  • 1
  • 1
Martin
  • 7,634
  • 1
  • 20
  • 23
0

I solved it: apparently I was trying to install rails in the directory. I did the following and it worked well:

cd /

Then I ran

sudo gem install rails

Then I cd into the relevant directory again and now

rails new demo

worked!

Lucy Weatherford
  • 5,452
  • 16
  • 50
  • 76
  • without installing rails how `rails new demo` works..? i think first time you run `rails new demo` without installing rails – ѕтƒ Mar 28 '13 at 09:24
  • Why the downvote? I explained here the answer - the initial problem was - it indeed wouldn't install since I tried installing in the wrong location – Lucy Weatherford Mar 28 '13 at 16:45
0

It's not a good idea to do a 'sudo gem install rails' since you may experience permission problems with your applications in the future.

I would recommend you using RVM which is a ruby version manager. You can easily install different versions of Rubies, you can create application specific gemset's and minimize possible futuristic 'rails is not currently installed' errors.

I highly recommend you searching and reading about these concepts:

  • RVM
  • Gemsets
  • .rvmrc
  • .bashrc and .bash_profile
scaryguy
  • 7,720
  • 3
  • 36
  • 52
  • I also installed rvm, but I installed rails too. is that redundant? – Lucy Weatherford Mar 28 '13 at 16:44
  • Nope. Surely you're supposed to install Rails too. RVM is for installing Rubies and creating gemsets. Make sure you've added RVM to your PATH. See http://stackoverflow.com/questions/8767135/rvm-and-bash-profile – scaryguy Mar 28 '13 at 17:26