Welcome Guest | Login

RedCloth Issues

So... I keep getting this error, and I have no idea why:

Gem::Exception: can't activate RedCloth (= 4.0.4, runtime), already activated RedCloth-4.1.0
from /usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:142:in `activate'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/dependencies.rb:510:in `require'
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/dependencies.rb:355:in `new_constants_in'
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/dependencies.rb:510:in `require'
from (irb):2


I have no clue why it's trying to activate RedCloth 4.0.4... I assume trying to follow a tutorial somewhere I got lost and broke something but now my app won't load properly (because there are RedCloth calls for the content). I don't even want version 4.0.4.

I've removed everything gem related, started a new SSH session, and restarted the server. I got nothing and no clue as to what is up.

2008-11-12 03:28 PM

Hi Aswdev,

Give a try after specifying the following line in the config/environment.rb file.

RAILS_GEM_VERSION = '2.0.2'

Also make sure that you haven't specified any other rails version in the config/environment.r file or any otehr rails version is not frozen into your application.

2008-11-12 04:02 PM

It was made using 2.1.0... and is working fine on my development box. Regardless that doesn't seem to fix it, but cheers none-the-less.

Everything starts fine, it just won't find RedCloth or rather tells me I can't use two versions at the same time.

2008-11-12 04:07 PM

This is what it looks like in the console:

Gem::Exception: can't activate RedCloth (= 4.0.4, runtime), already activated RedCloth-4.1.0
from /usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:142:in `activate'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require'
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:354:in `new_constants_in'
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require'
from (irb):1

2008-11-12 04:35 PM

Hi Aswdev,

Where exactly are you getting the above mentioned errors? Are you getting those errors while including the lines in the file config/environment.rb?

require 'rubygems'
require 'RedCloth'

2008-11-12 05:10 PM

I am having the same problem and have no idea why. This is very frustrating because I cannot run migrations because of it.

I also have not required version 4.0.4, but I do have 4.1.0 frozen into my app. This is the same version that it says is loaded.

I get this error when I try to run script/console or any migrations, although the console does start after the error.

If I include "require 'RedCloth'" in my environment file I can run script/console without the error but then the app won't start and throws this error:

no such file to load -- RedCloth (MissingSourceFile)

Both versions are installed on my server... Any ideas?

2008-11-13 01:49 PM

Hi Zef,

Please  give a try after populating the database using the command.

/opt/ruby-enterprise-1.8.6-20080507/bin/rake db:migrate RAILS_ENV='production'.

Make sure that the rails version in the production server and in the local machine are same. Also which rails version are you using in your rails app?

2008-11-13 04:30 PM

Hi, I am using Rails version 2.1.1 on both applications. I cannot downgrade to 2.0.2 as suggested in this thread because I am using named_scope in both apps, and this was added in 2.1.

This version of Rails is installed on my server.

The DB is populated and both apps have been successfully running. I am using mod_rails, so the environment is already set to production. Running script/console does indeed load the production environment, but has the error. Just to be clear, this is my error message:

/usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:142:in `activate':Gem::Exception: can't activate RedCloth (= 4.0.4, runtime), already activated RedCloth-4.1.0

I am wondering if both Aswdev and I are on the same shared server, because this thread was started on November 12th and this correlates to the problem that I am having. I have not found this problem elsewhere with a definable cause.

Thanks!

2008-11-13 04:45 PM

I've uninstalled RedCloth version 4.0.4 on the server to fix the issue. Also please note that Aswdev is on a different shared server.

2008-11-13 07:44 PM

The problem has been fixed, thank you very much!

2008-11-13 07:57 PM


Hello Guest! In order to post you must be an active client with us, please log in or sign up.