mkristian / ruby-maven

repo moved to
https://github.com/takari/ruby-maven
MIT License
28 stars 7 forks source link

Wrong scope resolution for transitive gem #4

Closed ddossot closed 10 years ago

ddossot commented 10 years ago

With the following Gemfile ...

source 'https://rubygems.org'
ruby '1.9.3', engine: 'jruby', engine_version: '1.7.1'

gem 'rack',                           '~> 1.5.2'
gem 'activerecord',                   '~> 4.1.1'
gem 'activerecord-jdbcmysql-adapter', '~> 1.3.7'
gem 'newrelic_rpm'
gem 'aws-sdk',                        '~> 1.40.2'
gem 'grape',                          '~> 0.7.0'

group :test do
  gem 'codeclimate-test-reporter',                  require: false
  gem 'rspec-mocks',                 '~> 2.14.1'
  gem 'rspec',                       '~> 2.14.1'
  gem 'simplecov',                   '~> 0.8.2',    require: false
  gem 'thor',                        '~> 0.18.1',   require: false
  gem 'vcr',                         '~> 2.8.0'
  gem 'webmock',                     '~> 1.16.0'
  gem 'fake_sqs',                    '~> 0.1.0'
  gem 'rack-test',                   '~> 0.6.2'
  gem 'database_cleaner',            '~> 1.2.0'
#  gem 'shoulda-matchers',            '~> 2.6.1'
end

... the activesupport-4.1.1 gem is correctly in the compile scope.

If I uncomment shoulda-matchers from the :test block, then activesupport-4.1.1 is moved out of the compile scope to the test scope. This is a problem because this dependency is needed at runtime.

mkristian commented 10 years ago

it took me a while to find it: without Gemfile.lock things are working as expected. with the Gemfile.lock there are tons of warnings about duplicated declaration of dependencies. so all the test scope are duplicates.

a workaround would be rmvn clean initialize -P -gemfile_lock,gemfile

I see to fix those duplicates . .

ddossot commented 10 years ago

Thanks Christian!

mkristian commented 10 years ago

I just pushed a ruby-maven gem with a fix for this one. sorry it took a while . . .

ddossot commented 10 years ago

This works great, thank you so much :+1: