Get Set Up!
- Due Jan 28 by 11:59pm
- Points 10
- Submitting an external tool
- Available Jan 19 at 12am - Apr 24 at 11:59pm 3 months
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
rvm
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 and whose output you can submit as evidence that your setup works.
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
https://www.hanselman.com/blog/ruby-on-rails-on-windows-is-not-just-possible-its-fabulous-using-wsl2-and-vs-code
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 10 or 11): The Mac terminal runs bash by default. You may want to install Homebrew for managing other packages later.
- Local (Windows): We recommend using Git for Windows, 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. 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 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.
Check: ssh -T git@github.com
should give you a happy message.
rvm (Ruby Version Manager), Ruby ~>2, Rails ~>6
Different Ruby projects may require different Ruby 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, then install Ruby 2.6.x or 2.7.x for any x of your choosing (who knows which one you'll actually need later, this is to make sure the toolchain works). Finally, switch to the just-installed Ruby with rvm use
, then gem install rails, which should give you a version of 6.0 or later.
Check: rvm list
should show a list of installed Rubies. rails -v
should show Rails 6.1.x
.
node and npm
Node? Really? Yes. Capybara may use PhantomJS as a headless browser for JavaScript testing, some asset pipelines require Node and some packages to be running…
The installers for Mac/Windows/Linux will install both Node and NPM, the Node Package Manager, which we'll use later.
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 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