ruby 1.9.3 uninitialized constant ETL::Control::Context::Rails (NameError)

92 views
Skip to first unread message

sgrgic

unread,
Apr 16, 2012, 9:16:47 AM4/16/12
to activewareh...@googlegroups.com
Hi,

After updating ruby from ree-1.8.7-2011.03 to ruby-1.9.3-p125 I got following error while executing etl job:
/Users/sgrgic/.rvm/gems/ruby-1.9.3-p125@DWR3/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require': cannot load such file -- db/etl/../../config/environment.rb (LoadError)
(all ctl files are places in db/etl folder).
After replacing: 
require File.join(File.dirname(__FILE__), '../../config/environment.rb')
with
require Rails.root.to_s + "/config/environment"
in ctl file, I got this error:
`get_binding': uninitialized constant ETL::Control::Context::Rails (NameError)

Any ideas what might be wrong when ruby is upgraded from 1.8.7 to 1.9.3?

Here is stack trace for last error message:
db/etl/load_roles.ctl:3:in `get_binding': uninitialized constant ETL::Control::Context::Rails (NameError)
from /Users/sgrgic/.rvm/gems/ruby-1.9.3-p125@DWR3/bundler/gems/activewarehouse-etl-1ba5f77ebe7c/lib/etl/control/control.rb:286:in `eval'
from /Users/sgrgic/.rvm/gems/ruby-1.9.3-p125@DWR3/bundler/gems/activewarehouse-etl-1ba5f77ebe7c/lib/etl/control/control.rb:286:in `parse'
from /Users/sgrgic/.rvm/gems/ruby-1.9.3-p125@DWR3/bundler/gems/activewarehouse-etl-1ba5f77ebe7c/lib/etl/control/control.rb:312:in `resolve'
from /Users/sgrgic/.rvm/gems/ruby-1.9.3-p125@DWR3/bundler/gems/activewarehouse-etl-1ba5f77ebe7c/lib/etl/engine.rb:294:in `process_control'
from /Users/sgrgic/.rvm/gems/ruby-1.9.3-p125@DWR3/bundler/gems/activewarehouse-etl-1ba5f77ebe7c/lib/etl/engine.rb:262:in `process'
from /Users/sgrgic/.rvm/gems/ruby-1.9.3-p125@DWR3/bundler/gems/activewarehouse-etl-1ba5f77ebe7c/lib/etl/engine.rb:260:in `process'
from /Users/sgrgic/.rvm/gems/ruby-1.9.3-p125@DWR3/bundler/gems/activewarehouse-etl-1ba5f77ebe7c/lib/etl/engine.rb:55:in `process'
from /Users/sgrgic/.rvm/gems/ruby-1.9.3-p125@DWR3/bundler/gems/activewarehouse-etl-1ba5f77ebe7c/lib/etl/commands/etl.rb:82:in `block in execute'
from /Users/sgrgic/.rvm/gems/ruby-1.9.3-p125@DWR3/bundler/gems/activewarehouse-etl-1ba5f77ebe7c/lib/etl/commands/etl.rb:80:in `each'
from /Users/sgrgic/.rvm/gems/ruby-1.9.3-p125@DWR3/bundler/gems/activewarehouse-etl-1ba5f77ebe7c/lib/etl/commands/etl.rb:80:in `execute'
from /Users/sgrgic/.rvm/gems/ruby-1.9.3-p125@DWR3/bundler/gems/activewarehouse-etl-1ba5f77ebe7c/lib/etl/commands/etl.rb:89:in `<top (required)>'
from /Users/sgrgic/.rvm/gems/ruby-1.9.3-p125@DWR3/bundler/gems/activewarehouse-etl-1ba5f77ebe7c/bin/etl:28:in `<top (required)>'
from /Users/sgrgic/.rvm/gems/ruby-1.9.3-p125@DWR3/bin/etl:19:in `load'
from /Users/sgrgic/.rvm/gems/ruby-1.9.3-p125@DWR3/bin/etl:19:in `<main>'

Regards,
Sinisa.

sgrgic

unread,
Apr 16, 2012, 9:21:33 AM4/16/12
to activewareh...@googlegroups.com
Forgot to add here my environment. Ruby as mention before is ruby-1.9.3-p125, Rails 3.1.0 and I just tried same ctl job
with activewarehouse-etl-0.9.1 and got same error.

Sinisa.

Thibaut Barrère

unread,
Apr 16, 2012, 9:23:24 AM4/16/12
to activewareh...@googlegroups.com
Hi Sinisa!
 
require Rails.root.to_s + "/config/environment"

my understanding is that Rails is not yet defined, because requiring the environment will probably define it.

Try sticking with:

require File.join(File.dirname(__FILE__), '../../config/environment.rb')

and let us know how it goes!

(I will be able to help out a bit more in depth tonight).

Thibaut
--

sgrgic

unread,
Apr 16, 2012, 10:18:44 AM4/16/12
to activewareh...@googlegroups.com
Right, Rails is not yet defined, this solves problem:
require File.expand_path("../../../config/environment", __FILE__)

Thanks for quick reply!

Sinisa.
Reply all
Reply to author
Forward
0 new messages