lcreid / rails-5-jade

Rails 5 with Jekyll and Node on Ubuntu 18.04
MIT License
29 stars 3 forks source link

Stricter versioning of gems. #26

Closed lcreid closed 5 years ago

lcreid commented 5 years ago

In the case of Bundler, leaving the gem version too flexible has caused quite a bit of grief lately, due to changes in the binstubs generated by Bundler. Since the binstubs are generated on the development box, care must be taken to ensure that Bundler is the same version on the development box as on the production box (or UAT or any other environment).

This may well apply to some of the other gems as well.

lcreid commented 5 years ago

Bundler doesn't get installed separately. We get whichever bundler comes from Rails. The trick has been that we've been creeping up in Rails versions in the Vagrant boxes, and not on the server. It really looks like, ultimately, we need rbenv or containers, or a VM per application, or to keep the server and apps migrating forward with the right versions.

I wonder if including ./bin in the PATH would help?

lcreid commented 5 years ago

There are instructions in the README.md to manually install an up-to-date version of Bundler before doing anything else. This sounds suspiciously like some kind of superstitious attempt to address the Bundler version problem.

lcreid commented 5 years ago

To add to the excitement, Ruby 2.6 includes Bundler.

lcreid commented 5 years ago

I'm increasingly convinced that the only gem we should install is Bundler. (Maybe Rubocop, but I'd have to think about it.) Bundler has to be the same as the one on the production box, or you run the risk of binstubs not working, and you can even get to the point where you can't install or change anything.

The time it takes to install the Rails gem is actually small enough that the value of adding it to the base box is questionable. Considering that the base box with installed Rails adds to the version problems, it's even more relevant.

lcreid commented 5 years ago

I did fix the Bundler version to the one used on our 16.04 server, in version 5.1.

lcreid commented 5 years ago

One needs some version of Rails installed, for when one wants to do rails new. But I'm finding that installing only Bundler and Rails is the right way to go.