Skip to content
Stephanie Cheng edited this page Dec 18, 2012 · 21 revisions

The essentials to get the party started :)

New to rails?

Start here: http://guides.rubyonrails.org/getting_started.html
More documentation can be found here and here (Rails Guide).

And some tutorials you may find useful:

Basic Rails app structure

Rails app _______ Gemfile
             |___ app __________ assets
             |              |___ controllers
             |              |___ models
             |              |___ views
             |___ config _______ routes.rb
             |___ db
             |___ lib
             |___ public _______ 404 page
             |              |___ favicon.ico
             |              |___ index.html
             |___ vendor _______ assets
             |              |___ plugins
             |___ Rakefile
             |___ README.rdoc

app/: where the main application lies
config/routes.rb: where main routing is handled
Gemfile: list of gems to be installed
public/index.html: default site index page
vendor/: external frameworks/libraries, plugins. NOTE: All js libraries & plugins go here (isotope, angular etc.)

For more details see the README.rdoc.

How to deploy locally

Initial set-up (Things you should only have to do once)
Clone the WIS repo locally if you haven't already:

$ git clone git@github.com:mylestan/whatissystems.git
$ cd whatissystems

Install the necessary gems from le Gemfile:

$ bundle install

shorthand:

$ bundle

Any time you make any changes to your Gemfile, make sure you also run a 'bundle' to update your gemset and then to restart your server. Occasionally, after you do a 'git pull', your console may also insist you run a bundle if the Gemfile has been updated remotely by another team member.

Start your rails server

$ rails server
/Users/Stephanie/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.8/lib/rails/script_rails_loader.rb:11: warning: Insecure world writable dir /usr/local in PATH, mode 040777
/Users/Stephanie/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.2.0/lib/bundler/runtime.rb:197: warning: Insecure world writable dir /usr/local in PATH, mode 040777
=> Booting WEBrick
=> Rails 3.2.8 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2012-12-07 21:49:13] INFO  WEBrick 1.3.1
[2012-12-07 21:49:13] INFO  ruby 1.9.3 (2012-04-20) [x86_64-darwin11.4.0]
[2012-12-07 21:49:13] INFO  WEBrick::HTTPServer#start: pid=49911 port=3000

shorthand:

$ rails s

Hit up http://localhost:3000 and voila! you should see the site up and running in your browser! You're welcome :)

Git References

If you aren't already familiar with git, here are some how-to's and references besides github:help itself which is pretty useful as well:

Clone this wiki locally