#Env Setup
We'll be messing with
Steps
Install homebrew
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
Set up git
brew install git
Set up rbenv
brew update
brew install rbenv
brew install ruby-build
rbenv install --list
rbenv install 2.1.0
rbenv global 2.1.0
Set up the rehash plugin
git clone https://github.com/sstephenson/rbenv-gem-rehash.git ~/.rbenv/plugins/rbenv-gem-rehash
#Hello World
create a working dir for your project,
mkdir -p ~/projects/hello_world
cd !$
rbenv local 2.1.0
ls -alh
gem install bundler
create the gemfile for rails
touch Gemfile
echo "source 'http://rubygems.org'" >> Gemfile
echo 'gem rails' >> Gemfile
install rails, create a project
bundle install
rails new hello
run your project
bundle exec rails server
create your first model
bundle exec rails g model People name:string nickname:string
Hey, your Gemfile config line
echo 'gem rails' >> Gemfile
Needs to be:
echo "gem 'rails'" >> Gemfile
Also, you need to make sure that the user is cd'ing into the 'hello' directory after creating the 'hello' project.
Also, also, make sure the migrations are turn after creating the People model:
bin/rake db:migrate RAILS_ENV=development