CollectionBuilder Documentation has moved!
Please visit:
https://collectionbuilder.github.io/cb-docs/
Content on this page is out of date.
Install Software
GH users: No software needs to be installed to work with CollectionBuilder-gh. All actions and edits can be accomplished through the web interface on GitHub.com. However, some GH users might enjoy working with the tool on their local desktop using a text editor and GitHub Desktop. In that case, follow the instructions below to install the required software.
To get started editing code, managing your project, and building websites with CollectionBuilder-CONTENTdm you will need:
- Text Editor
- Git (version control system)
- Ruby (programming language)
- Jekyll (static web site generator)
Installing software on your computer can be the biggest hurdle to getting started with CollectionBuilder. Our advice is to stick with it. Having your local “development environment” for a Jekyll-based project set up will be rewarding, allowing you to edit code and see how the website changes right on your laptop.
Troubleshooting: We’ve tried to anticipate problems you might have in the documentation and the Lib-Static How-To files we link to. If those options fail, try Google. If Google doesn’t help, email Evan (he’s probably not doing anything).
1. Get a Text Editor
The CollectionBuilder team suggests these open-source, cross platform options for text editors:
- Visual Studio Code (VS Code)
- Atom
If you don’t have a text editor installed, download one of the above and use their wizard to install with the default options on your computer.
We mostly use Visual Studio Code, so if you don’t know which one to pick, go ahead and get that one. For additional assistance, see our guides for How to Install and Set Up Visual Studio Code and How to Install and Set Up Atom
Configuring Visual Studio Code (Optional)
Visual Studio Code (VS Code) has a tremendous number of extensions that can be added to enhance it’s functionality. We recommend Rainbow CSV, which will help you better read the CSVs within CollectionBuilder, and Code Spell Checker, which will check your spelling.
VS Code is incredibly customizable via its settings as well.
To configure the editor, click the gear icon in the bottom left corner of the VSCode window and choose Settings.
The searchable Settings pane has information about all the configuration options.
When you first install VS Code, the default settings can be distracting, so don’t be afraid to turn things off!
2. Install Git and GitHub Desktop
To manage the code and collaborate on developing your CollectionBuilder project, you need a version control system to keep everything organized.
GitHub is a cloud Git repository hosting service with features for collaboration and project management. Think of it as Google Drive for code with super robust “track changes” baked in.
GitHub is the most popular platform for developing and sharing code – from enterprise software, to hands-on learning, to academic projects. Thus, it is great to become familiar with the platform so that you can take part in this community.
Code for your CollectionBuilder project will be stored on GitHub. To connect locally, you’ll need to install Git (the version control software that powers GitHub) and, optionally, GitHub Desktop (a handy visual way to use Git) on your local computer.
Install Git
- Windows:
- Install Git for Windows using the default options, except when setup asks you to choose the default editor used by Git, select “Use the Nano editor by default”. This will give you Git, Git Bash, and Git GUI. Git Bash is a terminal that lets you use UNIX style commands and utilities on Windows, and will be used as your default terminal when working with Jekyll.
- Mac:
- Mac systems will require the “Xcode Command Line Tools” installed, so open a terminal (to find your terminal search for “terminal” in your Spotlight), type in the command
xcode-select --install
, and follow the prompts. After the install finishes, try typinggit --version
. If you want a newer version of Git, download the official Mac git installer.
- Mac systems will require the “Xcode Command Line Tools” installed, so open a terminal (to find your terminal search for “terminal” in your Spotlight), type in the command
- Linux:
- Install from your distribution’s software center or package manager (for Ubuntu
sudo apt install git
).
- Install from your distribution’s software center or package manager (for Ubuntu
Configure Git
Once Git is installed, we need to configure your information, so that it can connect with your GitHub account. Since Git is a command line application, we will need to open a terminal to give it commands. On Windows, search for “Git Bash.” On Mac and Linux, search for “terminal.” Once you have a terminal open, we will need to give it two commands.
First, set your user name so that it matches your GitHub user name:
git config --global user.name "User Name"
Second, set your email so that it matches your GitHub account’s email:
git config --global user.email "myemail@gmail.com"
Optionally, set your default command line text editor for use with git. This editor may pop up in your terminal during some command line git operations that require a message (it is not your normal code editor such as VS Code). By default it is set to Vim, which can be very confusing if unexpected. For ease of use, we generally suggest using Nano editor:
git config --global core.editor "nano -w"
Your email and user name is recorded with every commit. This helps ensure integrity and authenticity of the history. Most people keep their email public. However, if you are concerned about privacy, check GitHub’s tips on how to set up your email. GitHub now provides a no-reply email address that can be accessed via your email settings on GitHub.com.
Install GitHub Desktop
If you are new to using Git and GitHub, we also recommend you install GitHub Desktop using the default options. This will help you visualize and implement some of the git processes that can seem non-intuitive.
GitHub Desktop is available on Windows and Mac only, however, there are a variety of other GUI app for working with Git available, including “git-gui” that is built in to every default Git install. Many users will find they complete most Git commands using integrations built into their text editors such as VS Code or Atom instead.
3. Install Ruby
Ruby is a programming language popular with web applications. You do not need to know anything about Ruby to use CollectionBuilder, but you do need it to run Jekyll on your system!
Jekyll requires a Ruby version 2.5.0 or greater.
Ruby on Windows
Use RubyInstaller for Windows.
-
First, download the suggested stable version “WITH DEVKIT” (as of this writing, Ruby+Devkit 2.7.X (x64)) and double click to install. Use the install defaults, but make sure “Add Ruby executables to your PATH” is checked. On the final step, ensure the box to start the MSYS2 DevKit is checked.
-
Second, the installer will automatically open a terminal window with options to install MSYS2 DevKit components. Choose option 3, “MSYS2 and MINGW development toolchain”, or simply press ENTER to install all the necessary dependencies. The installer will proceed through a bunch of steps outputting a bunch of text in the terminal window – eventually, this will conclude and you should see a message with success in it. If the window doesn’t close, press Enter again or manually close it. (The installer can be restarted by typing
ridk install
into a command prompt) -
Having trouble? Need more detail? See How to Install Ruby on Windows for help.
Ruby on Mac
Installing Ruby on Mac can be difficult, but don’t be deterred! If the method below doesn’t work for you check out How to Install Ruby on a Mac for more detail and other options.
OS X has a version of Ruby installed by default, but recommended practice is to set up a separate Ruby development environment. To do this, follow the instructions below, which outline the steps to install Ruby using rbenv.
Get the Xcode Command Line Tools First
- Ensure you have Xcode Command Line Tools, so that you can work with Ruby (and Git, etc.).
- To do this, open your terminal by clicking
Command (⌘) + Spacebar
, typingterminal
into the spotlight box that appears, and pressingEnter
. - Type
xcode-select --install
into the terminal window and pressEnter
to start the installer. Note: this may take some time to install.
Use rbenv to Install Ruby
- Install Homebrew
- You’ll need to use Homebrew to install rbenv. To install Homebrew, follow these steps:
- Open the Homebrew webpage in your browser.
- Open your terminal by clicking
Command (⌘) + Spacebar
, typingterminal
into the spotlight box that appears, and pressingEnter
. - Once inside your terminal, copy the script in the box underneath “Install Homebrew” on the Homebrew webpage. Paste this script you just copied into the terminal prompt and press
Enter
. - You’ll then be prompted to press
Enter
once more to continue the install.
- You’ll need to use Homebrew to install rbenv. To install Homebrew, follow these steps:
- Install rbenv
- Copy and paste the command
brew install rbenv
into your terminal prompt and pressEnter
. This installation might take a while. - Once rbenv has been installed, copy and paste
rbenv init
into the terminal prompt and pressEnter
. - Depending on whether you are using a zsh or bash shell, follow the appropriate instructions below to finish the rbenv installation.
- Copy and paste the command
If using the zsh environment:
After you run the command rbenv init
, you will get this message:
# Load rbenv automatically by appending
# the following to ~/.zshrc:
eval "$(rbenv init -)"
To do this, follow these instructions:
- Open your zsh configuration file with the terminal’s text editor, nano, by copying and pasting
nano ~/.zshrc
into the terminal prompt and pressingEnter
. - Your terminal should switch to a nano text editor screen that includes a path to
.zshrc
at the top. - Use the down arrow on your keyboard to move to the end of the text file.
- Paste
eval "$(rbenv init -)"
at the end of the file. - Press
Control
+x
to exit and save the file. You’ll see a message at the bottom of your screen asking whether you want to save the file. - Press the
y
key on your keyboard to specify yes, you want to save. - Press
Enter
to finish saving the file and exit nano.
If using the bash environment:
The program will ask you to edit your bash profile. To do this, follow these instructions:
- Open your bash profile with the terminal’s text editor, nano, by copying and pasting
nano ~/.bash_profile
into the terminal prompt and pressingEnter
. - Your terminal should switch to a nano text editor screen that includes a path to .bash_profile at the top.
- Use the down arrow on your keyboard to move to the end of the text file.
- Paste
eval "$(rbenv init -)"
at the end of the profile’s text. - Press
Control
+x
to exit and save the file. You’ll see a message at the bottom of your screen asking whether you want to save the file. - Press the
y
key on your keyboard to specify yes, you want to save. - Press
Enter
to finish saving the file and exit nano.
Install Ruby
- Back in your terminal, install the latest version of ruby by copy/pasting or writing,
rbenv install 2.7.3
and pressingEnter
.
Note: 2.7.3 is the latest solid version as of this writing; if you are reading this past Fall 2020, you may want to check the “Stable Releases” section on the download Ruby page and install the latest stable version.
- Now let’s set that version as your global Ruby version by entering
rbenv global 2.7.3
into the terminal prompt and pressingEnter
. - Finally, we’re going to rehash, just to be safe: copy and paste the command
rbenv rehash
into your prompt and pressingEnter
. - Now let’s see if that worked.
- Quit your terminal by right clicking (
Control + click
) its icon in your applications menu, and selectingQuit
from the options that appear. - Then reopen your terminal by clicking
Command (⌘) + Spacebar
, typingterminal
into the spotlight box that appears, and pressingEnter
. - Type
ruby -v
into the terminal prompt, and pressEnter
. - If your terminal indicates that you have Ruby 2.7.0 or higher installed, you’ve done it!
- Quit your terminal by right clicking (
If this installation did not work, see our more detailed guide, How to Install Ruby on a Mac, check out the Jekyll install on mac docs, or try Googling any error message or other hindrance you encountered.
Ruby on Linux
Ruby can be installed via most distro’s repositories or snap package, however, it is more up-to-date and best practice to use a version manager such as RVM or rbenv.
- First, ensure you have build tools Make and GCC installed (on Ubuntu get them with
sudo apt install build-essential
). - Follow the instructions on RVM install or rbenv notes.
- For more information and other methods, see How to Install Ruby on Linux.
4. Install Jekyll
Finally, we get to Jekyll! Jekyll is a static site generator that uses templates and data to build out websites. It is a very popular tool used by tiny and giant web site projects.
Jekyll is a Gem, a software package installed via Ruby’s management system called RubyGems (similar to Python’s Pip). Gem is a command line application, so again we will open a terminal to give it commands. Once you have a terminal open, type in the command:
gem install jekyll bundler
This will take awhile as the Gem installs all the dependencies and builds extensions (on Windows it may appear as if nothing is happening, be patient!).
Debugging Note: if you have Ruby version 3.0+ and Jekyll version 4.2.0 (or less), when using Jekyll you will encounter an error in your terminal including ‘cannot load such file – webrick (LoadError)’.
Please try installing webrick globally using gem install webrick
or adding it to your project Gemfile using bundle add webrick
in the project directory.
This issue will be resolved in future Jekyll versions.
Your dev environment is ready! Give yourself a hand!
« Introduction Back to Top Set Up Git »