Gerard Petersen
2006-Jan-15 12:57 UTC
[Rails] Redcloth gem properly installed ... still errors
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!
Jake Janovetz
2006-Jan-15 15:44 UTC
[Rails] Re: Redcloth gem properly installed ... still errors
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 -- Posted via http://www.ruby-forum.com/.
Gerard Petersen
2006-Jan-15 16:04 UTC
[Rails] Re: Redcloth gem properly installed ... still errors
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:> 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
--
"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!
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"}
> 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