Forum: Ruby on Rails Redcloth gem properly installed ... still errors

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
4710a8ada2adc162aaee4288d9879d8e?d=identicon&s=25 Gerard Petersen (Guest)
on 2006-01-15 14:00
(Received via mailing list)
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!
E51c6ae07e72cf04ef869868cb8eca6e?d=identicon&s=25 Jake Janovetz (Guest)
on 2006-01-15 16:44
Gerard Petersen 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
4710a8ada2adc162aaee4288d9879d8e?d=identicon&s=25 Gerard Petersen (Guest)
on 2006-01-15 17:07
(Received via mailing list)
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 Janovetz 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!
Facfb65ddbf0fe0cc81545c8ace1a3cb?d=identicon&s=25 Joseph Graham (Guest)
on 2006-01-16 15:42
(Received via mailing list)
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"}
821395fe70906c8290df7f18ac4ac6cf?d=identicon&s=25 Rick Olson (Guest)
on 2006-01-16 15:48
(Received via mailing list)
> 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
This topic is locked and can not be replied to.