Sharagoz -- wrote:
>> Then I try to restart the server:
> You should also add this to the environment file:
> config.gem "locale"
> config.gem "locale_rails"
> config.gem "gettext"
> config.gem "gettext_activerecord"
> config.gem "gettext_rails"
> 
> Isn't the solution to your error message presented in the error message 
> itself?

Yes, you are right Sharagoz.

I added a line like:
config.action_controller.session = {:key => "_myapp_session", :secret => 
"my_secret_password" }

to \config\environment.rb

But then, when I try to restart the server, it gives me a message 
(below) where it says "undefined method `_'" when he meets a line where 
translatable strings with gettext were marked, for instance:

C:/rails_apps/aaa_arb/app/models/analyzed_region.rb:53
  validates_presence_of :contigs_id, :num_region, :forward_primer_id, 
:reverse_primer_id, :message => _("cannot be empty")

This didn't generate an error previously. It's like gettext doesn't 
work.



================================
C:\rails_apps\aaa_arb>ruby script/server -e production
=> Booting Mongrel
=> Rails 2.3.5 application starting on http://0.0.0.0:3000
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:1959
:in `method_missing': undefined method `_' for #<Class:0x53a1170> 
(NoMethodError
)
        from C:/rails_apps/aaa_arb/app/models/analyzed_region.rb:53
        from 
C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `ge
m_original_require'
        from 
C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `re
quire'
        from 
C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_suppo
rt/dependencies.rb:158:in `require'
        from 
C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_suppo
rt/dependencies.rb:265:in `require_or_load'
        from 
C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_suppo
rt/dependencies.rb:224:in `depend_on'
        from 
C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_suppo
rt/dependencies.rb:136:in `require_dependency'
        from 
C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:414:i
n `load_application_classes'
        from 
C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:413:i
n `each'
        from 
C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:413:i
n `load_application_classes'
        from 
C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:411:i
n `each'
        from 
C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:411:i
n `load_application_classes'
        from 
C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:197:i
n `process'
        from 
C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:113:i
n `send'
        from 
C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:113:i
n `run'
        from C:/rails_apps/aaa_arb/config/environment.rb:35
        from 
C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `ge
m_original_require'
        from 
C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `re
quire'
        from 
C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_suppo
rt/dependencies.rb:156:in `require'
        from 
C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_suppo
rt/dependencies.rb:521:in `new_constants_in'
        from 
C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_suppo
rt/dependencies.rb:156:in `require'
        from 
C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/commands/server.rb:8
4
        from 
C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `ge
m_original_require'
        from 
C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `re
quire'
-- 
Posted via http://www.ruby-forum.com/.

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to