legacy_data
legacy_data copied to clipboard
Doesn't work anymore with Rails 4.x
This is what happens:
$ rails g models_from_tables
"******************************************************************"
"The 'matthuhiggins-foreigner' gem has changed names to 'foreigner'"
"Install the renamed gem using 'gem install foreigner'"
"******************************************************************"
/home/sixtyfive/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:570:in `retrieve_connection': No connection pool for ActiveRecord::Base (ActiveRecord::ConnectionNotEstablished)
from /home/sixtyfive/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.3/lib/active_record/connection_handling.rb:113:in `retrieve_connection'
from /home/sixtyfive/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.3/lib/active_record/connection_handling.rb:87:in `connection'
from /home/sixtyfive/.rvm/gems/ruby-2.2.0/gems/legacy_data-0.1.11/lib/legacy_data.rb:9:in `block in <module:ActiveRecord>'
from /home/sixtyfive/.rvm/gems/ruby-2.2.0/gems/legacy_data-0.1.11/lib/legacy_data.rb:8:in `class_eval'
from /home/sixtyfive/.rvm/gems/ruby-2.2.0/gems/legacy_data-0.1.11/lib/legacy_data.rb:8:in `<module:ActiveRecord>'
from /home/sixtyfive/.rvm/gems/ruby-2.2.0/gems/legacy_data-0.1.11/lib/legacy_data.rb:7:in `<top (required)>'
from /home/sixtyfive/.rvm/gems/ruby-2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:76:in `require'
from /home/sixtyfive/.rvm/gems/ruby-2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from /home/sixtyfive/.rvm/gems/ruby-2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:72:in `each'
from /home/sixtyfive/.rvm/gems/ruby-2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:72:in `block in require'
from /home/sixtyfive/.rvm/gems/ruby-2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:61:in `each'
from /home/sixtyfive/.rvm/gems/ruby-2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:61:in `require'
from /home/sixtyfive/.rvm/gems/ruby-2.2.0/gems/bundler-1.10.6/lib/bundler.rb:134:in `require'
from /home/sixtyfive/tmp/msa-legacy-db-access/config/application.rb:7:in `<top (required)>'
from /home/sixtyfive/.rvm/gems/ruby-2.2.0/gems/spring-1.3.6/lib/spring/application.rb:82:in `require'
from /home/sixtyfive/.rvm/gems/ruby-2.2.0/gems/spring-1.3.6/lib/spring/application.rb:82:in `preload'
from /home/sixtyfive/.rvm/gems/ruby-2.2.0/gems/spring-1.3.6/lib/spring/application.rb:143:in `serve'
from /home/sixtyfive/.rvm/gems/ruby-2.2.0/gems/spring-1.3.6/lib/spring/application.rb:131:in `block in run'
from /home/sixtyfive/.rvm/gems/ruby-2.2.0/gems/spring-1.3.6/lib/spring/application.rb:125:in `loop'
from /home/sixtyfive/.rvm/gems/ruby-2.2.0/gems/spring-1.3.6/lib/spring/application.rb:125:in `run'
from /home/sixtyfive/.rvm/gems/ruby-2.2.0/gems/spring-1.3.6/lib/spring/application/boot.rb:18:in `<top (required)>'
from /home/sixtyfive/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /home/sixtyfive/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from -e:1:in `<main>'
@sixtyfive I'm glad that you're finding this gem useful. I have to be honest that I haven't looked at it in several years. I'm sorry but I don't have the time to figure out what's going on and bring this up to date. I'd be more than happy if you want to fork & update this yourself and would be happy to make you the owner on rubygems so you could then push your changes.
I expect this is not the answer you are hoping for and I'm sorry I don't have the time to be of more help.
Alex, thank you for responding! Unfortunately I'm in a similar position time-wise (as probably a lot of people interested in a gem like this one might be). At least now this issue exists, so perhaps someone decides to step up...
For anyone finding this, I have successfully used this gem to build models in a dummy Rails3 app, which I then modified and dropped into a new Rails4 app. Some awk/sed steps help with this. See my comment in other thread in this issue for some steps that worked for me: https://github.com/alexrothenberg/legacy_data/issues/4