“bundle install” error with installation of ruby gem

Hi

I am trying to run “bundle install” to install rubygem ‘devise’ from my GemFile. I get the following error:

/home/proteus/.rbenv/versions/3.2.7/lib/ruby/site_ruby/3.2.0/rubygems/requirement.rb:107:in `parse’: Illformed requirement [“-> 4.9>=4.9.4”] (Gem::Requirement::BadRequirementError)

The code I am using to install the rubygem inside my GemFile is:

gem ‘devise’, ‘~> 4.9’, ‘>= 4.9.4’

This line is taken directly from the rubygem website (devise | RubyGems.org | your community gem host).

What is causing the error?

The command might be wrong, it seems like it’s indicating that you can use one or the other, but you can try with:

gem ‘devise’, ‘~> 4.9’

or

gem ‘devise’, ‘>= 4.9.4’

Also, you can alternatively use the command:

bundle add devise

That will get it added to the Gemfile automatically.