zbiber
zbiber

Reputation: 143

How to properly isolate multiple rails applications in development (local machine)

Given we use a preferred flavour of a ruby version manager (RVM or Rbenv) the ruby gems are isolated per ruby version.

  1. Let's say we want to work on multiple applications locally (they are completely separate applications) and we want to use the same ruby version and the same rails version how do we properly isolate them and their gems? Are gemsets the (only) answer here? I mean if I have 5 applications with the same ruby version and I keep adding gems on all 5 fronts it's just a matter of time when one of the applications is ok with the latest stable gem version while one of the apps will still need to roll on an older version of the same gem due to legacy dependency or whatnot. How do you guys avoid this timebomb?

  2. What if we want to use the same ruby version on multiple apps but a different Rails version? Rails being 'just a gem' is the answer same as for the above?

Thanks.

Upvotes: 0

Views: 276

Answers (1)

Thomas
Thomas

Reputation: 1633

I'd recommend to use:

  • rbenv to handle multiple ruby versions on the same machine
  • bundler to define the dependencies of each application

Make sure to push .ruby_version, Gemfile and Gemfile.lock to make sure every is using the appropriate version of each gem...

Upvotes: 1

Related Questions