gliptak
gliptak

Reputation: 3670

how to check for a newer gem version?

I have the following in my Gemfile:

gem 'rspec-rails', '2.8.1'

Is there a command available which indicates if there is a more update version available (or maybe list all versions)?

I understand that RubyGems does list current versions.

I looked at bundle update (http://docs.rubygems.org/read/chapter/10#page40) but it doesn't seem to have a "dry-run" option.

Upvotes: 2

Views: 501

Answers (1)

Nash Bridges
Nash Bridges

Reputation: 2378

gem outdated -r |grep rspec-rails (see gem help outdated)

In your code you can write something like that:

if `gem outdated -r`.include? "rspec-rails"
  # ....
end

Upvotes: 4

Related Questions