SirRupertIII
SirRupertIII

Reputation: 12596

Use one Ruby gem and not use another, in Bundler

I am very new to Ruby. I want to use one gem, a pre-released gem, instead of the original gem, in order to test it. I have a Gemfile. How do I do this?

I've been searching through the Bundler site, but I've only found more complicated things to do instead of more simple things.

Upvotes: 1

Views: 75

Answers (3)

Pierre-Louis Gottfrois
Pierre-Louis Gottfrois

Reputation: 17631

gem 'gem_name'

Will use the latest version of the gem.

gem 'gem_name', '1.2.3'

Will force to use 1.2.3 version of the gem.

gem 'gem_name', '~> 1.2.3'

Will tell Bundler to use version of the gem >= 1.2.3 but < 1.3.0

gem 'gem_name', '>= 1.2.3'

Speak to itself. The following signs are also available < <= > =

See Bundler's doc

Upvotes: 3

a-b-r-o-w-n
a-b-r-o-w-n

Reputation: 515

You can specify which version of a gem to use in your gem file.

gem 'gem_name', '~> 1.0.1' # <--- version

Then just run bundle to install and use that gem.

Upvotes: 2

Dan Grahn
Dan Grahn

Reputation: 9394

Here is a way to find and use pre-release versions.

http://blog.agirorn.com/posts/1

Upvotes: 1

Related Questions