Get Set Up!
- Due Jan 31 by 11:59pm
- Points 10
Yes, it's the most fun part of any software-intensive experience: get your tools to work! A summary of the steps below:
- Get yourself a
bash
shell with root (administrator) privileges - Ensure cURL works
- Install and configure Git CLI including
ssh
access - Install a version manager (
rvm
, asdf or mise) and recent versions of Ruby and Rails - Install Node.js and
npm
- Install the Heroku CLI
For each step, we'll show you how to test interactively if it worked, and there's also a script you can run at the end that tests everything. The script is for self-check only and you do not need to submit anything for this assignment.
Note. Work with your team on this process, so you can help each other by Googling and debugging. If you run into a wall, don't go straight to the staff. Work with your team to get as far as you can before stalling and asking for help. Remember RASP: Read the docs, Ask a teammate, Search the internet, then Post a question. Ask yourself: Has your team done enough self-help that if you were at a software company, you would go to a senior engineer for help with this problem?
A Note on Windows:
For windows we recommend starting with "Windows Subsystem for Linux 2". We are not Windows experts, but recommend these two posts:
https://medium.com/@leo7xs/ruby-on-rails-wsl-2-and-windows-10-b225c609ac16
Links to an external site.
https://www.hanselman.com/blog/ruby-on-rails-on-windows-is-not-just-possible-its-fabulous-using-wsl2-and-vs-code
Links to an external site.
Bash & basic command-line tools
What development environment should I use? We don’t care, as long as you have a Unix-like command shell such as bash, because believe us, you will be using it all the time. GUIs are fine, but you will need a bash shell and, probably, root (administrator) privileges for some of the installs. Some choices:
- Local (Linux): You already have it. Determine which package manager (most likely
apt
) works with your system, as you'll need it later to install some packages. - Local (Mac OS): The Mac terminal runs bash by default. You probably want to install Homebrew Links to an external site.for managing other packages later.
- Local (Windows): We recommend using Git for Windows
Links to an external site., which gives you the Git CLI and a bash-like shell, along with many other useful command-line tools including
curl
. - Web-based IDE: there are many. Pick one you like. Some are free. Codio is pretty good but (as you know) not free. VSCode has had good reviews. But you need one that gives you a bash shell and root access.
Check: Typing echo $SHELL
at the shell prompt should result in /bin/bash
or something similar.
cURL
The Swiss Army knife of command-line Web tools. On MacOS, it's preinstalled. On Linux, if it's not installed you can try sudo apt install curl
. On Windows, if you use Git for Windows you also get Curl, but otherwise you're on your own; try the cURL home page
Links to an external site. for help, but really, you should use Git for Windows.
Check: curl --version
should show you which curl version is installed.
Git
Install the git command-line tools if they're not already installed (i.e. if typing git
does not show you a help message). Then configure GitHub ssh access
Links to an external site..
Check: ssh -T git@github.com
should give you a happy message.
rvm (Ruby Version Manager)
Different Ruby projects may require different Ruby versions. Since your team may either be starting a new project or may be enhancing an existing codebase, you need the flexibility to install and maintain multiple Ruby and Rails versions. Ruby Version Manager lets you not only install multiple versions and choose which one is active at any given time, but also allow each version to install its own sets of Ruby gems. Download and install it here
Links to an external site., then install Ruby 3.x (who knows which version you'll actually need later, this is to make sure the toolchain works). Finally, switch to the just-installed Ruby with rvm use
.
Check: rvm list
should show a list of installed Rubies.
asdf and mise (Multi-Language version managers)
asdf (https://asdf-vm.com/ Links to an external site.) and mise (https://mise.jdx.dev/ Links to an external site.) are more "modern" multi-language version managers which make it easier to install more than just ruby. They may have better support if you are using an ARM (Apple Silicon, M2 / M3 / etc) Mac.
Mise is a newer and slightly easier to use tool, but the staff have less experience with it.
A rough installation guide.
brew install mise
mise plugin add ruby
mise use ruby@3.3
brew install asdf
asdf plugin add ruby
asdf install ruby latest:3.3
Ruby ~>3, Rails ~>6
Once you've setup your preferred way to manage rubies, install ruby 3.0 or higher and Rails 6.1. gem install rails
You may not be using specifically Rails 6.1 on your project, but this is a good test of installing local versions.
rails -v
should show Rails 6.1.x
.
node and npm
Node? Really? Yes. Capybara may use it for JavaScript testing, some asset pipelines require Node and some packages to be running…
The installers Links to an external site. for Mac/Windows/Linux will install both Node and NPM, the Node Package Manager, which we'll use later.
If you haven't installed nodejs or npm, you can also use mise or asdf tools to install them. (Though you make need to do a little Googling!)
Check: node -v
and npm -v
should display the versions installed.
Heroku CLI
If you don't have a Heroku account, create one. Install the Heroku CLI
Links to an external site. and say heroku login
to authenticate yourself to Heroku.
Check: heroku apps
should show a list of all the apps you've deployed on Heroku; the list might be empty.
Check everything
You can run our script that tries to verify that everything looks OK:
curl -sSL https://raw.githubusercontent.com/saasbook/courseware/master/verify-setup.sh | bash