Adding Postgres and ActiveRecord
Getting started - adding dependencies to your project
Gems are one of the best parts of Ruby development. Ruby offers the basic language and functionality to make your application, then anyone in the community can build on that foundation to do more specialized or complex things. When they build something that might be generally useful they can wrap all of that functionality up into a ‘gem’ or a library that you can add to your project. And there’s thousands of them. Which makes it fast, effective and quick to build in cool stuff into your project. For example:
Anyone in the community can add to or extend Ruby’s base functionality with a gem. And this extensibility is a really powerful part of the platform.
There’s a few ways to add gems to your project. The easiest is with bundler. To add that gem to your system type
gem install bundler
You should only need to do that once.
Then in your project folder, create a file called
Gemfile (with no extension). Start it with the following line then add a list of gems you want to use.
source 'https://rubygems.org' gem 'sinatra' gem 'json'
After you create it or make any changes to it, update and install the gems for your project by typing the following at the command prompt