Alexander Ulitin
Alexander Ulitin

Reputation: 1190

How to force gem version in rails application?

I need to use addressable 2.2.4 gem, but I have 2.2.5 version (because of an issue discussed here: https://github.com/sporkmonger/addressable/pull/33). I tried:

source 'http://rubygems.org'
source 'http://gems.github.com'
gem "addresable", "2.2.4"

bundle install

and get Could not find gem 'adressable (= 2.2.4, runtime)' in any of the gem sources listed in your Gemfile.

If I install/uninstall gem manually by

sudo gem install addressable -v 2.2.4
sudo gem uninstall addressable -v 2.2.5

I get the same error.

So, how can I force 2.2.4 version for my app?

Upvotes: 2

Views: 5303

Answers (1)

coreyward
coreyward

Reputation: 80041

  1. You've misspelled "addressable" in your gem line.
  2. Your bundle might be locked at 2.2.5 — try running bundle update. It's counter-intuitive, but it'll rebuild your Gemfile.lock with the specified version.
  3. You don't need gems.github.com as a source anymore — they quit building it and recommend rubygems.org.

Upvotes: 8

Related Questions