🚀Quickstart

After accepting the Github Invite, Follow these steps to quickly set up your new Ruby on Rails application using the Lightning Rails boilerplate.

If you doubt you have the correct Ruby on Rails Setup, you can refer to Le Wagon setup guide, one of the most complete.

Step 1: Clone the Repository

First, clone the Lightning Rails repository to your local machine. Open your terminal and run:

gh repo clone LightningRails/lightning-rails mysupercoolapp

If you are getting ERROR: Repository not found. fatal: Could not read from remote repository.

Make sure that you have accepted the Github Invitation on your email. Or that the github account in your terminal is the same you signed up with.

This creates a clone of the lightning rails repo, which is great! But we only want the source code, not the GitHub origin or all your code would be pushed to the Source repo 🫣

Let's fix it by removing the Origin and creating a new one...

Step 2: Remove and change the remote

After cloning the repository, navigate to the project directory:

cd mysupercoolapp

First, let's remove the source code remote in your terminal:

git remote remove origin

Then we will create a new repository in our GitHub account and assign the current directory as source.

🚨 Very important to add --private flag when creating the GitHub repo for your project (Your license could be revoked if lightning-rails source code is leaked through a public repository).

 gh repo create --private --source=.

Commit and push your first commit

ga .
gc -m "First commit"
git push origin master
gh repo view -w

Et Voila! You officially have Lightning rails boilerplate on your own GitHub account. Now let's continue with the setup.

Step 3: Install Dependencies

Next, install the necessary dependencies. Run the following command:

bundle install

Step 4: Set Up the Database

Let's start with a fresh database

rails db:drop
rails db:create

Step 5: Run Migrations

Finally, run the migrations to set up your database schema:

rails db:migrate

You should see a few migrations for User Authentication and Stripe payments management.

Reset the credentials file

The latest versions of Rails encrypt credentials directly in your code. When you clone this project, the original encrypted credentials file is also cloned. However, because it was created on LightningRails' computer, you won't be able to access it. To fix this, delete the cloned credentials file and let Rails automatically generate a new one by running the following command:

rm -rf config/credentials.yml.enc 

Step 6: Start the Server 🚀

Now you are ready to start your development server:

bin/dev

Last updated