Search code examples
rubyrvmrbenvrbenv-gemset

rbenv: how may I create a private bundle for an application?


I've never used rbenv, but now I need to know something about it and Google failed me.

When I'm using rvm and I want to create a private bundle for an application (say myapp), with Ruby 2.3.1, for instance, I just issue the command

rvm use ruby-2.3.1@myapp --ruby-version --create

This will create two files in the application root directory: .ruby-version and .ruby-gemset, as well as create the directory for the gems under /home/username/.rvm/.

What I would like to know is: How may I achieve the same with rbenv?


Solution

  • It's been a while since this was posted, but answering it in case others have the same question.

    Brief answer: Use bundler or rbenv-gemset plugin

    Sharing more context on the general best practice:

    rbenv is used only to pick ruby versions by setting an environment variable

    Typically, it is used along with bundler and ruby-build. Bundler is an alternative to rvm's gemsets and manages gems. ruby-build plugin helps in installing different versions of rubies and automating it.