To do:
- Install RVM
https://rvm.io/rvm/install - About Gemset
https://rvm.io/gemsets/basics
#Install ruby version $rvm install 2.0.0
Work directory sample bootstrap - postgreSQL
- railsprojects
|- railsnew.sh
|- Gemfile
|- dist/
Setup Gemfile pg & haml
source 'https://rubygems.org' gem 'rails', '4.0.0' gem 'pg' gem 'sass-rails', '~> 4.0.0' gem 'uglifier', '>= 1.3.0' gem 'coffee-rails', '~> 4.0.0' gem 'jquery-rails' gem 'jquery-ui-rails' gem 'turbolinks' gem 'jbuilder', '~> 1.2' gem 'haml' group :test,:development do gem 'rspec-rails' gem 'pry' end group :test do gem 'capybara', "2.0.2" gem 'fabrication' gem "shoulda-matchers" endDownload bootstrap
$wget https://github.com/twbs/bootstrap/releases/download/v3.0.3/bootstrap-3.0.3-dist.zip $unzip bootstrap-3.0.3-dist.zipScript railsnew.sh
echo "Running" rails new "$1" --database=postgresql cp Gemfile $PWD"/$1" cd $1 echo "$1" > .ruby-gemset cat .ruby-gemset echo "$2" > .ruby-version cat .ruby-version cp ../dist/js/bootstrap.js $PWD/app/assets/javascripts/ cp ../dist/css/bootstrap.css $PWD/app/assets/stylesheets/Permissions
sudo chmod +x railsnew.shTo run the script we need to pass 2 parameters "appname" "ruby-version"
#Our ruby list $rvm list rvm rubies =* ruby-1.9.3-p429 [ i686 ] ruby-2.0.0-p195-perf [ i686 ] # => - current # =* - current && default # * - defaultExecution & verification
$./railsnew.sh testapp ruby-1.9.3-p429 $cd testapp $rvm current $bundleThat's it, you can add/edit what you need for your projects