Installing Rails

You have to install first ruby, rubygems, git, bundle, rails

Installing ruby

Preferable way is to install it with normal user via rvm. I am not an expert in mac so probably you need to install xcode from your disks/Internet. Then use rvm

Here is a one of the many tutorials http://www.shanison.com/2011/02/20/how-to-install-rvm-on-mac/

here are other ways for installing ruby taken from Ruby on Rails for Designers

  • Windows: One-Click Ruby Installer (I recommend using 1.8.6-26 Final Release)
  • Mac OS X 10.4: Ships with broken Ruby but you can follow the amazing guide by Dan Benjamin
  • Mac OS X 10.5: If you install the Developer Tools from Apple you will be set. Try either your installation discs or Apple’s Developer Site and download Xcode
  • Linux: While this may vary for each distribution, you will need to install ruby, irb, & rdoc

Installing rubygems

Download, extract and run ruby setup.rb

more reading here http://docs.rubygems.org/read/chapter/3

Checkout the project

One SCM is git. install it

http://git-scm.com/book/en/Getting-Started-Installing-Git

Then checkout it

git clone ssh://par@gudasoft.com/uppstart

Starting Rails project

go to the project folder you have checkout already.

cd uppstart

rvm will ask you if you trust the version of ruby specified in the project. Please agree and install it if you don’t have it.

installing is done by

rvm install ruby-what-ever-version

then you have to install bundle. This is done by doing

gem install bundler

After you have install bundler you will have the bundle command available. Bundler will try to install all the project dependencies. do this by typing

bundle

if you don’t have errors you will be almost ready to run the application.

check in config/database.yml and prepare the database specified in the development section

cat config/database.yml

If you see in development sqlite3 as an adapter then just type

rake db:setup

start the application by running

rails s

check the app by navigating to http://localhost:3000

Views

All views are located under app.

Files starting with underscore are partials which are reused in multiple places.

Assets

Assets could be in several places.

check

  • app/assets – for assets which are from the application
  • lib/assets – for assets which are exported
  • vendor/assets – for 3rd party assets

If you want to add your own file include it under the

application.js

or

application_screen.css

Do not add css/javascript directly in those files.

Deploying the application

Put your ssh keys on the server. This should be done once.

Then you have to put your changes on the remote repository. This is done by doing

First we need to get any remote changes by doing.

git pull
git commit -a

Then we can add our new files and commit the changed files/folders.

add the new files with

git add filename_or_folder

then commit all with a message

git commit -a -m "nice message what was changed"
git push

Finally From the application folder run

cap deploy