RadiantOnRails NameError for no_login_required

I’m attempting to use RadiantOnRails but when trying to boot, I get a
NameError: no_login_required for Admin::WelcomeController on line 8 of
radiant_extensions.rb. I added require statements to
welcome_controller.rb and to application.rb in the radiant gem but no
luck. Anyone else running into this?

-Luke

I added include statements to radiant’s site_controller and
welcome_controller and was at least able to boot up…

Luke,

Are you running Radiant in “instance mode” and version 0.6.1? It
looks like I didn’t document that very well, but you should
initialize your project by running the following commands:

radiant /path/to/your/project
cd /path/to/your/project
svn export svn://rubyforge.org/var/svn/radiantonrails/trunk vendor/
extensions/radiant_on_rails

Then you need to configure config/database.yml and follow the
instructions in vendor/extensions/radiant_on_rails/README.

Try this out and let me know if your still having issues. I just did
it and it is working for me.

Matt Parrish
http://www.pearware.org

Matt,

Yes, I’m running instance mode with radiant 061 (I’m still unclear why
radiant now has this “hybrid” set-up: somewhere between a plugin and a
“normal” gem, but I’ll trust the team’s judgment on it). I followed
your readme instructions and the radiant extension install
instructions. So, I don’t know what I’m missing. I had to add the
include statements to make the app boot up, but after that I still get
other errors, for instance, when i try to navigate to /admin.

Can you send my_app/config/environment.rb & my_app/config/routes.rb
files for a working install? Also, are there any changes that need to
be made w/in the radiant gem itself to make this work?

Thanks,
Luke

Hi Lindsay,

What we determined from Luke’s error is that you probably have the
file RAILS_ROOT/app/controllers/application.rb, which shouldn’t be
there. Delete that file and see if it works.

Thanks,

Matt Parrish
http://www.pearware.org

Matt Parrish wrote:

Hi Lindsay,

What we determined from Luke’s error is that you probably have the
file RAILS_ROOT/app/controllers/application.rb, which shouldn’t be
there. Delete that file and see if it works.

Thanks,

Matt Parrish
http://www.pearware.org

Ahh, this might be a common mistake. Because there is no generator for
controllers in a Radiant project, I made a separate rails project just
for generating and copied the app, test, and db folders to RADIANT_ROOT
afterwords. Since those folders didn’t exist in the Radiant project to
begin with, I figured I wasn’t overwriting anything important.

Now to try and get ActiveScaffold working under RadiantOnRails, looks a
bit hairy since it is a fairly complex plugin. I see a thread or two on
getting plugins going though. Thanks for the tip.

-Lindsay

Luke W. wrote:

I’m attempting to use RadiantOnRails but when trying to boot, I get a
NameError: no_login_required for Admin::WelcomeController on line 8 of
radiant_extensions.rb. I added require statements to
welcome_controller.rb and to application.rb in the radiant gem but no
luck. Anyone else running into this?

-Luke

I’m getting the same error at the same place. I am using the gem and
have followed the instructions in the README. The server is running
under Kanotix, which is an offshoot of Debian.

The no_login_required line in
gems/radiant-0.6.1/app/admin/welcome_controller.rb is unrecognized
(NameError). This happens when the activate method calls
RadiantOnRails::RadiantExtensions.init, which tries to modify
Admin::WelcomeController with a class_eval statement.

I’m speculating that Admin::WelcomeController hasn’t been loaded yet at
this point, and this class_eval statement triggers its loading before
some dependency that is providing the no_login_required functionality is
loaded.

Any fix for this? I will try and implement my public facing
controller/view as an extension until I can work around this. I’ve read
that adding no_login_required to the top of an extension’s controller
allows one to use them publicly without being logged in to the admin
area. Haven’t tried that yet though.

-Lindsay

Below is the trace -

[email protected]:~/PCC5$ script/server -p 32000
=> Booting WEBrick…
/usr/lib/ruby/gems/1.8/gems/radiant-0.6.1/app/controllers/admin/welcome_controller.rb:2:
undefined local variable or method no_login_required' for Admin::WelcomeController:Class (NameError) from /usr/lib/ruby/gems/1.8/gems/radiant-0.6.1/vendor/rails/activesupport/lib/active_support/dependencies.rb:203:inload_without_new_constant_marking’
from
/usr/lib/ruby/gems/1.8/gems/radiant-0.6.1/vendor/rails/activesupport/lib/active_support/dependencies.rb:203:in
load_file' from /usr/lib/ruby/gems/1.8/gems/radiant-0.6.1/vendor/rails/activesupport/lib/active_support/dependencies.rb:342:innew_constants_in’
from
/usr/lib/ruby/gems/1.8/gems/radiant-0.6.1/vendor/rails/activesupport/lib/active_support/dependencies.rb:202:in
load_file' from /usr/lib/ruby/gems/1.8/gems/radiant-0.6.1/vendor/rails/activesupport/lib/active_support/dependencies.rb:94:inrequire_or_load’
from
/usr/lib/ruby/gems/1.8/gems/radiant-0.6.1/vendor/rails/activesupport/lib/active_support/dependencies.rb:248:in
load_missing_constant' from /usr/lib/ruby/gems/1.8/gems/radiant-0.6.1/vendor/rails/activesupport/lib/active_support/dependencies.rb:452:inconst_missing’
from
/var/rails/PCC5/vendor/extensions/radiant_on_rails/lib/radiant_on_rails/radiant_extensions.rb:8:in
init' ... 25 levels... from /usr/lib/ruby/gems/1.8/gems/radiant-0.6.1/vendor/rails/railties/lib/commands/server.rb:39 from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:ingem_original_require’
from
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require’
from script/server:3

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs