1. First we need to install some development tools and libraries that Ruby needs to compile. Run the following commands from your terminal:
apt-get install build-essential vim git-core curl apt-get install bison openssl libreadline6 libreadline6-dev zlib1g zlib1g-dev libssl-dev libyaml-dev libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev apt-get install libcurl4-openssl-dev libopenssl-ruby apache2-prefork-dev libapr1-dev libaprutil1-dev apt-get install libx11-dev libffi-dev tcl-dev tk-devNote you may need to run these commands as root or use sudo.
2. Download the latest version of Ruby here: http://www.ruby-lang.org/en/downloads/ under the Compiling Ruby — Source code section.
3. Extract the tar.gz file e.g. ruby-1.9.3-p125.tar.gz by typing:
tar -xvf ruby-1.9.3-p125.tar.gz4. Open the README and follow the instructions on how to compile and install Ruby.
./configure make make test make installThe install process will probably take a while, but once it's done, we can test to see if ruby installed successfully by typing "ruby -v" in the terminal. You should see something like, "ruby 1.9.3p125 (2012-02-16 revision 34643) [i686-linux]" if ruby installed correctly. Next we can install the Bundler and Rails gems to make sure Ruby is working correctly.
gem install bundler gem install railsLastly, create a new Rails project to test to make sure everything works!
Worked like a charm! No warnings, just pure Ruby bliss. Thanks for the article.
ReplyDeleteWorked pretty fine for me, thank you fellow!
ReplyDeleteCool! Work like watch!
ReplyDeleteI'm having trouble, when I go to extract tar.gz file it says
ReplyDeletetar: ruby-1.9.3-p125.tar.gz: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now
I have downloaded ruby, so I don't why this file can't be found. Any thoughts?
just check if the file name is same in the command.
DeleteFantastic. Well played. Kudos. Thanks for a well written post... I have installed Ruby/Rails on many computers and OSes before, but this time around, compiling it from source, the process was 10x more satisfying.
ReplyDeleteThanks for the helpful tutorial :)
ReplyDeleteI get this error after following the entire process
ReplyDeleteany suggestions
The program 'ruby' can be found in the following packages:
* ruby1.8
* ruby1.9.1
Try: sudo apt-get install
same here... I ended up installing ruby using apt
DeleteThis comment has been removed by the author.
DeleteThanks for your great article.
ReplyDeleteWorked perfectly with ruby2.0.0 and rails4 on ubuntu, thanks a lot
ReplyDeleteGreat !! Worked like a charm for me :) Thank you very much :)
ReplyDeleteI would love to stop by. But, I think it might have to wait until this summer. I did not know that Serlkay had ever expanded its size. I must say that a succesful family owned business in this day and age is a very refreshing sight! As well as this is a very refreshing site!
ReplyDeleteGoogle Music Desktop Player
A small aside but I recently tried this on Open SUSE and ruby 2.1.2, I first had to install GCC via YaST.
ReplyDeleteIf this comment saves someone else that bafflement, it was worth it.
software development company delhi for outsourcing the projects, you need to put some extra efforts and research work to numbers of companies are available in the market to provide software development services.
ReplyDeleteYour site is very informative and your articles are wonderful. Hire PHP Developers
ReplyDeleteI am trying to compile for embedded linux-powerpc arch. And my rootfs does not come with base ruby. So i tried to compile ruby 2.2.1 from source but it has a pre-req for ruby and now this is a dead lock.
ReplyDeleteSo now how do i compile ruby from source without a base version of ruby already installed.
Very informative post, thanks for sharing. We offer best price in the industry and complete value of money to clients. We are one of the best companies offering Ruby on Rails in India.
ReplyDeleteThanks for the post. I'm trying to get an old rails project to work under Docker and found this helpful!
ReplyDeleteGreat post. If you are looking for Ruby on Rails experts in India then Cryptex Technologies is the best company for you. For any queries email us at: info@cryptextechnologies.com
ReplyDeleteIs there a way to compile Ruby by specifying the TK libraries rather than ActiveTcl, which is what Ruby is looking for with 2.3.1.
ReplyDeleteMy Ubuntu 16.04 keeps saying it can't find libtcltk-ruby, or any libraries, and whines it can't find ActiveTcl.
DeleteVery informative article, thanks for sharing! Ruby On Rails is powerful framework and it does require proper installation. If Proper installation is done as per the instruction, no one will find any kind of error at the time of compiling. To know more about RoR web Development check out this article: https://goo.gl/wySXDz
ReplyDelete3d christmas lights
ReplyDelete