Search code examples
ruby-on-railsrubybundler

prevent beta gems from being installed with gemfile constraint


in a gemfile, with the following gem constraint:

gem 'testgem', '>= 1.2.0'

is it possible to prevent a gem '1.2.6-beta' from being installed without changing the constrant?


Solution

  • try gem 'testgem', '~>1.2.0' or gem 'testgem', '1.2.0'

    using ~>1.2.0 will only use the latest version from the 1.2.x series and not 2.0

    for more info https://guides.rubygems.org/patterns/#pessimistic_version_constraint