[QA] Reg::Multiple Gem versions in Gemfile.lock

Željko Filipin zfilipin at wikimedia.org
Mon Jul 14 12:14:49 UTC 2014


On Sat, Jul 12, 2014 at 10:21 AM, jagori samajdar <jagori79 at gmail.com>
wrote:
>
> I had a doubt in Gemfile.lock.
> Could we have multiple versions of a gem?
>

I am not sure what you are asking here. If you are asking if a Ruby
script/application can at the same time use two different versions of the
same gem, then the answer is no. (I might be wrong, but I think I
understand Bundler/Rubygems that much.)


> Say for the snippet pasted below from Gemfile.lock(rspec part,I could see
> multiple versions) :
>
>
>
>
>
>
>
>
> *rspec (2.99.0)      rspec-core (~> 2.99.0)      rspec-expectations (~>
> 2.99.0)      rspec-mocks (~> 2.99.0) rspec-core (2.99.1) rspec-expectations
> (2.99.0)      diff-lcs (>= 1.1.3, < 2.0) rspec-mocks (2.99.1)*
>
> Can't we just use rspec-core(2.99.1) or just maybe rspec-core (~> 2.99.0)
> after all ~> probably means >=2.99.0 and < 3.0(correct me if am wrong).
>
> or is it maybe there are certain features which run on a specific version
> and are not supported by other version and hence we had to include both?
>

As far as I understand things, the above lines say:

- rspec gem requires rspec-core 2.99.0 or newer
- there is a newer version of rspec-core, 2.99.1
- the newer version is used

For more information see Bundler documentation[1], or ask.

Željko
--
1: http://bundler.io/v1.6/rationale.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wikimedia.org/pipermail/qa/attachments/20140714/53f36622/attachment.html>


More information about the QA mailing list