Answer the question
In order to leave comments, you need to log in
How to create an isolated environment with dependencies for a Ruby/Rails project?
I would like to have a set of gems for a specific project without using solutions like Docker.
Found out that there are gemsets in RVM. Bundler also offers to set the path for storing dependencies.
But what if Rails is also used?
If you install Rails globally and then create a project with rails new
, then bundle install
Rails will be installed again, but now locally. I don't like this double installation and confusion about calling - bundle exec rails
or rails
.
Tried starting project initialization with bundle init
, bundle add rails
and rails new
. So a conflict over the presence of a Gemfile arises because the last command also creates it.
Please tell me which way is correct?
Answer the question
In order to leave comments, you need to log in
In the terminal: create a gemset, make it active. Write a Gemfile with the required gems. Execute the bundle command.
Optional gemsets in RVM.
blockquote>Install your dependencies, even gems that are already installed to your system gems, to a location other than your system's gem repository. In this case, install them to vendor/bundle.
$ bundle install --path vendor/bundle
https://bundler.io/bundle_install.html
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question