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 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 11/7/06, Antony Gelberg <antony-Zg1vBhHakVW9FHfhHBbuYA@public.gmane.org> wrote:> 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.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 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Jeremy Evans wrote:> On 11/7/06, Antony Gelberg <antony-Zg1vBhHakVW9FHfhHBbuYA@public.gmane.org> wrote: >> 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. > > 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_dirHi 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 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---