views:

46

answers:

1

Just got this RoR app working, and just want some clarification to what exactly went on behind the scenes, briefly so I can look into each step:

    Clone the git repo

 git clone git://github.com/railsdog/spree.git spree
 cd spree
Install the gem dependencies

 bundle install
Create a sanbox rails application for testing purposes

 rails new sandbox -m sample/sandbox_template.rb
 cd sandbox
Generate the necessary Spree files

 rails g spree:install
Bootstrap the database (run the migrations, create seed data, optionally load sample data.)

 rake db:migrate db:seed db:sample
Start the server

 rails server

I know what the 1st line is doing, git clone ...


But does bundle install download all the dependancies from what file? Where does the call to rails g spree:install look to generate the files?

I know rake is like 'make', but is it really compiling new code? Or does rake just run the migration scripts etc. i.e. no compiling going on.

+3  A: 

Let's go through it step-by-step:

git clone git://github.com/railsdog/spree.git spree

This checks out the latest code from git to the directory spree

bundle install

This parses the Gemfile in your directory and installs the dependencies for your application accordingly.

rails new sandbox -m sample/sandbox_template.rb

This creates a new rails project from a rails-template, this template instructs rails to generate the application with certain pre-defined parameters.

rails g spree:install

A generator that comes with spree that has instructions on how to make your spree application ready for use.

rake db:migrate db:seed db:sample

Migration the database migrations and feel the application with seed and demo-date.

Rake might compile certain things, if the sqlite gem needs to be installed for instance rake will make sure you compile it correctly. It differs per situation.

Maran
thanks, so where is the spree:install instructions? what file?
Blankman
You don't _have_ to know what it does, it just installs stuff for you automatically. If you want to know what the code behind it is you can look in the "spree/lib/generators" folders
Maran