简体   繁体   中英

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?

  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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM