Finally I’m going to start work on RoR. After spending one and a half month on CodeIgniter i.e php framework, I’m going to work on something new, something more powerful, something that I never experienced before. Whenever I search about Ruby On Rials I always found positive review about this framework. That’s the reason I’m going to dive in it. NO. Maybe this is the one of the reason but I really want to taste it. I have little experience with Django framework, recently experienced with CodeIgniter and now it’s time to taste RoR :).
RoR Installation :
Rails 4.1.4, Ruby 2.1.2p95, Rubygems 2.4.1
CAUTION : Don’t use apt-get to install ruby as I install outdated version of ruby.
- Curl Installation :
$ sudo apt-get update
$ sudo apt-get install curl
- Install Ruby Using RVM ( Ruby Version Manager )
$ \curl -L https://get.rvm.io | bash -s stable --ruby
Note the backslash before “curl” (this avoids potential version conflicts).
The “–ruby” flag will install the newest version of Ruby.
If You Already Have RVM Installed :
$ rvm get stable --autolibs=enable $ rvm install ruby $ rvm --default use ruby-2.1.2
- Install Node.js :
$ sudo apt-get install nodejsIf you don’t install Node.js, you’ll need to add this to the Gemfile for each Rails application you build:
- Check the Gem Manager
$ gem -v 2.4.1 In order to update gem if necessary use $ gem install rubygems-update
- RVM Gemsets :
$ rvm gemset list gemsets for ruby-2.1.2 => (default) global
Only the “default” and “global” gemsets are pre-installed.
If you get an error “rvm is not a function,” close your console and open it again.
- RVM’s Global Gemset :
$ rvm gemset use global $ gem list
You’ll see a lots of pre-installed gems. Like blunder, rake, rvm etc.
To get a list of gems that are outdated:
$ gem outdated
To update all stale gems:
$ gem update
- Rails Installation Options :
You can install Rails directly into the global gemset. However, many developers prefer to keep the global gemset sparse and install Rails into project-specific gemsets, so each project has the appropriate version of Rails.Instead, make a gemset just for the current stable release:
$ rvm use email@example.com --create
If you want the most recent stable release:
$ gem install rails $ rails -v
- Create New Rails Project :$ rails new Project_Name
$ cd Project_Name
$ bin/rails server
$ Open link in browser http://localhost:3000
This is all about installation. I just start learning RoR, whatever I learn in coming days i’ll keep on posting, Stay tuned.
Sublime is one of my best editor. After VIM, this is the editor whom to I feel in love ;). I found some good stuff which make work more easy.
- Package Manager/Controller
Click here. After installation press Ctrl+Shift+P and type “install package” and Install whatever package you want like HTML5 snippet and all.
This is one of my best package. Now, there is no need to refresh your browser each time you make the changes to the file with this plugin installed. Just hit save on the editor and browser will automatically refresh the page for you. Press Ctrl+Shift+P and type “install package”. When it’s done then type LiveReload. In order to add browser extension ( which is must ) click here.
In a nutshell, Emmet allows us to write HTML and CSS faster with abbreviations/shortcuts, then expand them in valid HTML tags.
With this plugin, you can check the browser support for CSS properties and HTML elements that you are using.