uninitialized constant BackgrounDRb

April 18, 2009 – 2:23 am

Over the course of its lifespan, Backgroundrb has understandly transformed as new features and enhancements are implemented. However, if you are an earlier adopter, you might run into issues if you have a earlier version of backgroundrb and subsequently install newer versions of the dependencies that backgroundrb relies on.

I ran into this issue when migrating a legacy codebase onto a new CentOS 5.2 server. After copying over the codebase to the new server, I proceed to install all the required gems and fired up mongrel_cluster, which worked fine. However, upon attempting to start backgroundrb, the following errors were registered in the backgroundrb server log.

activesupport-2.0.2/lib/active_support/dependencies.rb:478:in `const_missing’: uninitialized constant BackgrounDRb::MasterWorker::BinParser (NameError)

from /current/vendor/plugins/backgroundrb/server/lib/master_worker.rb:148:in `post_init’

from /lib/ruby/gems/1.8/gems/packet-0.1.15/lib/packet/packet_connection.rb:25:in `invoke_init’

from /lib/ruby/gems/1.8/gems/packet-0.1.15/lib/packet/packet_core.rb:334:in `decorate_handler’

from /lib/ruby/gems/1.8/gems/packet-0.1.15/lib/packet/packet_core.rb:78:in `accept_connection’

from /lib/ruby/gems/1.8/gems/packet-0.1.15/lib/packet/packet_core.rb:220:in `handle_external_messages’

from /lib/ruby/gems/1.8/gems/packet-0.1.15/lib/packet/packet_core.rb:196:in `handle_read_event’

from /lib/ruby/gems/1.8/gems/packet-0.1.15/lib/packet/packet_core.rb:192:in `each’

from /lib/ruby/gems/1.8/gems/packet-0.1.15/lib/packet/packet_core.rb:192:in `handle_r

It took me a while to figure out what the matter was, but eventually, comparing the gem versions in the old and new servers, I noticed that the original packet gem was 0.1.5 and the new one was 0.1.15. And seeing that packet is where the error originated, I uninstalled 0.1.15 and replaced with it 0.1.5

$> gem uninstall packet

$> gem install packet -v=0.1.5

And surely enough, with the older packet gem installed, backgroundrb server started up fine. I suppose a long term solution would be to upgrade to the latest version of backgroundrb but that would require refactoring all the current workers. I choose instead to live to fight another day.

VN:F [1.9.3_1094]
Rating: 3.5/5 (2 votes cast)
uninitialized constant BackgrounDRb, 3.5 out of 5 based on 2 ratings
  • Share/Bookmark

Post a Comment

Entries (RSS) and Comments (RSS) .