Here are the steps you need to configure your environment to start building Rails web applications:
- Installing Git
- Installing Ruby
- Installing RubyGems
- Installing Rails
Here are the steps you need to configure your environment to start building Rails web applications.
on a Debian-based distribution like Ubuntu, you have to type following instruction to install Git:
$ apt-get install git-core
You may find detailed installation instructions for your platform at the Installing Git section of the book Pro Git.
You need curl, if you don't have you can installed on Ubuntu by typing:
$ apt-get install curl
Then download RVM
$ curl -L get.rvm.io | bash -s stable
Load RVM
$ source ~/.rvm/scripts/rvm
Check requirements for installing RVM and follow the instructions:
$ rvm requirements
Finally, now you can install Ruby (1.9.3 is latest version)
$ rvm install 1.9.3
For Windows (using Cygwin) check this tutorial.
rbenv is another ruby sandboxing tool lighter and faster than rvm, you can use both in similar way.
$ which gem
/Users/mhartl/.rvm/rubies/ruby-1.9.3-p0/bin/gem
$ gem install rails -v 3.2.3
To check Rails installation, run following command to see version number:
$ rails -v
Rails 3.2.3
If you’re running Linux, you might have to install a couple of other packages at this point:
$ sudo apt-get install libxslt-dev libxml2-dev libsqlite3-dev # Linux only
You want to configure Ruby on Rails on a virtual machine based on Bodhi Linux 1.4.0 Stable which is a light distro based on Ubuntu 10.04 LTS. I may be useful to use configure_image.sh which is configuration file that will install most of the things described earlier and other useful gems.
These are the instruction for configuring your vm and testing a sample web applications:
Installing Git
Rails ecosystem depends tremendously on Git a very powerful version control system. Git must be installed at first as you will see it every time you google any Rails package.on a Debian-based distribution like Ubuntu, you have to type following instruction to install Git:
$ apt-get install git-core
You may find detailed installation instructions for your platform at the Installing Git section of the book Pro Git.
Installing Ruby
Next thing to do is to install Ruby, for this you need first to install Ruby Version Manager (RVM). RVM primary goal is helping you to install and manage multiple versions of Ruby on the same machine. Following are the steps for installing RVM on Linux, more details can be found in RVM Installation.You need curl, if you don't have you can installed on Ubuntu by typing:
$ apt-get install curl
Then download RVM
$ curl -L get.rvm.io | bash -s stable
Load RVM
$ source ~/.rvm/scripts/rvm
Check requirements for installing RVM and follow the instructions:
$ rvm requirements
Finally, now you can install Ruby (1.9.3 is latest version)
$ rvm install 1.9.3
For Windows (using Cygwin) check this tutorial.
rbenv is another ruby sandboxing tool lighter and faster than rvm, you can use both in similar way.
Installing RubyGems
RubyGems is a useful package manager for Ruby projects that may save you a lot of time as there are many useful libraries (including Rails) available as Ruby packages, or gems. RubyGems should be automatically installed if you had successfully installed RVM easy once you install Ruby. You may use following command to check its availability:$ which gem
/Users/mhartl/.rvm/rubies/ruby-1.9.3-p0/bin/gem
Installing Rails
Finally, we are ready for installing Rails framework and star building great web applications. Rails can installed as follows:$ gem install rails -v 3.2.3
To check Rails installation, run following command to see version number:
$ rails -v
Rails 3.2.3
If you’re running Linux, you might have to install a couple of other packages at this point:
$ sudo apt-get install libxslt-dev libxml2-dev libsqlite3-dev # Linux only
You want to configure Ruby on Rails on a virtual machine based on Bodhi Linux 1.4.0 Stable which is a light distro based on Ubuntu 10.04 LTS. I may be useful to use configure_image.sh which is configuration file that will install most of the things described earlier and other useful gems.
These are the instruction for configuring your vm and testing a sample web applications:
- Create a new VM with 256 MB RAM and 4GB HD (VirtualBox > New)
- Mount bodhi_1.4.0.iso as a live CD (VirtualBox > Settings > Storage)
- Install Bodhi Linux (VirtualBox > *your_VM* > Start)
- sudo apt-get update, sudo apt-get upgrade
- sudo apt-get install git-core (there's no git on Bodhi preinstalled)
- mkdir -p Documents (there's no Documents directory/folder by default)
- wget -O configure_image.sh http://pastebin.com/download.php?i=WTXF7g7F
- chmod +x configure_image.sh
- ./configure_image.sh (setups the necessary development environment ~ 2h!)
- cd Documents
- mkdir -p hw2_rottenpotatoes_2012 (for my fork of the official repo)*
- git clone git://github.com/saasbook/hw2_rottenpotatoes.git
- cp -r hw2_rottenpotatoes hw2_rottenpotatoes_2012
- cd hw2_rottenpotatoes_2012
- bundle install --without production
- bundle exec rake db:migrate
- rails server
- http://0.0.0.0:3000/movies
Resources
You may have to look for other useful resources:- Ruby on Rails site
- Ruby on Rails tutorial is a good book by Michael Hartl if you start with Ruby and/or Rails
- Engineering Long-Lasting Software: An Agile Approach Using SaaS and Cloud Computing by Armando Fox and David Patterson. Here is the link for configuring virtual machine if you want to go through the book example.
- Other useful resources for Ruby in general can be found at RubySource and for Rails at RailsCasts
Thank you for providing useful content Ruby on Rails Online Training Hyderabad
RépondreSupprimer