简体   繁体   中英

RVM won't install Rails to system

I've tried the following commands:

rvm system gem install rails
rvm system install rails
rvmsudo gem install rails
sudo gem install rails

After one of these commands, I get a message telling me to run sudo gem install rails . But it doesn't work.

I had no problems before to install rails on rvm 1.9.2 the Mac OSX 10.6.8 version.

Could anyone help me with that?

If you've installed rvm successfully, test with rvm info so that it returns output then you just need to do gem install rails to install rails into the ruby version you are using with RVM - no sudo required. Have I misunderstood?

First check either rvm install properly or not using this command

rvm --help

then install rails by this command

    gem install rails -v=3.2.1

Or any version you want..

If you don't have ruby 1.9.3 then use:

$ rvm install 1.9.3

or you may start from this:

$ rvm use 1.9.3

$ rvm gemset create rails313

$ rvm use 1.9.3@rails313 --default

$ gem install rails -v 3.1.3

note: I use 1.9.3 as an example you can use other ruby version also.

Follow the documentation . Make sure you've got the necessary system requirements via rvm requirements . Unless you've got some bizarre user permissions in $HOME, there is no reason to use sudo w/ rvm on your system.

make sure you have installed build_essentials , also try rvm requirements , which gives all dependencies, install all using rvmsudo command
See also: Installing Ruby on Rails - Mac OS Lion

First check whether all dependencies are satisfied by running:

$ rvm requirements

next:

$ rvm install ruby

next:

$ gem install rails

Note: You may have to use sudo or rvmsudo before the commands depending on whether its system-wide install or user specific.

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