Skip to content

Instantly share code, notes, and snippets.

@theflow
Last active May 11, 2018 10:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save theflow/edd84a5318738b59f65cf42eaaede9f3 to your computer and use it in GitHub Desktop.
Save theflow/edd84a5318738b59f65cf42eaaede9f3 to your computer and use it in GitHub Desktop.
Bundler unwanted downgrades

Environment

Bundler       1.16.1
  Platforms   ruby, x86_64-darwin-17
Ruby          2.4.3p205 (2017-12-14 revision 61247) [x86_64-darwin17]
  Full Path   /Users/flo/.rbenv/versions/2.4.3/bin/ruby
  Config Dir  /Users/flo/.rbenv/versions/2.4.3/etc
RubyGems      2.6.14
  Gem Home    /Users/flo/.rbenv/versions/2.4.3/lib/ruby/gems/2.4.0
  Gem Path    /Users/flo/.gem/ruby/2.4.0:/Users/flo/.rbenv/versions/2.4.3/lib/ruby/gems/2.4.0
  User Path   /Users/flo/.gem/ruby/2.4.0
  Bin Dir     /Users/flo/.rbenv/versions/2.4.3/bin
Tools         
  Git         2.13.1
  RVM         not installed
  rbenv       rbenv 1.1.0

  chruby      not installed
#!/bin/bash
set -ex
mkdir -p /tmp/repro-6529
cd /tmp/repro-6529
bundle --version
cat > Gemfile <<EOF
source 'https://rubygems.org'
gem 'mongo'
gem 'mongoid'
gem 'carrierwave'
gem 'carrierwave-mongoid'
EOF
cat > Gemfile.lock <<EOF
GEM
remote: https://rubygems.org/
specs:
activemodel (5.2.0)
activesupport (= 5.2.0)
activesupport (5.2.0)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
bson (4.3.0)
carrierwave (1.2.2)
activemodel (>= 4.0.0)
activesupport (>= 4.0.0)
mime-types (>= 1.16)
carrierwave-mongoid (1.0.0)
carrierwave (>= 0.8, < 1.3)
mongoid (>= 3.0, < 7.0)
mongoid-grid_fs (>= 1.3, < 3.0)
concurrent-ruby (1.0.5)
i18n (1.0.1)
concurrent-ruby (~> 1.0)
mime-types (3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2016.0521)
minitest (5.11.3)
mongo (2.5.3)
bson (>= 4.3.0, < 5.0.0)
mongoid (6.4.1)
activemodel (>= 5.1, < 6.0.0)
mongo (>= 2.5.1, < 3.0.0)
mongoid-grid_fs (2.3.0)
mime-types (>= 1.0, < 4.0)
mongoid (>= 3.0, < 7.0)
thread_safe (0.3.6)
tzinfo (1.2.5)
thread_safe (~> 0.1)
PLATFORMS
ruby
DEPENDENCIES
carrierwave
carrierwave-mongoid
mongo
mongoid
BUNDLED WITH
1.16.1
EOF
bundle install
# Expected behaviour: should not downgrade carrierwave-mongoid
# Observed behaviour: downgrades carrierwave-mongoid to an really old version
BUNDLE_ONLY_UPDATE_TO_NEWER_VERSIONS=true bundle update mongoid carrierwave-mongoid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment