There is a Rails project. I want to use gems for formatting output in the console, but I don’t want it to get into repositories. How to do this without changing the files each time before committing?

  • And where is the reluctance to add it to the Gemfile? - Vasilisa
  • The project is alien, the developers do not want to see in it the "left" gems. In addition, it slightly changes the behavior of the application. It seems to be a common situation, but for some reason I cannot find a solution. - MrAak
  • And what kind of heme? So it will be easier to help, I think. - Vasilisa

1 answer 1

In the terminal, run gem install gemname .

If you use rvm, then the gem you need will be installed in the current gemset. If you need to install it for all gemsets of the current version of Ruby - rvm @global do gem install gemname .

I never worked with rbenv, so I don’t know about its features.

  • I use rvm. It seems like I tried it, without bundle install, the gem did not work. And what about the settings that will change the application files, for example, you need to register reuqire. - MrAak
  • Another option is not to commit lines with these changes, I have had a letter in one project in Gemfile & Gemfile.lock for a year now with a letter_opener. Do you do commits via the terminal or through a GUI? - Vasilisa
  • Through the terminal, gem awesome_print. This is how I am interested in the general approach, how to act in such a situation. - MrAak
  • one
    @MrAak, awesome_print I also did not want to work without specifying in the Gemfile. I decided this pry-rails, it gives a beautiful conclusion in the console and wonderful debugging options through binding.pry . Actually, you add it to the gemfile and you cannot commit it, but through the terminal it is inconvenient. I use GitHub Desktop, if you don’t have Mac, I recommend GitKraken - Vasilisa
  • one
    Well, the general approach is in my answer :) - Vasilisa