# Gloc bug?

**URL:** <https://www.ruby-forum.com/t/gloc-bug/77671>\
**Category:** Rails I18n\
**Created:** [November 29, 2006, 5:05pm UTC](https://www.ruby-forum.com/t/gloc-bug/77671 "2006-11-29T17:05:49Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![temesta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e9bcb4/32.png) [@temesta](https://www.ruby-forum.com/u/temesta)\
**Post date:** [November 29, 2006, 5:05pm UTC](https://www.ruby-forum.com/t/gloc-bug/77671/1 "2006-11-29T17:05:49Z")

</div>

Hi,

I use Gloc plugin to create some localisation and it works great on my  
local webbrick server. Unfortunately It doesn’t work anymore when I  
upload the gloc dir to vendor/plugins on my host. I always get this  
error:

“uninitialized constant GLoc”

The error occures when environment.rb is executing this:

```
GLoc.set_config :default_language => :nl
GLoc.clear_strings_except :fr, :nl
GLoc.set_kcode
GLoc.load_localized_strings

```

Did I miss something? I’m getting really frustrated because my whole app  
uses Gloc

greetings,

Temmesta

---

<div class="post-metadata">

**Author:** ![temesta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e9bcb4/32.png) [@temesta](https://www.ruby-forum.com/u/temesta)\
**Post date:** [November 29, 2006, 11:13pm UTC](https://www.ruby-forum.com/t/gloc-bug/77671/2 "2006-11-29T23:13:22Z")

</div>

Hi,

Sounds like the plugin isn’t being initialised. So you’re sure it’s in  
vendor/plugins/gloc/\* ?  
Maybe you should modify gloc’s init.rb and just add a line to output  
loaded or something so that you know if it’s being called or not. Ur  
host might’ve set things up differently somehow (?). If it’s not being  
called you could just manually add it to the load path and require it.

Golly

---

<div class="post-metadata">

**Author:** ![temesta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e9bcb4/32.png) [@temesta](https://www.ruby-forum.com/u/temesta)\
**Post date:** [November 30, 2006, 1:46pm UTC](https://www.ruby-forum.com/t/gloc-bug/77671/3 "2006-11-30T13:46:28Z")

</div>

I’m happy that you replied so quick :). I’m absolutely sure it’s in  
vendor/plugins/gloc . I’m a rails newbie so I’m not sure how I can  
output  
something from the init.rb. I can’t do puts ‘blablabla’ because I won’t  
be able  
to see server output with my dreamhost account. So then I tried to to  
add this in my environment.rb :

config.load\_paths += %W(  
{RAILS\_ROOT}/vendor/plugins/gloc  
{RAILS\_ROOT}/vendor/plugins/gloc/lib  
)

this didn’t work :(. I also tried other plugins and they work so I’m not  
sure  
it’s a problem with my host. Any suggestions?

Temesta

---

<div class="post-metadata">

**Author:** ![temesta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e9bcb4/32.png) [@temesta](https://www.ruby-forum.com/u/temesta)\
**Post date:** [December 9, 2006, 2:15pm UTC](https://www.ruby-forum.com/t/gloc-bug/77671/4 "2006-12-09T14:15:11Z")

</div>

David B. wrote:

> Hmm, it’s really wierd that other plugins are loading but GLoc isn’t…  
> ok, try just adding the gloc paths to the load path and manually  
> require it then. Again it’s very odd that that’s happening.
> 
> And also u can u can just use puts to see if the init file is being  
> loaded but you can output text to a file and check that instead. good  
> luck 🙂
> 
> Golly

I tried everything you said but it still doesn’t work :(. I could give  
you temporary acces to my files so you could take a quick look at it. I  
would really appreciate it if you want to do this. Let me know something  
and I’ll e-mail you a login and passw. I’ll create simple gloc test  
controller & view so you can see it doesn’t work.

greetings,

Temesta

---

<div class="post-metadata">

**Author:** ![temesta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e9bcb4/32.png) [@temesta](https://www.ruby-forum.com/u/temesta)\
**Post date:** [December 7, 2006, 4:31am UTC](https://www.ruby-forum.com/t/gloc-bug/77671/5 "2006-12-07T04:31:20Z")

</div>

Hmm, it’s really wierd that other plugins are loading but GLoc isn’t…  
ok, try just adding the gloc paths to the load path and manually  
require it then. Again it’s very odd that that’s happening.

And also u can u can just use puts to see if the init file is being  
loaded but you can output text to a file and check that instead. good  
luck 🙂

Golly

---

<div class="post-metadata">

**Author:** ![temesta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e9bcb4/32.png) [@temesta](https://www.ruby-forum.com/u/temesta)\
**Post date:** [December 9, 2006, 4:19pm UTC](https://www.ruby-forum.com/t/gloc-bug/77671/6 "2006-12-09T16:19:31Z")

</div>

yeah ok thats cool, just email me then at japgolly at\_ [gmail.com](http://gmail.com)  
I’ll take a look when I get time. 😉

Golly

---

<div class="post-metadata">

**Author:** ![temesta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e9bcb4/32.png) [@temesta](https://www.ruby-forum.com/u/temesta)\
**Post date:** [May 2, 2008, 6:41pm UTC](https://www.ruby-forum.com/t/gloc-bug/77671/7 "2008-05-02T18:41:25Z")

</div>

> The error occures when environment.rb is executing this:
> 
> ```
> GLoc.set_config :default_language => :nl
> GLoc.clear_strings_except :fr, :nl
> GLoc.set_kcode
> GLoc.load_localized_strings
> 
> ```

GLoc.set\_config :default\_language =\> :es  
GLoc.clear\_strings\_except :en, :es  
GLoc.set\_kcode  
GLoc.load\_localized\_strings

I am using Rails 2.0.2 and put the initialization in environment.rb. I  
get an error:

/Library/Ruby/Site/1.8/rubygems/custom\_require.rb:27:in  
`gem\_original\_require’:  
/Users/billdavenport/Projects/gloc/config/environment.rb:13: syntax  
error, unexpected tCONSTANT, expecting ‘)’ (SyntaxError)  
GLoc.set\_config :default\_language =\> :es

Not sure what’s going on. I have the block outside of my  
Initializer.run

---

<div class="post-metadata">

**Author:** ![temesta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e9bcb4/32.png) [@temesta](https://www.ruby-forum.com/u/temesta)\
**Post date:** [May 2, 2008, 6:56pm UTC](https://www.ruby-forum.com/t/gloc-bug/77671/8 "2008-05-02T18:56:25Z")

</div>

Do you have the following in your  
RAILS\_ROOT/vendor/plugins/gloc/init.rb  
require ‘gloc’  
require ‘gloc-ruby’  
require ‘gloc-rails’  
require ‘gloc-rails-text’

Bill Davenport wrote:

> > The error occures when environment.rb is executing this:
> > 
> > ```
> > GLoc.set_config :default_language => :nl
> > GLoc.clear_strings_except :fr, :nl
> > GLoc.set_kcode
> > GLoc.load_localized_strings
> > 
> > ```
> 
> GLoc.set\_config :default\_language =\> :es  
> GLoc.clear\_strings\_except :en, :es  
> GLoc.set\_kcode  
> GLoc.load\_localized\_strings
> 
> I am using Rails 2.0.2 and put the initialization in environment.rb. I  
> get an error:
> 
> /Library/Ruby/Site/1.8/rubygems/custom\_require.rb:27:in  
> `gem\_original\_require’:  
> /Users/billdavenport/Projects/gloc/config/environment.rb:13: syntax  
> error, unexpected tCONSTANT, expecting ‘)’ (SyntaxError)  
> GLoc.set\_config :default\_language =\> :es
> 
> Not sure what’s going on. I have the block outside of my  
> Initializer.run

---

<div class="post-metadata">

**Author:** ![temesta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e9bcb4/32.png) [@temesta](https://www.ruby-forum.com/u/temesta)\
**Post date:** [May 2, 2008, 8:02pm UTC](https://www.ruby-forum.com/t/gloc-bug/77671/9 "2008-05-02T20:02:54Z")

</div>

I have this in my /vendor/plugins/gloc/init.rb

# Copyright © 2005-2007 David B.

require ‘gloc’  
require ‘gloc-ruby’  
require ‘gloc-rails’  
require ‘gloc-rails-text’

require ‘gloc-dev’ if ENV[‘RAILS\_ENV’] == ‘development’

GLoc.set\_language\_mode :simple  
GLoc.load\_gloc\_default\_localized\_strings

V. Vincesf wrote:

> Do you have the following in your  
> RAILS\_ROOT/vendor/plugins/gloc/init.rb  
> require ‘gloc’  
> require ‘gloc-ruby’  
> require ‘gloc-rails’  
> require ‘gloc-rails-text’

---

<div class="post-metadata">

**Author:** ![temesta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e9bcb4/32.png) [@temesta](https://www.ruby-forum.com/u/temesta)\
**Post date:** [May 2, 2008, 9:21pm UTC](https://www.ruby-forum.com/t/gloc-bug/77671/10 "2008-05-02T21:21:50Z")

</div>

Seems that I had deleted a ) in my environment.rb file.

However, a new error has cropped up when I do a script/server.

/Library/Ruby/Gems/1.8/gems/activesupport-2.0.2/lib/active\_support/dependencies.rb:266:in  
`load\_missing\_constant’: uninitialized constant GLoc (NameError)

bill

V. Vincesf wrote:

> Do you have the following in your  
> RAILS\_ROOT/vendor/plugins/gloc/init.rb  
> require ‘gloc’  
> require ‘gloc-ruby’  
> require ‘gloc-rails’  
> require ‘gloc-rails-text’
