Plugin not working

Hi all,

I have an issue with getting a plugin to work, namely Scaffolding
Extensions. It used to work fine with webrick, but seems to have
stopped working around the time that I moved the app to apache. Now it
doesn’t work with either server.

I’m not suggesting that the problem is due to apache - I might have done
something else around the time to break the extension, but not sure
what.

I even deleted the plugin from vendor/plugins and re-installed it - I
can see the files in vendor/plugins/scaffolding_extensions

antony@lee:~/workspace/marketing/vendor/plugins$ find -name init.rb
./scaffolding_extensions/init.rb
./mdd/init.rb
antony@lee:~/workspace/marketing/vendor/plugins$

But my one-line controller doesn’t work. The only call is to
scaffold_all_models and webrick and apache both report:

“NameError -undefined local variable or method `scaffold_all_models’ for
AdminController:Class”

I’d really appreciate any help debugging this.

Antony

On 11/7/06, Antony G. [email protected] wrote:

I’d really appreciate any help debugging this.

From the error message it appears as though rails isn’t loading the
plugin file. First off, which version of Rails are you using? I only
test the plugin with 1.1.6. Is the mdd plugin you are using working?
Could you post your contents of your controller file?

Run this command in the Rails app:

script/runner “puts
ActionController::Base.methods.sort.delete_if{|m| m !~ /^scaffold/ }”

You should get this output:

scaffold
scaffold_all_models
scaffold_auto_complete_for
scaffold_habtm
scaffold_method
scaffold_path
scaffold_template_dir

If not, the plugin isn’t being loaded properly. Check your ruby load
path includes the plugin:

$ script/runner “puts $:” | grep scaffolding_extensions
script/…/config/…/vendor/plugins/scaffolding_extensions/lib

If not, you can try running script/console, manually modifying the
load path and then requiring ‘scaffolding_extensions’, and then seeing
if the scaffolding methods have been added.

As a last resort, try creating an empty Rails project and adding the
plugin to it to see if it works.

Jeremy

Jeremy E. wrote:

can see the files in vendor/plugins/scaffolding_extensions
AdminController:Class"
script/runner "puts
scaffold_template_dir
Hi Jeremy, thanks for replying.

Aha. I replaced the " with ’ to stop bash interpreting the ! and:

antony@lee:~/workspace/marketing$ script/runner ‘puts
ActionController::Base.methods.sort.delete_if{|m| m !~ /^scaffold/ }’
scaffold

If not, the plugin isn’t being loaded properly. Check your ruby load
path includes the plugin:

$ script/runner “puts $:” | grep scaffolding_extensions
script/…/config/…/vendor/plugins/scaffolding_extensions/lib

antony@lee:~/workspace/marketing$ script/runner “puts $:” | grep
scaffolding_extensions
script/…/config/…/vendor/plugins/doc/files/scaffolding_extensions/lib

Hmm. A different path. I deleted
vendor/plugins/doc/files/scaffolding_extensions - I’m not sure how it
got there, perhaps I was messing around with rdoc. This worked, thanks
a bunch.

Still didn’t work with apache, but the error message:

Permission denied -
/var/www/marketing/public/…/config/…/tmp/sessions//ruby_sess.47d210ac7a23bcca

was good enough for me to work out a chown -R tmp/sessions. I hope this
post helps someone else.

Thanks again for your help.

Antony