# Can't get redcloth to work on server

**URL:** <https://www.ruby-forum.com/t/cant-get-redcloth-to-work-on-server/146114>\
**Category:** Rails\
**Created:** [August 18, 2008, 6:58am UTC](https://www.ruby-forum.com/t/cant-get-redcloth-to-work-on-server/146114 "2008-08-18T06:58:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeffpritchard](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/43a26b/32.png) [@jeffpritchard](https://www.ruby-forum.com/u/jeffpritchard)\
**Post date:** [August 18, 2008, 6:58am UTC](https://www.ruby-forum.com/t/cant-get-redcloth-to-work-on-server/146114/1 "2008-08-18T06:58:43Z")

</div>

I develop on a Mac, and have a redhat enterprise based server.

I’m trying to use the redcloth gem in my app. I can get it to work just  
fine on the Mac (localhost), but I cannot seem to get it to work on the  
server. I’ve driven myself nuts googling and re-installing things today  
and have made absolutely no progress.

A simple and repeatable example of the issue is comparing a  
script/console session between the mac and the server:

On the mac:  
JP-iMac:synergy jeffpritchard$ script/console  
Loading development environment (Rails 2.1.0)

> > require ‘rubygems’  
> > =\> false
> 
> > require ‘redcloth’  
> > =\> true
> 
> > RedCloth.new(“fred”).to\_html  
> > =\> “
> > 
> > fred
> > 
> > ”
> 
> > quit

On the server:  
[foo@bar current]# script/console  
Loading development environment (Rails 2.1.0)

> > require ‘rubygems’  
> > =\> []
> 
> > require ‘redcloth’  
> > =\> []
> 
> > RedCloth.new(“fred”).to\_html  
> > NameError: uninitialized constant RedCloth::TextileDoc  
> > from  
> > /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active\_support/dependencies.rb:275:in  
> > `load_missing_constant' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:467:in`const\_missing’  
> > from  
> > /usr/lib/ruby/gems/1.8/gems/RedCloth-4.0.2/lib/case\_sensitive\_require/…/redcloth.rb:17:in  
> > `new’  
> > from (irb):3
> 
> >

This same sequence works just fine from an IRB session on both machines.  
Seems to be something kerbolixed in my rails setup on the server. Both  
machines are running rails 2.1.0. It looks like the “require” doesn’t  
work right for some reason.

Before somebody asks, yes the redcloth gem is installed.

Anybody have any suggestions?

thanks,  
jp

---

<div class="post-metadata">

**Author:** ![jeffpritchard](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/43a26b/32.png) [@jeffpritchard](https://www.ruby-forum.com/u/jeffpritchard)\
**Post date:** [August 18, 2008, 8:58am UTC](https://www.ruby-forum.com/t/cant-get-redcloth-to-work-on-server/146114/2 "2008-08-18T08:58:57Z")

</div>

Hi Jeff-

Here’s a shot in the dark. Did you freeze the gem in Rails? If so, the  
Rails console might be using a different gem than IRB would use. I ran  
into a similar problem with RedCloth when I developed an app on Ubuntu  
and then tried to run it on a Windows machine. Since I had frozen the  
Linux version of the gem, it wasn’t being correctly loaded in the  
Windows machine. Once I unpacked the Windows version of RedCloth to my  
app, everything started working.

Regards-  
Eric

On Aug 18, 12:58 am, Jeff P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![jeffpritchard](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/43a26b/32.png) [@jeffpritchard](https://www.ruby-forum.com/u/jeffpritchard)\
**Post date:** [August 18, 2008, 5:13pm UTC](https://www.ruby-forum.com/t/cant-get-redcloth-to-work-on-server/146114/3 "2008-08-18T17:13:26Z")

</div>

Eric M. wrote:

> Hi Jeff-
> 
> Here’s a shot in the dark. Did you freeze the gem in Rails? If so, the  
> Rails console might be using a different gem than IRB would use. I ran  
> into a similar problem with RedCloth when I developed an app on Ubuntu  
> and then tried to run it on a Windows machine. Since I had frozen the  
> Linux version of the gem, it wasn’t being correctly loaded in the  
> Windows machine. Once I unpacked the Windows version of RedCloth to my  
> app, everything started working.
> 
> Regards-  
> Eric
> 
> On Aug 18, 12:58ï¿½am, Jeff P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

Eric,  
Thanks, but no, nothing frozen.

jp

---

<div class="post-metadata">

**Author:** ![jeffpritchard](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/43a26b/32.png) [@jeffpritchard](https://www.ruby-forum.com/u/jeffpritchard)\
**Post date:** [August 19, 2008, 7:15am UTC](https://www.ruby-forum.com/t/cant-get-redcloth-to-work-on-server/146114/4 "2008-08-19T07:15:17Z")

</div>

> > > RedCloth.new(“fred”).to\_html  
> > > NameError: uninitialized constant RedCloth::TextileDoc

I’d try installing RedCloth 3.0.3
