We will also use pip3
to install Django, a robust back-end server for Python. We will be installing the 2.0.x version:
pip3 install Django
rbenv lets us change ruby verions on the fly, useful for working with diffrent versions.
brew update
brew install rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.zshrc
echo 'eval "$(rbenv init -)"' >> ~/.zshrc
source ~/.zshrc
sudo chown -R $USER ~/.rbenv
Note: new versions of Ruby and Rails are released regularly. Check with your instructor whether the versions listed below is appropriate
brew update
brew install ruby-build
rbenv install 2.4.1
rbenv global 2.4.1
echo "gem: --no-ri --no-rdoc" > ~/.gemrc
Restart your terminal. The command above will install gems without documentation (which can take up time when installing Rails)
sudo gem update
sudo gem install rails
You may need to press "yes" for various entries
Make sure to restart your terminal and then run each of these commands. Finally call someone over to validate your installation is correct.
rails -v
ruby -v
which ruby
which rails
which bundle
which gem
node -v
npm -v
git --version
psql --version
subl -v (or atom -v)
You may already have an old version of Ruby installed. In this case, it may be easiest to update your Ruby version with RVM - Ruby Version Manager. The stable option will install RVM with the latest stable (tested and approved) version of Ruby.
\curl -sSL https://get.rvm.io | bash -s stable --ruby
Now that you have RVM, some useful commands it can perform:
rvm list known
This lists all known versions of Ruby
rvm install X.X
Install version X.X of Ruby (where you replace the X's with the appropriate version number you would like to install).
rvm use X.X
If you have multiple versions of Ruby, you must tell your computer which one to use as the primary or default version.
rvm use X.X --default
This does the same as the above command, but additionally sets this version of Ruby as the default for any new shells you might use.
Refer to RVM documentation for any further RVM questions.