samureira
samureira

Reputation: 263

omniauth requires Ruby version >= 2.1.9. issue while installing gem file

Got an error after typing "bundle install" with some sort of issue with the Ruby version. Have been installed many-many gems so far and never got incompabilities with the Ruby version.

What's the best way to upgrade the Ruby version to get back on track with the "bundle install" without putting the app at "risk"?

Here it is what I have done:

1st - Added the twitter omniauth gem to my gemfile.

2nd - Created a omniauth.rb file in the app/config/initializers folder.

3rd - Typed the "bundle install" command and got the following error: "omniauth requires Ruby version >= 2.1.9."

Upvotes: 0

Views: 451

Answers (1)

greysteil
greysteil

Reputation: 906

Dependencies can specify a required_ruby_version in their .gemspec file. In this case, one of your sub-dependencies (omniauth - a sub-dependency of omniauth-oauth, which is in turn a sub-dependency of omniauth-twitter) has had such a requirement since v1.5.0.

To get a working install, you've got two options:

  1. Pin to an older version of omniauth, by adding gem "omniauth", "~> 1.4.2" to your Gemfile. This will ensure Bundler uses an older version of omniauth. However, that may cause conflicts with other gems, leaving you with the same problem - indeed, it's probably the reason Bundler didn't automatically try to install an older version.

  2. Update your Ruby version. If you have a .ruby-version file in your application, update the version there to 2.1.9. Similarly if your Gemfile has a ruby "..." line in it, update that too. You'll probably also need to install the new version of Ruby locally - with rbenv you can use $ rbenv install 2.1.9, or if you use RVM try $rvm install 2.1.9.

My recommendation would be option 2 (updating your Ruby version).

Upvotes: 0

Related Questions