anlek / mongify

Mongify allows you to map your data from a sql database and into a mongodb document database.
http://github.com/anlek/mongify
MIT License
317 stars 82 forks source link

error worker.rb:62:in `execute': private method `print' called for nil:NilClass (NoMethodError) #112

Open tomaszjacek opened 7 years ago

tomaszjacek commented 7 years ago

Hi All,

on mac osx ElCapitan I have installed ruby-2.2.2 and mongify-1.3.0

when checking configuration file with command "mongify check database.cfg" I'm receiving "NoSQL connection works". does it mean thats connection to oracle and mongodb was established or NOT established?

after I run command " mongify translation database.cfg" I got /Users/tomasz/.rvm/gems/ruby-2.2.2/gems/mongify-1.3.0/lib/mongify/cli/command/worker.rb:62:in execute': private methodprint' called for nil:NilClass (NoMethodError) from /Users/tomasz/.rvm/gems/ruby-2.2.2/gems/mongify-1.3.0/lib/mongify/cli/application.rb:28:in execute!' from /Users/tomasz/.rvm/gems/ruby-2.2.2/gems/mongify-1.3.0/bin/mongify:15:in<top (required)>' from /Users/tomasz/.rvm/gems/ruby-2.2.2/bin/mongify:23:in load' from /Users/tomasz/.rvm/gems/ruby-2.2.2/bin/mongify:23:in

' from /Users/tomasz/.rvm/gems/ruby-2.2.2/bin/ruby_executable_hooks:15:in eval' from /Users/tomasz/.rvm/gems/ruby-2.2.2/bin/ruby_executable_hooks:15:in
'

uncle google has no adivce how to solve this problem... Can you help me with it?

Thank you,

tj

anlek commented 7 years ago

Hey Tomasz, I'm not sure what's going on but it might have to do with something gems you have installed on your system. I've released a new version of mongify which locks down the gem requirements. Trying updating (gem install mongify) Mongify to 1.3.1 and see if it fixes this for you. If not, let me know and we'll dive deeper.

sanjusoftware commented 7 years ago

I have mongify (1.3.1) in the gemfile and I still get this same error on running mongify translation database.config .. any idea how to resolve this? I am on a MAC too and my Gemfile looks like this:

source 'https://rubygems.org'

gem 'mongify', '~> 1.3.1'
gem 'ruby-oci8', '~> 2.2', '>= 2.2.2'
gem 'activerecord-oracle_enhanced-adapter'

here's the screenshot of the error:

image

sanjusoftware commented 7 years ago

I guess the error I was getting was because the Oracle connection was not successful in the first place. this results into @config.sql_connection being null and thus resulting into that error

anlek commented 7 years ago

I haven't actually used Mongify inside a bundle app, so it's likely to do with the STDOUT or STDERR not being set and therefore causing it to crash. I can't be 100% sure though.

Try just doing gem install mongify and running the mongify command.

anlek commented 7 years ago

I stand corrected, it seems that the sql connection didn't load correctly (maybe database.config was missing?)

sanjusoftware commented 7 years ago

That is true @anlek although what can be made better is to make more checks and right error messages ... e.g don't try to call methods if the connection object is nil... may a PR from me will cover some of these and a bit more :)

anlek commented 7 years ago

Hey @sanjusoftware, I've been dealing with a few higher priority things at work so that a PR would be amazing!