How to Install Ruby on Rails 3 on Osx

Install Rails 3 on OSX with RVM

Older versions of rvm had a bug that can cause your ruby versions to get crosswired because the OS can cache executable paths for the which command (particularly if you are using zsh). See this long, detailed, mind blowing post by Yehuda Katz on the subject.

What I had to do this morning:

rvm update && rvm reload # update rvm
rvm gemset delete rails3 # delete old gemset
rvm install 1.9.2
rvm use 1.9.2
rvm gemset create rails3
rvm use 1.9.2@rails3
which ruby # check to be sure the ruby interpretter is properly set to 1.9.2
hash -r # if ruby interpretter is not pointing to 1.9.2
gem install rails
which rails # check to be sure we are using rvm version of rails

Note: On newer versions of rvm, you will have to use rvm get stable instead of rvm update

Trying to set up Ruby Rails on Mac

This probably means that you used sudoat some point, which means that you run a command that allows you (as a permitted user to execute a command as the superuser or another user) See here: http://linux.about.com/od/commands/l/blcmdl8_sudo.htm.

Can you please paste the commands you used for installing rbenv, ruby, gem, brew, etc.? Also please paste the output of brew doctorto see if environment is correctly configured for Homebrew. Also, please paste the OSX version and rbenv versionsif rbenv is installed.

The steps for installing ruby on rails on OSX are:

  1. Install Homebrew by:
    ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"`` (as seen here: http://brew.sh/). Run brew doctor and brew updateto see if everything is fine.
  2. Install ruby: OS X comes with Ruby installed (Mavericks/Yosemite even gets version 2.0.0, previously it was only 1.8.7).
  3. Install rbenv: it can be done either by GitHub Checkout or Brew. You probably should use brew. Run brew install rbenv ruby-build(this will also install ruby-build -https://github.com/sstephenson/ruby-build#readme-). You can also use this command brew install rbenv ruby-build rbenv-gem-rehash. Then echo 'eval "$(rbenv init -)"' >> ~/.bash_profile (to enable shims and autocompletion). You should problably run this too: echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile. Close terminal and open it again. Install the preferred version of ruby (if you want): rbenv install 2.0.0-p353.
  4. Install Bundler: gem install bundler.
  5. Install SQLite: gem install sqlite3
  6. Install Rails: gem install rails.

So, the error you are having is due to permissions (you can understand about them here: http://www.tutorialspoint.com/unix/unix-file-permission.htm). Many people suggest fixing the issue with sudo or chown (http://www.cyberciti.biz/faq/how-to-use-chmod-and-chown-command/). I don't recommend that as it messes with system configuration. It will be better that you run:

rbenv install 2.1.2 
rbenv global 2.1.2
gem update --system

When I run with this error like a year ago, what I did was uninstall everything and start again... but, probably that'll take too long.

These links might help you:
ruby for mac, ruby rbenv, rbenv githube, rubies and gems, question on stack

What's the right string to use when installing Ruby 3.1 through RVM on Mac OS Big Sur?

> rvm list known
# MRI Rubies
[ruby-]1.8.6[-p420]
[ruby-]1.8.7[-head] # security released on head
[ruby-]1.9.1[-p431]
[ruby-]1.9.2[-p330]
[ruby-]1.9.3[-p551]
[ruby-]2.0.0[-p648]
[ruby-]2.1[.10]
[ruby-]2.2[.10]
[ruby-]2.3[.8]
[ruby-]2.4[.10]
[ruby-]2.5[.8]
[ruby-]2.6[.6]
[ruby-]2.7[.2]
[ruby-]3[.0.0]
ruby-head

3.1 doesn't seem to be on the list, but to install it you would use:

> rvm install ruby-3.1.0

or

> rvm install 3.1.0

But again, doesn't seem available, at least in rvm stable or latest. Looking at GitHub, they have merged patches to add 3.1 support but the latest releases don't list it: https://github.com/rvm/rvm/releases.

Installing Rails 3.0.3 on mac OSX

probably you do not have rdoc installed. It does not hamper any functionality during development. If if you do want you can try this

   sudo gem install rdoc

see details here problem in installing rails

Installing Ruby On Rails 3.0 on Mac OS X 10.5.8

I suggest you to install it via RVM.

de default ruby interpreter of macosx is quite outdated.

once rvm is installed, just perform:

rvm install rails

Trouble Installing Ruby 1.9.3 on Mac OSX 10.9.4

Error: No available formula for gcc46

Try:

rvm install 1.9.3 --with-gcc=clang

Or install xcode:

xcode-select --install


Related Topics



Leave a reply



Submit