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

Unable to use mongify under Centos 7 (originally reported as /usr/local/share/gems/gems/mongify-1.3.1/lib/mongify/cli/application.rb:34: stack level too deep (SystemStackError)) #153

Closed allthatnet closed 6 years ago

allthatnet commented 7 years ago

gem uninstall mongify

Remove executables: mongify

in addition to the gem? [Yn] y Removing mongify Successfully uninstalled mongify-1.3.2

gem install mongify

Fetching: mongify-1.3.2.gem (100%) Successfully installed mongify-1.3.2 Parsing documentation for mongify-1.3.2 Installing ri documentation for mongify-1.3.2 Done installing documentation for mongify after 1 seconds 1 gem installed

mongify translation database.config

/usr/local/bin/mongify:23:in load': cannot load such file -- /usr/local/share/gems/gems/mongify-1.3.1/bin/mongify (LoadError) from /usr/local/bin/mongify:23:in

'

anlek commented 7 years ago

That's odd, try running a cleanup via gem cleanup mongify, then uninstall and reinstall. Also, it might be an issue if you're using rbenv, you need to run rbenv rehash to re-setup the bins.

allthatnet commented 6 years ago

OK, there may have been some environment issues. I did not set up rbenv explicitely, but some gems required ruby-2.2, so I had rh-ruby22-ruby set up from SCL resposistory.

Here is the full(-er) stack now:

/opt/rh/rh-ruby22/root/usr/local/share/gems/gems/activerecord-4.2.9/lib/active_record/type/type_map.rb:48:in each': stack level too deep (SystemStackError) from /opt/rh/rh-ruby22/root/usr/local/share/gems/gems/activerecord-4.2.9/lib/active_record/type/type_map.rb:48:inreverse_each' from /opt/rh/rh-ruby22/root/usr/local/share/gems/gems/activerecord-4.2.9/lib/active_record/type/type_map.rb:48:in each' from /opt/rh/rh-ruby22/root/usr/local/share/gems/gems/activerecord-4.2.9/lib/active_record/type/type_map.rb:48:indetect' from /opt/rh/rh-ruby22/root/usr/local/share/gems/gems/activerecord-4.2.9/lib/active_record/type/type_map.rb:48:in perform_fetch' from /opt/rh/rh-ruby22/root/usr/local/share/gems/gems/activerecord-4.2.9/lib/active_record/type/type_map.rb:19:inblock in fetch' from /opt/rh/rh-ruby22/root/usr/local/share/gems/gems/thread_safe-0.3.6/lib/thread_safe/cache.rb:66:in block in fetch_or_store' from /opt/rh/rh-ruby22/root/usr/local/share/gems/gems/thread_safe-0.3.6/lib/thread_safe/cache.rb:56:infetch' from /opt/rh/rh-ruby22/root/usr/local/share/gems/gems/thread_safe-0.3.6/lib/thread_safe/cache.rb:65:in fetch_or_store' ... 8855 levels... from /opt/rh/rh-ruby22/root/usr/local/share/gems/gems/mongify-1.3.2/lib/mongify/cli/application.rb:28:inexecute!' from /opt/rh/rh-ruby22/root/usr/local/share/gems/gems/mongify-1.3.2/bin/mongify:17:in <top (required)>' from /usr/local/bin/mongify:23:inload' from /usr/local/bin/mongify:23:in `

'

anlek commented 6 years ago

I'm sorry to say, but this is outside of my skill set.

The only thing I can think of is that one of your field names (in the database) is similar to something that ActiveRecord uses (like table_name or connection), this makes the system reference itself.

If you are OK with sharing your database schema, I can try to see if I can see something there.

Good luck, Andrew

allthatnet commented 6 years ago

It turned out to be an issue with the schema. I confirmed it by gradually translating more and more tables, starting with just one, until I uncovered the one that was causing problems. Then, similarly modified the schema for the "faulty" table until I found a field definition that was causing a problem.

anlek commented 6 years ago

I appreciate you taking the time to track it down, let me know if you find anything.