Strategies for custom gems in rails console


I often find myself prototyping / debugging code in the rails console. I use the ‘’ file to add custom gems (think rbvmomi) so that they are accessible inside the rails console. I’ve noticed that once the ‘’ has been used then the ‘Gemfile.lock’ gets updated with specific versions. Later if I upgrade one of those gems (and remove the old version) that is being referenced in the ‘’ I end up with a version mismatch and then the app / console will not start. I’ve come up with a couple of options, but I was wondering what other strategies people might have for this.

  • I can get around that if I place specific versions in the ‘’, but if I upgrade a gem and forget then I’ve got issues.
  • Lately I’ve been getting around that by restoring the original Gemfile.lock after upgrades and letting the app / console place the versions back in.