Olle Görling
2005-Jun-15 14:40 UTC
Problem with Salted Login Generator and Localization Generator
Hi everyone! I''m new to Ruby on rails, and my eager attempts to get started have come to a grinding halt when trying to install the Salted Login Generator. I''ve created a new Rails-project in order to try things out, following the Salted Login Generator Quickstart in the wiki [1]. When I try to access the user-controller, http://rubydev/user/signup or http://rubydev/user/login, I get this error: [snip] NameError in User#login Showing /user/login.rhtml where line #2 raised: uninitialized constant Localization::CONFIG Extracted source (around line #2): 1: <div title="<%= title_helper %>" class="form"> 2: <%= head_helper %> 3: 4: <div class="form-padding"> 5: <%= start_form_tag_helper %> [/snip] [snip] /lib/localization.rb:8:in `l'' /app/helpers/user_helper.rb:67:in `head_helper'' (erb):2:in `evaluate_locals'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/action_view/base.rb: 265:in `evaluate_locals'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/action_view/base.rb: 276:in `rhtml_render'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/action_view/base.rb: 201:in `send'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/action_view/base.rb: 201:in `render_template'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/action_view/base.rb: 181:in `render_file'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/action_controller/ layout.rb:208:in `render_without_benchmark'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/action_controller/ benchmarking.rb:23:in `render'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/action_controller/ benchmarking.rb:23:in `measure'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/action_controller/ benchmarking.rb:23:in `render'' app/controllers/user_controller.rb:174:in `generate_blank'' app/controllers/user_controller.rb:6:in `login'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/action_controller/ base.rb:708:in `send'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/action_controller/ base.rb:708:in `perform_action_without_filters'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/action_controller/ filters.rb:294:in `perform_action_without_benchmark'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/action_controller/ benchmarking.rb:37:in `perform_action_without_rescue'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/action_controller/ benchmarking.rb:37:in `measure'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/action_controller/ benchmarking.rb:37:in `perform_action_without_rescue'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/action_controller/ rescue.rb:79:in `perform_action'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/action_controller/ base.rb:330:in `send'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/action_controller/ base.rb:330:in `process'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/action_controller/ base.rb:273:in `process'' /usr/lib/ruby/gems/1.8/gems/rails-0.12.1/lib/dispatcher.rb:32:in `dispatch'' /var/www/rubydev/rubydev/public/dispatch.fcgi:20 /var/www/rubydev/rubydev/public/dispatch.fcgi:18:in `each_cgi'' /usr/lib/ruby/1.8/fcgi.rb:597:in `each'' /usr/lib/ruby/1.8/fcgi.rb:597:in `each_cgi'' /var/www/rubydev/rubydev/public/dispatch.fcgi:18 [/snip] I don''t know where to start resolving this problem, and any pointers in the right direction would be appreciated, since my stfi:ing failed miserably ;) I''m running the following software setup: Debian/Sarge Ruby 1.8.2 (ruby 1.8.2 (2005-04-11) [i386-linux]) Rails 0.12.1 Apache 2.0.54 mod_fastcgi 2.4.2 // Olle Görling olle-Zp9TlmUun4/R7s880joybQ@public.gmane.org [1] http://wiki.rubyonrails.com/rails/show/SaltedLoginGeneratorQuickstart _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Duane Johnson
2005-Jun-15 14:49 UTC
Re: Problem with Salted Login Generator and Localization Generator
On Jun 15, 2005, at 8:40 AM, Olle Görling wrote:> > Showing /user/login.rhtml where line #2 raised: > > uninitialized constant Localization::CONFIG > Extracted source (around line #2): > > 1: <div title="<%= title_helper %>" class="form"> > 2: <%= head_helper %>Does your head_helper method reference the CONFIG constant? I''m guessing that you either didn''t set the CONFIG constant in your environment.rb file, or else your referencing CONFIG inside of a module ("Localization"?) where it can''t find it. In the latter case, try ::CONFIG to get out of the module''s scope. Duane Johnson (canadaduane) _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Ben Bleything
2005-Jun-15 14:52 UTC
Re: Problem with Salted Login Generator and Localization Generator
On Wed, Jun 15, 2005, Olle Görling wrote:> Hi everyone! > > I''m new to Ruby on rails, and my eager attempts to get started have > come to a grinding halt when trying to install the Salted Login > Generator. I''ve created a new Rails-project in order to try things out, > following the Salted Login Generator Quickstart in the wiki [1]. > > When I try to access the user-controller, http://rubydev/user/signup or > http://rubydev/user/login, I get this error: > > [snip]It sounds like app/config/environments/localization_environment.rb may either be wonky or not getting included. Are you sure that steps 6 and 7 of the quickstart are correct? ruby -c on that file and on app/config/environment.rb and make sure they''re valid. If that fails, paste in the contents of your localization_environment.rb and maybe that''ll help.... Ben
Joseph Hosteny
2005-Jun-15 14:55 UTC
Re: Problem with Salted Login Generator and Localization Generator
On Jun 15, 2005, at 10:40 AM, Olle Görling wrote:> Hi everyone! > > I''m new to Ruby on rails, and my eager attempts to get started have > come to a grinding halt when trying to install the Salted Login > Generator. I''ve created a new Rails-project in order to try things > out, following the Salted Login Generator Quickstart in the wiki [1]. > > When I try to access the user-controller, http://rubydev/user/ > signup or http://rubydev/user/login, I get this error: > > [snip] > NameError in User#login > > Showing /user/login.rhtml where line #2 raised: > > uninitialized constant Localization::CONFIG > Extracted source (around line #2):The salted login generator has a dependency on another generator that I wrote, the localization generator. Make sure that you look at the README_LOCALIZATION that is installed in your project directory (assuming you invoked the login generator as ruby generate/script salted_login Account Localization). If you follow the directions in there and you still can''t get it to work, I can discuss it with you offline. joe> > 1: <div title="<%= title_helper %>" class="form"> > 2: <%= head_helper %> > 3: > 4: <div class="form-padding"> > 5: <%= start_form_tag_helper %> > [/snip] > > [snip] > /lib/localization.rb:8:in `l'' > /app/helpers/user_helper.rb:67:in `head_helper'' > (erb):2:in `evaluate_locals'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/action_view/ > base.rb:265:in `evaluate_locals'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/action_view/ > base.rb:276:in `rhtml_render'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/action_view/ > base.rb:201:in `send'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/action_view/ > base.rb:201:in `render_template'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/action_view/ > base.rb:181:in `render_file'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/action_controller/ > layout.rb:208:in `render_without_benchmark'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/action_controller/ > benchmarking.rb:23:in `render'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/action_controller/ > benchmarking.rb:23:in `measure'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/action_controller/ > benchmarking.rb:23:in `render'' > app/controllers/user_controller.rb:174:in `generate_blank'' > app/controllers/user_controller.rb:6:in `login'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/action_controller/ > base.rb:708:in `send'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/action_controller/ > base.rb:708:in `perform_action_without_filters'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/action_controller/ > filters.rb:294:in `perform_action_without_benchmark'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/action_controller/ > benchmarking.rb:37:in `perform_action_without_rescue'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/action_controller/ > benchmarking.rb:37:in `measure'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/action_controller/ > benchmarking.rb:37:in `perform_action_without_rescue'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/action_controller/ > rescue.rb:79:in `perform_action'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/action_controller/ > base.rb:330:in `send'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/action_controller/ > base.rb:330:in `process'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/action_controller/ > base.rb:273:in `process'' > /usr/lib/ruby/gems/1.8/gems/rails-0.12.1/lib/dispatcher.rb:32:in > `dispatch'' > /var/www/rubydev/rubydev/public/dispatch.fcgi:20 > /var/www/rubydev/rubydev/public/dispatch.fcgi:18:in `each_cgi'' > /usr/lib/ruby/1.8/fcgi.rb:597:in `each'' > /usr/lib/ruby/1.8/fcgi.rb:597:in `each_cgi'' > /var/www/rubydev/rubydev/public/dispatch.fcgi:18 > [/snip] > > I don''t know where to start resolving this problem, and any > pointers in the right direction would be appreciated, since my > stfi:ing failed miserably ;) > > I''m running the following software setup: > Debian/Sarge > Ruby 1.8.2 (ruby 1.8.2 (2005-04-11) [i386-linux]) > Rails 0.12.1 > Apache 2.0.54 > mod_fastcgi 2.4.2 > > // Olle Görling > olle-Zp9TlmUun4/R7s880joybQ@public.gmane.org > > [1] http://wiki.rubyonrails.com/rails/show/ > SaltedLoginGeneratorQuickstart________________________________________ > _______ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >Joseph Hosteny jhosteny-ee4meeAH724@public.gmane.org H: 412.362.8672 C: 412.418.6023
Ben Bleything
2005-Jun-15 14:58 UTC
Re: Problem with Salted Login Generator and Localization Generator
On Wed, Jun 15, 2005, Duane Johnson wrote:> Does your head_helper method reference the CONFIG constant? I''m > guessing that you either didn''t set the CONFIG constant in your > environment.rb file, or else your referencing CONFIG inside of a > module ("Localization"?) where it can''t find it. In the latter case, > try ::CONFIG to get out of the module''s scope.head_helper and etc are provided by the SLG. If you follow the instructions that ship with the SLG, the CONFIG is set in a file that''s included by your environment.rb. I''ve seen this before, and it was always due to missing a step while setting up the SLG. Check out my previous reply for what I think the problem is. Ben
Olle Görling
2005-Jun-15 15:04 UTC
Re: Problem with Salted Login Generator and Localization Generator
2005-06-15 kl. 16.52 skrev Ben Bleything:> It sounds like app/config/environments/localization_environment.rb may > either be wonky or not getting included. Are you sure that steps 6 and > 7 of the quickstart are correct? > > ruby -c on that file and on app/config/environment.rb and make sure > they''re valid.Everything seems to be fine here: $ ruby -c config/environments/localization_environment.rb Syntax OK $ ruby -c config/environment.rb Syntax OK> > If that fails, paste in the contents of your > localization_environment.rb > and maybe that''ll help.... >From config/environment.rb: [snip] Controllers = Dependencies::LoadingModule.root( File.join(RAILS_ROOT, ''app'', ''controllers''), File.join(RAILS_ROOT, ''components'') ) # Include your app''s configuration here: require ''environments/localization_environment'' require ''localization'' Localization::load_localized_strings require ''environments/user_environment'' [snip] From config/environments/localization_environment.rb: [snip] module Localization CONFIG = { # Default language :default_language => ''en'', :web_charset => ''utf-8'' } if CONFIG[:web_charset] == ''utf-8'' $KCODE = ''u'' end end [/snip] As far as I can see, everything should be OK. Also, I haven''t changed any of the default values in those two files. // Olle Görling olle-Zp9TlmUun4/R7s880joybQ@public.gmane.org _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Ben Bleything
2005-Jun-15 15:12 UTC
Re: Problem with Salted Login Generator and Localization Generator
On Wed, Jun 15, 2005, Olle Görling wrote:> [snip] > As far as I can see, everything should be OK. Also, I haven''t changed > any of the default values in those two files.Argh. And your application helper has the appropriate include? What happens when you run the tests? Ben ps- if you want, we can take this off-list or you can work with Joe, who wrote the generator in the first place. Lots of people have problems with it, so I like to keep the help on the list :)
I am trying to get the Salted Login Generator to work, but without the email conformation, as I am going to have further confirmation alter on in the signup process. Is there an easy way to do this? _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails