Skip to content

Instantly share code, notes, and snippets.

@joonyou
Created August 14, 2017 14:14
Show Gist options
  • Save joonyou/2bacd384d43eed59c14edd5c0870d250 to your computer and use it in GitHub Desktop.
Save joonyou/2bacd384d43eed59c14edd5c0870d250 to your computer and use it in GitHub Desktop.
New Rails App
kylo [2.4.1] [~] ➜ cat bin/newrailsapp.sh
#!/bin/bash
set -e
app=$1
approot=$HOME/box/$1
# create a new rails app with my usuals
cd $HOME/box
$HOME/.rbenv/shims/rails new $app --skip-spring -T
cd $app
# update gitignore file - just in case not my machine or vm
echo "
.DS_Store
/log/*
!/log/.keep
/tmp
*.swp
*.swo
deploy.rb
database.yml
secrets.yml
.capistrano/**/*
.rspec
" >> .gitignore
# update Gemfile with the essentials
echo "
group :test do
gem 'rspec-rails'
gem 'capybara'
gem 'faker'
gem 'machinist', git: 'https://github.com/rubyhead/machinist.git'
end" >> Gemfile
# install gems
bin/bundle install
rbenv rehash
# rspec init
bin/rails generate rspec:install
# machinist
bin/rails generate machinist:install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment