Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save tannerhodges/ef0d7c6265390330e442 to your computer and use it in GitHub Desktop.
Save tannerhodges/ef0d7c6265390330e442 to your computer and use it in GitHub Desktop.
Getting up and running with Ruby on Rails
# Getting up and running with Ruby on Rails
TODO: Polish and send to Cayla
## Let’s get introduced to the Terminal!
- Open Spotlight and type in `terminal`
- You should see the application come up — open it
- Tada! You’ve opened the app and can start running fancy computer commands now
## Learning basic terminal commands
- Create a new directory (aka: a folder) for us to put our Rails projects in. Type in `mkdir learning-rails` and hit Return (this will run the command).
- `mkdir` means “create a new directory”
- `learning-rails` is the name we want to give to the directory
- This is the same as creating a new folder in Finder. (Note: You can actually open Finder and see the new folder you just created.)
## Bonus
- Press Cmd+Space to open spotlight quickly
- Not sure why we're getting permissions errors installing rails. Tried fixing with `sudo chown -R caylahanousek:staff ~/.rbenv && sudo chown -R caylahanousek:staff ~/.gem`
---
- Basic terminal (make a directory and cd into it)
- http://rubyonrails.org/download/
- Make sure xcode command line tools are installed
- http://railsapps.github.io/xcode-command-line-tools.html
- `xcode-select --install` worked on Cayla's computer
- `xcode-select -p` to make sure it's installed
- Homebrew
- http://brew.sh/
- rbenv
- https://robots.thoughtbot.com/using-rbenv-to-manage-rubies-and-gems
- vim for text editing
- update bash profile: `vim ~/.bash_profile`
- Hit `i` and paste
- Escape, `:wq`, enter (save and exit)
- Add this to your `.bash_profile`: `eval "$(rbenv init -)"`
- This allows shims and autocompletions in rbenv
- Install latest stable version of Ruby
- https://www.ruby-lang.org/en/downloads/
```
rbenv install 2.2.2
rbenv global 2.2.2
```
rails new my-testapp
cd my-testapp
rails server
visit localhost:3000
- Open Sublime and open your project
- routes.rb
- root 'application#index'
- controller method `def index ... end`
- view in application/index.html.erb
- ctrl+c to end server
## What's Next...
- html5doctor.com
- git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment