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
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.
How can I install ruby on rails with rvm?
Just to close it off, I found out I had to push back my date on my mac to sometime before January 2012 and install xcode. After installation you can set the time back to normal and you should be good to go. But I got a copy of xcode from my instructor which is pretty cool.
Error when installing Ruby 2.1.3 with RVM
I had the same problem
rvm reinstall 2.1.3 --disable-binary
worked for me
(based on Fresh Installs of RVM and Ruby 2.1.1 - dyld library/pathing error).
Setup RVM, Ruby on Mac OS X Sierra: Unable to require openssl
Well I found a solution to the problem previously described. The following steps outline how it was resolved.
CleanUp
Removed the installation of Homebrew via
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
Removed the installation of RVM via
rvm implode
Rebuild
Install Homebrew using
ruby -e "$(curl -fsSL
https://raw.githubusercontent.com/Homebrew/install/master/install)"Do integrity check on Brew using
brew upgrade
followed bybrew doctor
- Install RVM (again!) using
\curl -sSL https://get.rvm.io | bash -s stable
- Ensure that RVM knows about homebrew through the
autolibs
option usingrvm autolibs homebrew
Setup the environment variables so that we know where the openssl is installed:
export LDFLAGS=-L/usr/local/opt/openssl/lib
export CPPFLAGS=-I/usr/local/opt/openssl/include
export PKG_CONFIG_PATH=/usr/local/opt/openssl/lib/pkgconfig
Install ruby via
rvm install 2.3.3 --autolibs=homebrew
Check that it Works
Check that the rvm space knows about the OpenSSL certificates using
rvm osx-ssl-certs status all
. Running this command produced the following output:Certificates for /usr/local/etc/openssl/cert.pem: Up to date.
Install rails via
gem install rails
At the last step the installation succeeded and Rails was working (at last!)
Related Topics
What's the Difference Between Gem_Home and Gem_Path
Rails 3.1 Pipeline - Exclude JavaScript File
Sum the Value of Array in Hash
Why Is _File_ Uppercase and _Dir_ Lowercase
Strange Inability to Require Config/Boot After Upgrading to Ruby 1.9.2
How to Convert a Ruby Hash So That All of Its Keys Are Symbols
Ruby: How to Convert a String to Boolean
Simple Way of Turning Off Observers During Rake Task
Openssl::Ssl::Sslerror: Ssl_Connect Returned=1 Errno=0 State=Unknown State: Unknown Protocol
Using Custom To_JSON Method in Nested Objects
Ruby Hash Default Value Behavior