1

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?

Ed de Almeida
  • 3,675
  • 4
  • 25
  • 57
  • what do you mean a private bundle. To rely strictly on the gems in a Gemfile you just run bundle exec. rvm use just sets a ruby version in the current shell – engineersmnky Aug 17 '16 at 20:33
  • A private bundle, @engineersmnky, means a directory to the gems of that specific application. Usually applications use a common bundle, i.e., a single directory for all applications. With this `rvm use ruby-2.3.1@myapp --ruby-version --create` I mentioned, I say to rvm to use a specific directory to that application. – Ed de Almeida Aug 17 '16 at 21:19
  • ``rvm`` and ``rbenv`` are incompatible and should not be installed on the same system. – zhon Aug 17 '16 at 23:51
  • I know that, @zhon. And this is the reason why I'm asking here. If it were not by this, I'd have just installed rbenv and found it out by myself. – Ed de Almeida Aug 18 '16 at 11:15
  • @engineersmnky Take a look at this, please: http://rubyofftherails.blogspot.com/2016/02/different-bundles-for-different.html – Ed de Almeida Aug 18 '16 at 15:00

1 Answers1

1

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.

Kavitha
  • 310
  • 2
  • 8