How to change the default gem file created by the "rails new" command?

I recently had a problem when I have to add the following to my gemfile:

gem 'execjs' gem 'therubyracer' 

I have to do this to avoid the javascript runtime error that occurs when the rails server starts. I would like this modification to be added to all the new gemfiles created with the new rails command.

+6
source share
2 answers

You are looking for application templates .

+6
source

Rails Documentation for Application Templates

If you want to set up a personalized individual application, rather than have a hard template, a really good option is Rails Composer . This tells you about common gems during customization, and it nails many more common gems.

Finally, if you like Rails Composer but want to be able to reuse application templates, check out Rails Apps Composer . I haven't looked at it too much, but it looks like you get more flexibility, doing most of the hard work for you.

+3
source

Source: https://habr.com/ru/post/903996/


All Articles