If you've already experimented with Ruby and/or Rails before, verify that your versions are correct for this upcoming class.
- In your Terminal, run
ruby --version
. The output will include the version number of Ruby you have installed. Verify you are running version 2.0+ of Ruby. - In your Terminal, run
rails --version
. Verify you are running version 4 of Rails.
If you are using an earlier version of Ruby or Rails, continue with the instructions to get your environment set up. Run these version commands in the Terminal again after you're done to ensure everything is working properly.
Note: When copying the code snippets, exclude the ➜
as you run the code in your Terminal. The ➜
is simply an indicator of the user in the Terminal.
RVM is a Ruby Version Manager. It lets you easily switch between versions of the Ruby programming language for different projects.
- Run the following command in your Terminal to install both RVM and the latest version of Ruby.
➜ \curl -L https://get.rvm.io | bash -s stable --ruby
Ruby packages are referred to as "gems".
- Use the following Terminal command to install Rails 4.
➜ gem install rails
If this causes errors on your machine, try running sudo gem install rails
instead.
-
Download Postgres.app.
-
Follow Postgress.app's install instructions (move Postgres.app into your Applications folder).
-
Follow Postgres.app's instructions to install command line tools:
-
Add Postgres.app to your
$PATH
➜ echo 'PATH=$PATH:/Applications/Postgres.app/Contents/Versions/9.4/bin' >> ~/.zshrc
-
Source your
~/.zshrc
➜ source ~/.zshrc
-
Check that your install worked
➜ which psql
Only if the Postgres.app instructions above were unsuccessfully and you have spoken to a member of the teaching team, follow these instructions for installing PostgreSQL with Homebrew.