We use cookies to offer you a better browsing experience, analyze site traffic, and serve targeted advertisements. If you continue to use this site, you consent to our use of cookies.
Accept

Getting started

Wiktor Plaga
Published: 
December 8, 2019

This is a step by step guide to creating new Ruby on Rails projects using Hix on Rails application template.

Follow the steps below to quickly get the fully-featured Ruby on Rails application ready for the business logic in no time.

Let's get started.

Prerequisites

Before launching the installer, please follow the steps below.

  1. Purchase the Hix on Rails and save your access key, or prepare the previously purchased one - you can always find it on your account page, in the Orders tab.
  2. Install the latest Ruby version, which is currently 2.6.5.
  3. Install the latest Ruby on Rails version, which is currently 6.0.2.1.
  4. Install the (ideally) latest MySQL or PostgreSQL database with a user able to read and write to it.
  5. Create a new git remote repository and prepare its HTTPS/SSH link.
  6. Install Redis if you are going to use it.
  7. Create a new project in the application monitoring tool of your choice
  8. Setup Coveralls if you are going to use it.
  9. In the command line, navigate to the directory that you want your code to reside.

For your convenience, Hix on Rails recognizes the environment variable HIX_ON_RAILS_ACCESS_KEY, so if you don't want to copy and paste it every time you run the installer, you can export it from your command-line profile.

Open your shell script file for editing:

$ vi ~/.zshrc
# or
$ vi ~/.bashrc
# or
$ vi ~/.bash_profile

and paste the following code, with previously purchased access key.

export HIX_ON_RAILS_ACCESS_KEY="YOUR_HIX_ON_RAILS_ACCESS_KEY"

Save the file and in the same command line, run

$ source ~/.zshrc
# or
$ source ~/.bashrc

Hix on Rails respects all possible rails new configuration flags. For example, if you pass it the --database postgresql flag, you won't be asked to select the database in the configuration wizard.

rails new project_name -m https://hixonrails.com/template.rb

After the initial Ruby on Rails installation run, the Hix on Rails wizard starts. All you need to do is select and/or input previously prepared prerequisites when asked for.

If you decided to use Coveralls, an additional setup compatible with the Continuous Integration provider of your choice is required - follow the instructions for services officially supported by Coveralls.

What just happened?

Your new Ruby on Rails project was set up for the business logic to be written. No more development configuration required.

Simply enter the newly-created directory with your Ruby on Rails project and run rails server.

Depending on what you've chosen, a lot of different, good stuff happened. Here's the summary of possible combinations that are not obvious from the options selected.

No matter what you chose, the dotenv-rails gem was installed, and the .env file was created, with defined variables related to your chosen setup.

The Ruby on Rails .gitignore file was created, based on the most popular template available.

If you chose to use RuboCop, the full suite of RuboCop gems was installed and configured in the .rubocop.yml file: rubocop, rubocop-performance, rubocop-rails. If you chose RSpec, the rubocop-rspec gem was installed, too.

If you chose Sidekiq and RSpec, the rspec-sidekiq gem was installed for testing your async workers.

If you chose Sidekiq with Sentry, there is an app/workers/sentry_worker.rb worker dedicated to sending the exceptions reports to Sentry asynchronously. It has its own default priority Sidekiq queue, called :sentry.

Conclusion

Ruby on Rails project configuration is boring, yet crucial for the best development and maintenance experience.

Gems and tools configuration is not something that anybody knows (or wants to know) by heart, hence it is easy to forget about stuff and regret it later.

Hix on Rails aims to automate as much of the process as possible. Thank you for using it.

If you encountered any problems or have an amazing idea for improvement of Hix on Rails, please contact us on support@hixonrails.com.

Enjoy.

Hix on Rails Ruby on Rails generator

Automate this with Hix

Hix is a Ruby on Rails Application setup tool that automates tasks like this.
Learn More