5 ms·
How does that gemset stuff fit in with Bundler? It's much easier for us to just keep Gemfile in the git repo, run "bundle install", and then let Bundler worry a
by cmelbye 16y ago
How does that gemset stuff fit in with Bundler? It's much easier for us to just keep Gemfile in the git repo, run "bundle install", and then let Bundler worry about installing gems and keeping a clean gem environment.
- swatermasysk 16y agoYou can use gemsets and bundler together. Gemsets simply allow you to have an isolated environment. If you want to install the gems from multiple projects in the same gemset the choice is yours. Bundler just makes installing each project's dependencies easier. The pattern I started to use recently was to check in include an .rvm file with the same gemset name as the project. This way, I simply clone the project, install bundler, and then issue bundle install and my project is ready to go.
- psadauskas 16y agoYou can do this automatically with rvm ruby@gemset --create --rvmrc `--create` creates a gemset if it doesn't already exist, and `--rvmrc` makes a .rvmrc file to automatically switch to that gemset when you cd into the current directory. This makes it easy enough, that I have a gemset per application/project, and then use bundler to install the deps.
- swatermasysk 16y agoProbably just personal preference, but for me, I like to have the .rvmrc file in source control so that I don't have to think about setting it up. The first time I navigate to the directory the gemset is created. Still a good tip. Thanks.