What I would like would be something like this:
gem 'rack', '1.3.3', '1.2.4'
So that when gems require different versions of rack, they are all appeased. Is this possible?
The Gemfile is where you specify which gems you want to use, and lets you specify which versions. The Gemfile. lock file is where Bundler records the exact versions that were installed. This way, when the same library/project is loaded on another machine, running bundle install will look at the Gemfile.
A Gemfile is a file that is created to describe the gem dependencies required to run a Ruby program. A Gemfile should always be placed in the root of the project directory.
run the command bundle install in your shell, once you have your Gemfile created. This command will look your Gemfile and install the relevant Gems on the indicated versions. The Gemfiles are installed because in your Gemfile you are pointing out the source where the gems can be downloaded from.
The correct way to update the version of a gem to a specific version is to specify the version you want in your Gemfile, then run bundle install . As for why your command line was failing, there is no -version option.
You can set an intervall of allowed gems
gem 'rack', '<1.3.3', '>1.2.4'
It will load the most actual one inside the selected intervall.
But I don't think you can require different gem versions. If a gem would be loaded in different versions, each class and module must get it own namespace to avoid to overwrite the methods of the gem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With