The repositories we use in class are deployed using GitHub Pages, so you don't need to do any local serving. But, if you'd like to see what your changes look like locally before they actually are pushed to the default branch, you can.
The process may vary in difficulty based on your operating system, and we've found it's a smoother experience in macOS. We're working to improve these instructions for all platforms, so please let us know if you have any recommendations.
This script uses Ruby. If you don't already have Ruby installed locally, you should follow the detailed instructions on ruby-lang.org. In short:
- On Windows, you can do so from https://rubyinstaller.org, select version
2.3.3
, ensure you select to "Add Ruby executables to your PATH" during setup, and restart your machine. - If you need to install Ruby on a Mac, install Homebrew and then run
brew install ruby
.
- Using a Bash-like terminal,
cd
to the class repository locally. - Check that Ruby is installed.
- On your command line, run
ruby -v
andgem -v
- If you see a version
2.3.x
for Ruby, you're 👍. If not, refer to directions above. ☝️
- On your command line, run
- If there is a
Gemfile.lock
file, delete it. - Install bundler:
gem install bundler
. - Type
script/setup
to install all the proper gems. - Then, type
script/server
. - If all goes well, your terminal will tell you where to access your site in your browser. 🎉