Forum: Ruby on Rails require a specific gem-version

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Johannes Held (Guest)
on 2007-01-09 04:59
(Received via mailing list)

I have a question about how to include a special version of a gem.

On my server there are two versions of RedCloth: 3.0.3 and 3.0.4.

And I need to use 3.0.3.

If I write a script, I can simply write it like this:
require 'rubygems'
require_gem 'RedCloth', '3.0.3'

But if I put "require_gem 'RedCloth', '3.0.3' " as first line into
environment.rb, I get this error:
/usr/lib/ruby/site_ruby/1.8/rubygems.rb:196:in `activate': can't
activate RedCloth (= 3.0.3), already activated RedCloth-3.0.4]

Can you please tell me, where I can define the versions Rails should

Johannes Held
Russell N. (Guest)
on 2007-01-09 14:55
(Received via mailing list)
I've been solving this problem by requiring RedCloth before the
loop in config/environment.rb. YMMV but it works for me.

The question I want to add here is that now that [or as soon as]
has been officially deprecated, what's the right way to require a
version of a gem using a regular require? RTFM, right? Hehehe. I know.
been "looking" but haven't run across the way yet. Excuse me if it's

This topic is locked and can not be replied to.