JHero23
JHero23

Reputation: 159

RBenv - creating a gemset

Its a pretty straightforward question, so I'm trying to learn Ruby on Rails, I am following a tutorial, however they're saying that because they used RVM for the longest, they recommend to use RVM.

I have been using RBenv because the WSL installation recommends me to do so, and I'm confused on a part of the tutorial where it says rvm use --create ruby-version@project, that tells me that they're creating a gemset for project, but they're using rvm. I don't know what the equivalent command is for RBenv.

I am currently using Bundler 2.

My question is what is the equivalent command to rvm use --create ruby-version@project? And can you give me an example?

Please and thank you.

Upvotes: 1

Views: 6938

Answers (1)

Yury Matusevich
Yury Matusevich

Reputation: 998

By default rbenv does not support gemsets.

You need to set up this plugin to work with gemsets.

# Set up a default gemset for your project.
# Also will create a `.rbenv-gemsets` file in the current directory.
# NOTE: this will create the gemset under the current ruby version.
rbenv gemset init

# Alternatively, you can provide `rbenv gemset init` with the name of a gemset:
rbenv gemset init [gemset]

# To create a gemset under a specific ruby version:
rbenv gemset create [version] [gemset]

# You can list the existing gemsets by using the following command:
# This should include the most recent gemset you just created.
rbenv gemset list

# You can delete a gemset with the following command:
rbenv gemset delete [version] [gemset]

Upvotes: 3

Related Questions