This is the first tutorial post on Apsotech blog. There are several tutorials available on Internet which guides through Ruby and Rails installation. This post is very particular about installing ruby version 1.9.3p194 and rails version 3.2.13. Lets get started.
Follow the below steps carefully if you get any error in between please solve the issue before going to the next step.
Installing ruby
Download the source file here.
Copy the file to home folder and open terminal, type the command
prathviraj@apsotech:~$tar xvjf ruby-1.9.3-p194.tar.gz
prathviraj@apsotech:~$cd ruby-1.9.3-p194/
Install dependency
prathviraj@apsotech:~/ruby-1.9.3-p194$sudo apt-get install libyaml-dev
Compile, make and install
prathviraj@apsotech:~/ruby-1.9.3-p194$sudo ./configure
prathviraj@apsotech:~/ruby-1.9.3-p194$sudo make
prathviraj@apsotech:~/ruby-1.9.3-p194$sudo make install
Now you have installed ruby on your machine. To confirm, check the ruby version
prathviraj@apsotech:~/ruby-1.9.3-p194$ ruby -v
ruby 1.9.3p194 (2012-04-20 revision 35410) [i686-linux]
Rails Installation
Now time to install rails using gem. I am not using apt-get repository for rails as it does not provide all the packages needed and its not up to date, instead I am using gem repository which is directly backed by ruby repository.
Install curl
prathviraj@apsotech:~$sudo apt-get install curl
Now download gem
prathviraj@apsotech:~/ruby-1.9.3-p194$sudo curl -L https://get.rvm.io | bash -s stable --ruby -V
Install curl
prathviraj@apsotech:~$sudo apt-get install curl
Now download gem
prathviraj@apsotech:~/ruby-1.9.3-p194$sudo curl -L https://get.rvm.io | bash -s stable --ruby -V
To install rails just type
prathviraj@apsotech:~/ruby-1.9.3-p194$sudo gem install rails
It may take some time depending on your Internet speed.
After completion check your rails version
prathviraj@apsotech:~/ruby-1.9.3-p194$ rails -v
Rails 3.2.13
Now create a project. I would suggest you to do it inside home directory
prathviraj@apsotech:~$ rails new projectname -d mysql
prathviraj@apsotech:~$ cd projectname/
Now download all necessary gem files here
Extract the cache.zip file and place it inside directory ~/projectname/vendor/
Before going ahead, you need to install some dependecies for mysql2 gem. Type
prathviraj@apsotech:~/projectname$ sudo apt-get install mysql-client libmysqlclient-dev
Install all the gem files
prathviraj@apsotech:~/projectname$ bundle install --local
Congratulations!! If you are lucky enough to go through all the installation steps.
Error instaling gem file
ReplyDelete$sudo gem install rails
It seems your ruby installation is missing psych (for YAML output).
To eliminate this warning, please install libyaml and reinstall your ruby.
after doing this-- sudo gem install rails
ReplyDeleteit ask for password nd then it stops(not downloading anything)
First install this
ReplyDeletesudo apt-get install libyaml-dev
Then rebuild Ruby
Thank you :) Worked on my PC
ReplyDeleteerror macha
ReplyDeletesudo gem install rails -V
ERROR: Loading command: install (LoadError)
cannot load such file -- zlib
ERROR: While executing gem ... (NameError)
uninitialized constant Gem::Commands::InstallCommand
Second step says :$cd ruby-1.9.3-p194/
ReplyDeletebut in third step ur still in ur home directory..
do v have to do rest of installation in our home directory..???
i m unable to install gem rubyracer
ReplyDeleteBuilding native extensions. This could take a while...
ERROR: Error installing therubyracer:
ERROR: Failed to build gem native extension.
Great Article.
ReplyDeleteThis is nice information blog , The first thing I noticed about your blog is how well designed and unique looking it is. I wish you the best.
Ecommerce Website Design Mumbai
Rails development is a web-application framework that includes the whole thing needed to generate database-backed web applications according to the Model-View-Controller (MVC) pattern. Understanding the MVC prototype is key to accepting Rails. MVC divides your application into three layers, each with a precise accountability. Installing ROR on Ubuntu is not of fresher task, you need to be well known with Ubuntu too.
ReplyDeleteNot so far I have found new cool tool to work with mySQL on ubuntu – Valentina Studio. Its free edition can do things more than many commercial tools!!
ReplyDeleteI very recommend check it. http://www.valentina-db.com/en/valentina-studio-overview
All the information of this blog is very useful because it have all the installation of application with detailed description.
ReplyDeleteWeb Design Company | Web Development Company
I am just about satisfied together with your sensible perform. You position incredibly really useful details. Keep it up. Keep composing a weblog. Trying to research your next post.
ReplyDeleteweb designing companies bangalore | website design company in bangalore
Nice share! Interesting read and looking forward in learning more.
ReplyDeletevery nice information sharing...
ReplyDeletevery useful information sharing...
ReplyDeleteThanks for sharing such informative article
ReplyDeletecontent writing services
content writing agency
content writing company
website content writer, freelance content writer, professional content writers