1

I'm in the middle of performing an edge ruby and rails update for a web app built in rails 2.3.18 and running ruby 1.9.3.

I have been incrementally been updating the rails version and fixing breaks and things have been moving forward at a steady pace. I have currently made it to ruby 2.1 and rails 3.2.x.x. and have made the push to rails 4.0.0

I have dealt with a lot of breaks and errors since the 4.0.0 update and can now get the server to start using rails s but I'm now getting a new error.

I cannot find literally anything about this error online so I'm hoping I'll have better luck here. Thx in advance.

This is the line in my controller that triggers this error. Keep in mind this is not my code. I'm updating a 8 year old system.

class WpPosts < ActiveRecord::Base
  establish_connection "blog"
end

This is the specific line that is firing off the error, but I get this error wherever the is any active record call. Even simply calling a model in rails console get me this same error.

Things like calling User in rails console get me that same error.

I have already tried:

gem install activerecord -v=4.0.0

and that still gets me the same error. I've also uninstalled all other versions of activerecord.

There is a very short stack trace which leads me to believe the railties lib is not loading. Or that maybe there's an issue with the path to that lib.

app/models/wp_posts.rb:1:in `<top (required)>'
app/controllers/default_controller.rb:28:in `start'

this is a screenshot of the top of my application.rb file

Screenshot of top of application.rb

Jason Aller
  • 3,541
  • 28
  • 38
  • 38
Verty00
  • 726
  • 5
  • 16
  • try `gem install activerecord` – Anurag Aryan Jan 17 '18 at 18:42
  • I have already tried that. `gem install activerecord -v=4.0.0` I still get the same error. – Verty00 Jan 17 '18 at 18:45
  • are you following the [Rails upgrade checklist](http://www.rails-upgrade-checklist.com/) and the [rails upgrade guide](http://edgeguides.rubyonrails.org/upgrading_ruby_on_rails.html)? – Tamer Shlash Jan 17 '18 at 20:08
  • Could you post the top of the file of your config/application.rb? Usually this is the place where the rails related things are required. Maybe there is some old code that needs update there. – smallbutton Jan 17 '18 at 20:37
  • @smallbutton.com I added(edited) the top of my application.rb file to the original question. – Verty00 Jan 17 '18 at 21:24
  • Ok that one looks fine to me. Is there a `require 'bundler/setup'` in that `boot` file that is referenced in the top of `application.rb` and how is rails required in your `Gemfile`? To me it often helps when generating a new rails project and doing a diff on all important files in your project to be updated. – smallbutton Jan 19 '18 at 08:09

0 Answers0