"no such file to load -- gettext/rails" error

I get the error below when I try to start my server. Here are the versions installed:     OS: Windows Server 2008     Ruby: 1.8.7     Gems:     actionmailer (2.3.5, 1.3.5)     actionpack (2.3.5, 1.13.5)     actionwebservice (1.2.5)     activerecord (2.3.5, 1.15.5)     activeresource (2.3.5)     activesupport (2.3.5, 1.4.4)     cgi_multipart_eof_fix (2.5.0)     daemons (1.0.10)     gem_plugin (0.2.3)     gettext (2.1.0)     locale (2.0.5)     log4r (1.1.5)     mongrel (1.1.5)     rack (1.0.1)     rails (2.3.5)     rake (0.8.7)     ruby-postgres (0.7.1.2006.04.06)     win32console (1.2.0)

Gettext is indeed installed: C:\Ruby\lib\ruby\gems\1.8\gems\gettext-2.1.0 Any ideas?

"Rails support has been removed. Rails / ActiveRecord specific code now lives in locale_rails, gettext_rails and gettext_activerecord." http://github.com/mutoh/gettext

Just a wild guess.

Sharagoz -- wrote:

"Rails support has been removed. Rails / ActiveRecord specific code now lives in locale_rails, gettext_rails and gettext_activerecord." GitHub - mutoh/gettext: Ruby-GetText-Package is a Localization(L10n) library and tools which modeled after GNU gettext package.

Just a wild guess.

Thanks Sharagoz,

I installed those 3 gems + the locale gem, but the error persists.

C:/rails_apps/aaa_arb/config/environment.rb:17

What does this line contain?

Sharagoz -- wrote:

C:/rails_apps/aaa_arb/config/environment.rb:17

What does this line contain?

it contains: require 'gettext/rails'

Do you suggest removing that ?

Do you suggest removing that ?

Yes, and then look at the documentation here for how to set up gettext_rails:

Sharagoz -- wrote:

Do you suggest removing that ?

Yes, and then look at the documentation here for how to set up gettext_rails: GitHub - mutoh/gettext_rails: Ruby on Rails (>=2.3) localization support with Ruby-GetText-Package.

Okay, I commented the line, and here's what I did, according to that page:

C:\Windows\system32>gem uninstall gettext Remove executables:         rgettext, rmsgfmt, rmsgmerge

in addition to the gem? [Yn] Y Removing rgettext Removing rmsgfmt Removing rmsgmerge Successfully uninstalled gettext-1.10.0-x86-mswin32

C:\Windows\system32>gem install gettext Successfully installed locale-2.0.5 Successfully installed gettext-2.1.0 2 gems installed Installing ri documentation for locale-2.0.5... Installing ri documentation for gettext-2.1.0... Installing RDoc documentation for locale-2.0.5... Installing RDoc documentation for gettext-2.1.0...

C:\Windows\system32>gem install locale_rails Successfully installed locale_rails-2.0.5 1 gem installed Installing ri documentation for locale_rails-2.0.5... Installing RDoc documentation for locale_rails-2.0.5...

C:\Windows\system32>gem install gettext_rails Successfully installed actionpack-2.3.5 Successfully installed actionmailer-2.3.5 Successfully installed activeresource-2.3.5 Successfully installed rails-2.3.5 Successfully installed gettext_rails-2.1.0 5 gems installed Installing ri documentation for actionpack-2.3.5... Installing ri documentation for actionmailer-2.3.5... Installing ri documentation for activeresource-2.3.5... Installing ri documentation for rails-2.3.5... Installing ri documentation for gettext_rails-2.1.0... Installing RDoc documentation for actionpack-2.3.5... Installing RDoc documentation for actionmailer-2.3.5... Installing RDoc documentation for activeresource-2.3.5... Installing RDoc documentation for rails-2.3.5... Installing RDoc documentation for gettext_rails-2.1.0...

C:\Windows\system32>gem install gettext_activerecord Successfully installed gettext_activerecord-2.1.0 1 gem installed Installing ri documentation for gettext_activerecord-2.1.0... Installing RDoc documentation for gettext_activerecord-2.1.0...

C:\Windows\system32>gem install locale Successfully installed locale-2.0.5 1 gem installed Installing ri documentation for locale-2.0.5... Installing RDoc documentation for locale-2.0.5...

C:\Windows\system32>gem list

*** LOCAL GEMS ***

actionmailer (2.3.5, 1.3.5) actionpack (2.3.5, 1.13.5) actionwebservice (1.2.5) activerecord (2.3.5, 1.15.5) activeresource (2.3.5) activesupport (2.3.5, 1.4.4) cgi_multipart_eof_fix (2.5.0) gem_plugin (0.2.3) gettext (2.1.0) gettext_activerecord (2.1.0) gettext_rails (2.1.0) locale (2.0.5) locale_rails (2.0.5) log4r (1.1.5) mongrel (1.1.5) rack (1.0.1) rails (2.3.5, 1.2.5) rake (0.8.7) ruby-postgres (0.7.1.2006.04.06)

Then I try to restart the server:

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?

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.

Did you add init_gettext to the application controller? class ApplicationController < ActionController::Base   init_gettext "aaa_arb" end

Sharagoz -- wrote:

Did you add init_gettext to the application controller? class ApplicationController < ActionController::Base   init_gettext "aaa_arb" end

It was already there.

Sharagoz -- wrote:

Did you add init_gettext to the application controller? class ApplicationController < ActionController::Base   init_gettext "aaa_arb" end

Hi Sharagoz,

I followed the recommendations to migrate to rails 2.3 with gettext here: http://www.yotabanana.com/hiki/ruby-gettext-rails-migration.html

But I still get the error below. At line 69 of environment.rb is:    config.gem "locale_rails"

Any ideas?

Sharagoz -- wrote:

Did you add init_gettext to the application controller? class ApplicationController < ActionController::Base   init_gettext "aaa_arb" end

Ok, error from my part, the RAILS_GEM_VERSION variable in environment.rb was left by mistake to 2.0.1.

I uninstalled rails 2.0.1, and commented the RAILS_GEM_VERSION variable in environment.rb

I also updated config/boot.rb   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   Your config/boot.rb is outdated: Run "rake rails:update".

  C:\rails_apps\aaa_arb>rake rails:update   (in C:/rails_apps/aaa_arb)   install -c -m 0755 C:/Ruby/lib/ruby/gems/1.8/gems/rails2.3.5/lib/tasks/../../bin/dbconsole script/dbconsole

Now here is the error I get. Any clue ?

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/associations .rb:1506:in `configure_dependency_for_belongs_to': The :dependent option expects either :destroy or :delete (:nullify) (ArgumentError)         from C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record /associations.rb:1046:in `belongs_to'         from (eval):3:in `belongs_to'         from C:/rails_apps/aaa_arb/app/models/primer_plate.rb:5         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:25         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'         from script/server:3