Rails 3 Setup with RVM

1 Comment

Rails 3.0 requires at least Ruby 1.8.7. Support for all of the previous Ruby versions has been dropped officially. Rails 3.0 is also compatible with Ruby 1.9.2.

What is rvm?
RVM is a command line tool which allows us to easily install, manage and work with multiple ruby environments from interpreters to sets of gems. More info about RVM

Install ruby 1.9.1 and Rails 3 using rvm in Ubuntu 9.10

To install rvm:

bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )

I guess git is required for this. You can check whether git is installed using “git –version”, if not:

sudo apt-get install git
sudo apt-get install git-core

After Installation :
put the following line into your profile(/home/.profile) at the very bottom.

if [[ -s "$HOME/.rvm/scripts/rvm" ]]  ; then source "$HOME/.rvm/scripts/rvm" ; fi

Then load the new code into your current shell and start using RVM

 source ~/.rvm/scripts/rvm

Be sure to install any dependencies for your operating system.

rvm notes

Now add the sourcing line at the end of your profiles (~/.bashrc or ~/.bash_profile):

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"

Then open a new shell and start using RVM!

 rvm install 1.9.1 

(This will install ruby in .rvm folder. see /home/<usr_name>/.rvm/src and bin)

 ruby -v
 #ruby 1.9.1p378 (2010-01-10 revision 26273) [i686-linux]
which ruby
 #/home/<user_name>/.rvm/rubies/ruby-1.9.1-p378/bin/ruby

To switch back to your system’s ruby :

 rvm system
ruby -v
 #ruby 1.8.6 (2008-08-11 patchlevel 287) [i686-linux]

which ruby
#/usr/bin/ruby

Commands::
To setup rvm, ruby1.9.1 and Rails3 with current version of ruby & rails:

ruby -v

bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )

OR
mkdir -p ~/.rvm/src/ && cd ~/.rvm/src && rm -rf ./rvm/ && git clone git://github.com/wayneeseguin/rvm.git && cd rvm && ./install

rvm install 1.9.1
rvm list
rvm 1.9.1
rvm 1.9.1 --default
rvm system
gem install tzinfo builder memcache-client rack rack-test rack-mount erubis mail text-format thor bundler i18n
gem install rails --pre
rails new blog
cd demo
gem install sqlite3-ruby
rails server
visit :: http://localhost:3000
rails generate scaffold post name:string
rake db:migrate

visit :: http://localhost:3000/posts

See list of ruby versions installed using RVM:

rvm list

#rvm rubies

=> ruby-1.9.1-p378 [ i386 ]

Add to: Facebook | Digg | Del.icio.us | Stumbleupon | Reddit | Blinklist | Twitter | Technorati | Yahoo Buzz | Newsvine

- Abhishek Singh

Some Awesome Quotes

4 Comments

Add to FacebookAdd to DiggAdd to Del.icio.usAdd to StumbleuponAdd to RedditAdd to BlinklistAdd to TwitterAdd to TechnoratiAdd to Yahoo BuzzAdd to Newsvine

I spend past couple of days on web in search of some thoughtful lines. My objective was to get some really thought-provoking quotes. I started from quotes on life & attitude and end-up with some SE and programming quotes. I found so many blogs over internet about quotes and hilarious sayings but everywhere 80% text was a waste. BTW i extracted some awesome lines, as i thought i should share :

  • Nothing is interesting if you’re not interested.
  • It’s amazing that the amount of news that happens in the world everyday always just exactly fits the newspaper.
  • A narrow mind and a wide mouth usually go together.
  • I don’t have an attitude problem. You have a perception problem.
  • If the only tool you have is a hammer, you treat everything like a nail.
  • Error is discipline through which we advance.
  • The secret of my success is that at an early age I discovered I was not God.
  • Never knock on Death’s door ring the bell and run away Death really hates that.
  • If pregnancy were a book they would cut the last two chapters.
  • The greatest discovery of my generation is that human beings can alter their lives by altering their attitudes of mind.
  • The most successful people are those who are good at plan B.
  • Smile when it hurts most.
  • Never fear shadows. They simply mean there’s a light shining somewhere nearby.
  • Some things Man was never meant to know. For everything else, there’s Google.
  • “unzip; strip; touch; finger; mount; fsck; more; yes; unmount; sleep” – my daily unix command list..
  • “… one of the main causes of the fall of the Roman Empire was that, lacking zero, they had no way to indicate successful termination of their C programs.”
  • “Programming is like sex, one mistake and you have to support it for the rest of your life.”
  • “A computer lets you make more mistakes faster than any invention in human history – with the possible exceptions of handguns and tequila”
  • “To go forward, you must backup.”
  • “I would love to change the world, but they won’t give me the source code”
  • “My software never has bugs. It just develops random features.”
  • “Better to be a geek than an idiot.”
  • “Windows isn’t a virus, viruses do something.”
  • “Difference between a virus and windows ? Viruses rarely fail.”
  • “Evolution is God’s way of issuing upgrades.”
  • “Computer are like air conditioners: they stop working when you open windows.”
  • “Real men don’t use backups, they post their stuff on a public ftp server and let the rest of the world make copies.”
  • It is easier to change the specification to fit the program than vice versa.”
  • “Programmers are tools for converting caffeine into code.”
  • “The great thing about Object Oriented code is that it can make small, simple problems look like large, complex ones.”
  • “Hacking is like sex. You get in, you get out, and hope that you didn’t leave something that can be traced back to you.”
  • The nice thing about Windows – it does not just crash; it actually displays a dialogue box and lets you press OK first.
  • “Programming today is a race between software engineers stirring to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning.”
  • Brooks Law: “Adding manpower to a late software project makes it later!”
  • The bearing of a child takes nine months, no matter how many women are assigned. Many software tasks have this characteristic because of the sequential nature of debugging.
  • Programming can be fun, so can cryptography; however they should not be combined.
  • You cannot teach beginners top-down programming, because they don’t know which end is up.
  • “ Should array indices start at 0 or 1? My compromise of 0.5 was rejected without, I thought, proper consideration. ”
  • “ If debugging is the process of removing software bugs, then programming must be the process of putting them in.”
  • “In order to understand recursion, one must first understand recursion.”
  • “There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult.”
  • “There are two major products that come out of Berkeley: LSD and UNIX. We don’t believe this to be a coincidence.”

And the most hilarious one is :

It should be noted that no ethically-trained software engineer would ever consent to write a DestroyBaghdad procedure. Basic professional ethics would instead require him to write a DestroyCity procedure, to which Baghdad could be given as a parameter.

:) RoR_Programming

-Abhishek Singh
Follow me @Twitter
Facebook
LinkedIn

Add to FacebookAdd to DiggAdd to Del.icio.usAdd to StumbleuponAdd to RedditAdd to BlinklistAdd to TwitterAdd to TechnoratiAdd to Yahoo BuzzAdd to Newsvine

Follow

Get every new post delivered to your Inbox.