Ruby on Rails Configuration Options
Walk through the various configuration options that you have when building out Ruby on Rails applications and running the new application generator.
Guide Tasks
  • Read Tutorial
  • Watch Guide Video
Video locked
This video is viewable to users with a Bottega Bootcamp license

To get a firm foundation, let's explore some customization options.

First, type this:

rails new --help

This command will list out all the available options, and if you look at this list, a lot of it is self-explanatory. Don't worry too much about this list because 99 percent of it will never be used.

For example,

-r, [--ruby=PATH] is used to get the path to the Ruby binary of your choice.

I've been working on Rails for quite some time now, and have never found the need to use this option. There are many such options, so we will focus only on those options that we are likely to use often.

Database setting

I commonly use the database setting to change databases, especially from SQLite to postgresql.

-d, [--database=DATABASE]

Skip Unit Testing

Another setting I use frequently is the skip unit testing option because I like to use RSpec for my testing library. Also, it can get quite confusing to run the same code through two different unit tests, and this is why I skip it.

-T, [--skip-test-unit]

Skip Turbolinks

Turbolinks makes every Rails application function like a single-page application.

Though turbolinks may be great for some applications, it's not ideal when you're doing a lot of custom JavaScript work as it can put in some helper methods to skip the turbolinks call. So, it just saves some time to skip over turbolinks.

-J, [--skip-turbolinks]

If you don't plan to use a lot of JavaScript, then it's fine to have Turbolinks

Now, to use the above settings you would run the command:

rails new taski --database=postgresql  --skip-test-unit  --skip-turbolinks

If you run this command, the database would be set to postgresql, it will skip out-of-the-box unit testing and it will not place turbolinks in the JavaScript file so that we can create our own JavaScript models and tools.

Though you will not be using the above settings for the application that we are going to create, I want you to know the different custom options available, so you can implement them when needed.