KEMBAR78
Ruby on rails toolbox | KEY
RUBY ON RAILS
    TOOLBOX
WHAT WE NEED

• Core dependencies
   • Ruby, Ruby Gems, Rails
• Plus...
   • Database, Terminal/IDE, vcs, test frameworks, deployment
CORE DEPENDENCIES

• Ruby
• Ruby Gems
• Rails
RUBY

    Rails is a framework
written in the Ruby language.

   Great Rails developers
 are great Ruby developers.
RUBY

   ruby -v

1.8.7 or higher
RUBY GEMS

A gem is a ruby library.

        gem –v
     1.3.7 or higher

        gem list
    [sudo] gem install
RVM

             Not required, but helpful
For managing multiple versions of Ruby and multiple
        collections of gems "rvm gemset"

    rvm install 1.9.2
    rvm use 1.9.2
    rvm gemset create rails3
    rvm use 1.9.2@rails3
    echo "rvm use 1.9.2@rails3" > .rvmrc
RAILS INSTALLER

 if you are on Windows...
   http://railsinstaller.org/



            ruby
            rails
             git
GEMS

• Rails is a gem (and includes many other gems)
• Few gems you will use directly
   • Rails
   • Bundler
   • Rake
RAILS

Rails is distributed as a Ruby gem.

           gem list rails
                3.0.x

       [sudo] gem install rails
BUNDLER

 Bundler manages gem dependencies
          (and is itself a gem)
optional for Rails 2, required for Rails 3



            gem list bundler
             bundler (1.0.0)
RAKE

Rake is “make” for Ruby. Rails requires rake.
         Rake is distrubted as a gem.

                gem list rake
                0.8.7 or higher

            [sudo] gem install rake
OUR TOOLBOX

•   Database
•   Command line
•   Source Code Control with Git
•   Editor / IDE
•   Test Frameworks
•   Heroku for Easy Deployment
DATABASE

• We will use SQLite in Class
• You may use MySQL or PostgreSQL
  (if you can handle installation)
• Rails supports many other databases also
TEST FRAMEWORKS

   gem list rspec-rails
  gem install rspec-rails

    rspec-rails (2.0.0)
COMMAND LINE


  Mac/Unix Terminal
 GitBash on Windows
GIT

                 Git is for source code control.

                          which git (mac, unix)
                          git bash on windows


Why Git?
• Most Ruby and Rails developers use git
• Eco-system of tools
• Modern Source Code Control
Local Machine
EDITOR / IDE

     RubyMine
TextMate (Mac-only)
  Komodo (free)
HEROKU

• Simple cloud hosting
• Web sign-up for free account: heroku.com

 [sudo] gem install heroku
OUR TOOLBOX

• Core dependencies
  • Ruby
  • Ruby Gems
  • Rails (gem)
• Additional Tools
  •   Database
  •   Terminal / git bash on windows
  •   Git
  •   Rake (gem)
  •   Test Frameworks
      • rspec, rspec-rails
  • Heroku (for deployment)

Ruby on rails toolbox

  • 1.
  • 2.
    WHAT WE NEED •Core dependencies • Ruby, Ruby Gems, Rails • Plus... • Database, Terminal/IDE, vcs, test frameworks, deployment
  • 3.
    CORE DEPENDENCIES • Ruby •Ruby Gems • Rails
  • 4.
    RUBY Rails is a framework written in the Ruby language. Great Rails developers are great Ruby developers.
  • 5.
    RUBY ruby -v 1.8.7 or higher
  • 6.
    RUBY GEMS A gemis a ruby library. gem –v 1.3.7 or higher gem list [sudo] gem install
  • 7.
    RVM Not required, but helpful For managing multiple versions of Ruby and multiple collections of gems "rvm gemset" rvm install 1.9.2 rvm use 1.9.2 rvm gemset create rails3 rvm use 1.9.2@rails3 echo "rvm use 1.9.2@rails3" > .rvmrc
  • 8.
    RAILS INSTALLER ifyou are on Windows... http://railsinstaller.org/ ruby rails git
  • 9.
    GEMS • Rails isa gem (and includes many other gems) • Few gems you will use directly • Rails • Bundler • Rake
  • 10.
    RAILS Rails is distributedas a Ruby gem. gem list rails 3.0.x [sudo] gem install rails
  • 11.
    BUNDLER Bundler managesgem dependencies (and is itself a gem) optional for Rails 2, required for Rails 3 gem list bundler bundler (1.0.0)
  • 12.
    RAKE Rake is “make”for Ruby. Rails requires rake. Rake is distrubted as a gem. gem list rake 0.8.7 or higher [sudo] gem install rake
  • 13.
    OUR TOOLBOX • Database • Command line • Source Code Control with Git • Editor / IDE • Test Frameworks • Heroku for Easy Deployment
  • 14.
    DATABASE • We willuse SQLite in Class • You may use MySQL or PostgreSQL (if you can handle installation) • Rails supports many other databases also
  • 15.
    TEST FRAMEWORKS gem list rspec-rails gem install rspec-rails rspec-rails (2.0.0)
  • 16.
    COMMAND LINE Mac/Unix Terminal GitBash on Windows
  • 17.
    GIT Git is for source code control. which git (mac, unix) git bash on windows Why Git? • Most Ruby and Rails developers use git • Eco-system of tools • Modern Source Code Control
  • 18.
  • 19.
    EDITOR / IDE RubyMine TextMate (Mac-only) Komodo (free)
  • 20.
    HEROKU • Simple cloudhosting • Web sign-up for free account: heroku.com [sudo] gem install heroku
  • 21.
    OUR TOOLBOX • Coredependencies • Ruby • Ruby Gems • Rails (gem) • Additional Tools • Database • Terminal / git bash on windows • Git • Rake (gem) • Test Frameworks • rspec, rspec-rails • Heroku (for deployment)