The blog has moved to http://jessehouse.com/ ... Many google searches point here so I am leaving it operational, but there will be no new posts.

Saturday, April 9, 2011

Some notes - Ubuntu install rails 3 environment

Had this on my desktop, notes to set up Ubuntu install rails 3 environment

Ubuntu install rails 3 environment
================================================

1) Get RVM installed with ruby 1.9.2
 - http://www.christopherirish.com/2010/08/25/how-to-install-rvm-on-ubuntu-10-04/

2) Install Rails 3 gem
 - gem install rails --no-rdoc --no-ri
 - .... Successfully installed rails-3.0.5 ... 23 gems installed

3) Install redcar 'ruby ide'
 - check out
 - http://azazeal.xelixis.net/post/How-to-install-Redcar-editor-under-Ubuntu-1010-with-RVM.aspx
 - for my situation I am only installing it on ruby 1.9.2, if you plan to run multiple versions of ruby this probably will not work when you have your rvm switched to another version
  - gem install redcar --no-rdoc --no-ri
  - redcar install
 - now you should be able to type redcar at the terminal to launch the gui
 - lets make a desktop shortcut
  - right click on the desktop : Create Launcher
   - Type: Application
   - Name: Redcar
   - Command: /home/YOUR_USER_NAME/.rvm/gems/ruby-1.9.2-head/gems/redcar-0.11/bin/redcar
   - Comment: Ruby IDE
  - need a tight icon for our launcher
   - right click > Properties > click the emblem icon
   - Path: /home/YOUR_USER_NAME/.rvm/gems/ruby-1.9.2-head/gems/redcar-0.11/share/icons/redcar-icon-beta.png
  - drag the desktop icon up to the launcher bar if you want one there as well
   - need to set the icon path again for that one

4) Create a rails application 
 - mkdir projects; cd projects
 - rails new sample_app_01; cd sample_app_01
 - in redcar > File > Open Directory > projects/sample_app_01
  - ctrl+T > type Gem > open Gemfile
  - verify line : gem 'sqlite3'
 - back to the terminal
  - bundle 
  - rails g scaffold post title:string body:text
  - rake db:migrate
  - rails s
 - in a browser go to http://localhost:3000/posts


Sorry the links above are not hot, just cut and paste from my notes into a pre tag - quick and dirty

No comments: