# Redcloth gem properly installed ... still errors

**URL:** <https://www.ruby-forum.com/t/redcloth-gem-properly-installed-still-errors/61537>\
**Category:** Rails\
**Created:** [January 15, 2006, 2:00pm UTC](https://www.ruby-forum.com/t/redcloth-gem-properly-installed-still-errors/61537 "2006-01-15T14:00:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![gerardjp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/9fc348/32.png) [@gerardjp](https://www.ruby-forum.com/u/gerardjp)\
**Post date:** [January 15, 2006, 2:00pm UTC](https://www.ruby-forum.com/t/redcloth-gem-properly-installed-still-errors/61537/1 "2006-01-15T14:00:41Z")

</div>

Hi all,

installed redcloth for using the object.attrib.textilize method in a  
template.

Using 3.0.3 because it supoosedly works the best with rails 1.0.0.

Keep getting the undefined method error. Did the require thingy, but no  
luck

What would be the most I’m-a-guru place to put the require btw?

Thanx.

Gerard

–  
“Who cares if it doesn’t do anything? It was made with our new  
Triple-Iso-Bifurcated-Krypton-Gate-MOS process …”

My $Grtz =~ Gerard;  
~  
:wq!

---

<div class="post-metadata">

**Author:** ![gerardjp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/9fc348/32.png) [@gerardjp](https://www.ruby-forum.com/u/gerardjp)\
**Post date:** [January 15, 2006, 4:44pm UTC](https://www.ruby-forum.com/t/redcloth-gem-properly-installed-still-errors/61537/2 "2006-01-15T16:44:41Z")

</div>

Gerard P. wrote:

> Hi all,
> 
> What would be the most I’m-a-guru place to put the require btw?

It worked locally when I put “require ‘RedCloth’” in the controller that  
required it. The deployed app didn’t work though. I fixed it in both  
locations by putting:

```
require_gem 'RedCloth'

```

in my config/environment.rb file. From my understanding, this is the  
proper place to put it.

Jake

---

<div class="post-metadata">

**Author:** ![gerardjp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/9fc348/32.png) [@gerardjp](https://www.ruby-forum.com/u/gerardjp)\
**Post date:** [January 15, 2006, 5:07pm UTC](https://www.ruby-forum.com/t/redcloth-gem-properly-installed-still-errors/61537/3 "2006-01-15T17:07:13Z")

</div>

Jake,

Thanx. Didn’t evenknow there was a require\_gem though. It (the “require”  
that  
is) was in my application.rc. However the object.textilize routine still  
gives back the “undefined method error”

The gem is working, because I tested the following line from the docs.

\<%= RedCloth.new(“h1. This is a test of textile\n\nParagraph\n\nAnother  
paragraph\n\n\* Bullets”).to\_html %\>

Any clue why the textile (or textilize) doesn’t work?

Thanx again.

Gerard.

On Sunday 15 January 2006 16:44, Jake J. tried to type something  
like:

> in my config/environment.rb file. From my understanding, this is the  
> proper place to put it.
> 
> Jake

–  
“Who cares if it doesn’t do anything? It was made with our new  
Triple-Iso-Bifurcated-Krypton-Gate-MOS process …”

My $Grtz =~ Gerard;  
~  
:wq!

---

<div class="post-metadata">

**Author:** ![gerardjp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/9fc348/32.png) [@gerardjp](https://www.ruby-forum.com/u/gerardjp)\
**Post date:** [January 16, 2006, 3:42pm UTC](https://www.ruby-forum.com/t/redcloth-gem-properly-installed-still-errors/61537/4 "2006-01-16T15:42:25Z")

</div>

Hello,  
I am currently running ruby v1.8.4 and have recently (yesterday)  
updated the rails gem. I have a table named “Articles”. After  
running scaffold with Articles (product) and admin (controller), when  
I attempt to load an index for this controller i get the following  
error:

NameError in Admin#index

uninitialized constant Article  
RAILS\_ROOT: script/…/config/…

Application Trace | Framework Trace | Full Trace  
/usr/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active\_support/  
dependencies.rb:200:in `const_missing' /usr/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/ core_ext/string/../../inflector.rb:149:in`constantize’  
/usr/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active\_support/  
core\_ext/string/inflections.rb:52:in `constantize' /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/ pagination.rb:186:in`paginator\_and\_collection\_for’  
/usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action\_controller/  
pagination.rb:124:in `paginate' ./script/../config/../app/controllers/admin_controller.rb:8:in`list’  
./script/…/config/…/app/controllers/admin\_controller.rb:3:in `index' /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/ base.rb:853:in`perform\_action\_without\_filters’  
/usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action\_controller/  
filters.rb:332:in `perform_action_without_benchmark' /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/ benchmarking.rb:69:in`perform\_action\_without\_rescue’  
/usr/lib/ruby/1.8/benchmark.rb:293:in `measure' /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/ benchmarking.rb:69:in`perform\_action\_without\_rescue’  
/usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action\_controller/  
rescue.rb:82:in `perform_action' /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/ base.rb:369:in`process\_without\_session\_management\_support’  
/usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action\_controller/  
session\_management.rb:116:in `process' /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/dispatcher.rb:38:in`dispatch’  
/usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/webrick\_server.rb:117:in  
`handle_dispatch' /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/webrick_server.rb:83:in`service’  
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' /usr/lib/ruby/1.8/webrick/httpserver.rb:65:in`run’  
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' /usr/lib/ruby/1.8/webrick/server.rb:162:in`start\_thread’  
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start' /usr/lib/ruby/1.8/webrick/server.rb:92:in`start’  
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start' /usr/lib/ruby/1.8/webrick/server.rb:82:in`start’  
/usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/webrick\_server.rb:69:in  
`dispatch' /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/commands/servers/ webrick.rb:59 /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in`require’  
/usr/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active\_support/  
dependencies.rb:214:in `require' /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/commands/server.rb:28 /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in`require’  
/usr/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active\_support/  
dependencies.rb:214:in `require’  
script/server:3  
This error occured while loading the following files:  
article.rb  
Request

Parameters: None

Show session dump

Response

Headers: {“cookie”=\>[], “Cache-Control”=\>“no-cache”}

---

<div class="post-metadata">

**Author:** ![gerardjp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/9fc348/32.png) [@gerardjp](https://www.ruby-forum.com/u/gerardjp)\
**Post date:** [January 16, 2006, 3:48pm UTC](https://www.ruby-forum.com/t/redcloth-gem-properly-installed-still-errors/61537/5 "2006-01-16T15:48:27Z")

</div>

> NameError in Admin#index
> 
> uninitialized constant Article  
> RAILS\_ROOT: script/…/config/…

If your table is articles, then the model name should be Article. The  
paginator helper will singularize the instance variable name.

–  
rick  
[http://techno-weenie.net](http://techno-weenie.net)
