First of all, congratulation to Ruby community!
After 20 years, Ruby 2.0 has been released. This milestone release not only represents the popularity of Ruby, but also predicts the bright future of Ruby. Thanks, matz.
Well, today I would like to share some tips on compiling and installing Ruby 2.0 from source code on Mac, without brew or RVM. I hope this article will help you.
1. Why I write this article.
I don’t want to install RVM or Homebrew.
Yes I know a lot of people choose them, and they are powerful.
I just don’t want to install either.
If you want to compile Ruby 2.0 on Mac, like me, maybe you will meet an issue with OpenSSL.
Because the built-in OpenSSL version is outdated.
So what should we do?
Set the path
Launch your iTerm or Terminal.app, and type as following:
This command will launch a TextEdit.app, in the new window, in the end of this file, add the following line:
Save the file, close the file.. You should reload your environment by typing the following line:
If you see /usr/local/ssl/bin:/usr/local/bin: in the beginning, good enough, you can go to the next step.
3. Install OpenSSL from source code
The built-in OpenSSL version is OpenSSL 0.9.8r, and the current release version of OpenSSL is OpenSSL 1.0.1e.
Since Ruby 2.0 requires OpenSSL 1.0.1e or above, we need to update it manually.
Here is the instruction of installing OpenSSL from source on your Mac.
Go to OpenSSL official site, download the package named as openssl-1.0.1e.tar.gz or newer version.
(By default, it will be saved to ~/Downloads/ folder, if you save this file to other location, modify the codes below when necessary)
When the download process finishes, double click to unpack it. You will get a folder.
Compile and install Launch your iTerm or Terminal.app, and type as following:
if you get
Good, let’s go to the next step.
4. Install Ruby 2.0 from source code
Go to Ruby official site, download the package named as Ruby 2.0.0-p0
Compile and install
You can get
You should not meet any error message.
That means you have successfully installed Ruby 2.0 on your Mac.
Now, enjoy programming with Ruby 2.0.0!