In this tutorial, you will implement the backend for a Hackernews clone that has the following features:
It’s time for you to create your project!
First, you’ll need to have Ruby installed on your system. If that’s not the case, make sure to install it now. This tutorial requires version 2.3.0 or higher.
If you see the following error:
LoadError: Error loading the 'sqlite3' Active Record adapter. Missing a gem it depends on? can't activate sqlite3 (~> 1.3.6), already activated sqlite3-1.4.0. Make sure all dependencies are added to Gemfile.`. Go to and replace the SQLite version:
Open Gemfile
and change the following line:
And run:
bundle update --source=sqlite
bundle exec rails db:create
This will install and start a new Ruby On Rails project. When you visit http://localhost:3000 in a browser, you should see:
Now, let’s add GraphQL to the server. First, stop the server.
Usually you don’t need to restart Ruby On Rails, but when you are adding new gems(libraries), this is required.
This will install all the necessary dependencies you need to get started with GraphQL and Ruby.