tags:

views:

282

answers:

3

For any gem that has dependencies, I get the following (with the names changed as applicable):

Attempt 1:

sudo gem install mojombo-jekyll -s http://gems.github.com/
ERROR:  Error installing mojombo-jekyll:
        mojombo-jekyll requires RedCloth (= 4.1.0, runtime)

Attempt 2:

sudo gem install mojombo-jekyll -s http://gems.github.com/ -y
INFO:  `gem install -y` is now default and will be removed
INFO:  use --ignore-dependencies to install only the gems you list
ERROR:  Error installing mojombo-jekyll:
        mojombo-jekyll requires RedCloth (= 4.1.0, runtime)

Attempt 3:

sudo gem install mojombo-jekyll -s http://gems.github.com/ --include-dependencies
INFO:  `gem install -y` is now default and will be removed
INFO:  use --ignore-dependencies to install only the gems you list
ERROR:  Error installing mojombo-jekyll:
        mojombo-jekyll requires RedCloth (= 4.1.0, runtime)
A: 

I believe it's related to this bug. Particularly:

After some testing I think I narrowed down when it happens:

If gem foo depends on gem bar (any version) then installing foo also installs its dependency bar.

If gem foo depends on bar 1.0, and bar 1.0 is the latest version, then installing foo also installs bar 1.0.

If gem foo depends on bar 1.0, but bar 1.1 also exists in the remote repository, gem install finds bar 1.1 and complains that bar 1.0 is missing.

RedCloth 4.1.0 is an oldish version. It seems your gem has a fixed dependency on 4.1.0, but 4.19 is the latest version, so there's a mismatch occurring.

Peter Cooper
+3  A: 

Try installing the 4.1.0 version of RedCloth gem first.

sudo gem install RedCloth -v 4.1.0

Then install mojombo-jekyll gem.

sudo gem install mojombo-jekyll -s http://gems.github.com/
dave elkins
+2  A: 

The problem is not dependency related but source related. If you specify the '-s' option, rubygems will only use that source or sources.

sudo gem install mojombo-jekyll -s http://gems.github.com/ -s http://gems.rubyforge.org

This will tell rubygems to use both rubyforge and github. Most people tend to take the approach of adding the gem source to their environment instead of doing it manually each time.

halorgium
I do, in fact, have those sources set up in my .gemrc. The problem is that I have an intranet one set up first and Rubygems dies if I'm not on that intranet at the time, so I usually specify the --source. Didn't realize they could repeat!
James A. Rosen