Rails 1.2.2 and BlueCloth

Folks-
My site (slumberlandecords.com) is hosted on marge, which recently (it appears) got upgraded to rails 1.2.2. since then I’ve had a slew of problems. I’ve worked through most, but for some reason the BlueCloth gem just won’t work for me anymore. Anybody have any ideas?

thanks!
Mike

I’m having the same problem. Haven’t figured out what the deal is but you can either install your own gems on dreamhost (there’s a topic on their wiki) or you can freeze your gems on your development machine before deploying to dreamhost. That will copy the gem code to vendor/plugins and you won’t have to worry about upgrades breaking your stuff. For more info on freezing see http://blog.wetonrails.com/2006/11/14/freeze-gems-and-carry-them-around-with-you

Have you had success installing your own gems? I followed the instructions on the wiki and BlueCloth still didn’t work. I’m not sure if I did it wrong or what – I’m still new to Rails and I don’t know how to tell which version of a gem is actually running.
As a short term fix I changed my code to use RedCloth instead, though RC doesn’t seem to understand space+space+newline as a line break so a little string manipulation was in order.
Thanks for the freezing links, I’ll definitely look into that to eliminate future hassles.

Mike

The way to make this work (well for me anyway) is to put the bluecloth.rb file in your lib directory. Then require ‘bluecloth’ in your application.rb.

Finally, write a little helper method like (put it in whatever helper you need it for or application.rb):

def markdown(text)
BlueCloth::new(text).to_html
end

Finally call it using markdown(text). You may have to write little helper methods for all the calls that your app makes into Bluecloth, but that should be doable.

I was getting error messages to the effect of “undefined method ‘markdown’”, which didn’t happen on my development machine. I tried heathweaver’s suggestion, and (lo and behold) it worked.

I’d prefer to know why the gem doesn’t work, but at least I have a functioning site now… Thanks!

:ian