rails 2.1, goldberg but no postgres

Sure it’s a strange combination but mysql is most people’s favourite and goldberg is my very personal favourite.

Anyways, today I was upgrading to rails 2.1.0 and guess what, it didn’t work anymore cause some pg was being required which I don’t have. The problem has basically two causes. First the rails devs added a few lines to the postgresql connection adapter to enforce loading the pg or postgresql gem. Second, goldberg was a bit sloppy with its model monkeypatching. The fix is very simple, just a few changes to lib/goldberg/model.rb basically adding the check that goldberg is using in it’s migration extensions anyways.

You can find my patch over at goldberg’s rubyforge bugtracker

Update: A few more issues came up, so you might just want to git clone git://github.com/TomK32/goldberg.git my github repository into vendor/generators and use it like normal.

2 Responses to “rails 2.1, goldberg but no postgres”

  1. John Devine Says:

    Firstly thanks for your work!

    I am still having trouble with Rails 2.1.0 and the goldberg from your above repository.

    The error I am getting is:

    L:\tmp\tester2> rake goldberg:install (in L:/tmp/tester2) rake aborted! undefined method `initialize_schema_information’ for module `ActiveRecord::ConnectionAdapters::SchemaStatements’

    =====

    The install is: Windows XP Ruby one click installer (ruby186-26.exe) gem update—no-rdoc (to get the latest) gem install rails—include-dependencies—no-rdoc (Gets rails 2.1.0) gem install fastercsv—include-dependencies—no-rdoc gem install mini_magick—include-dependencies—no-rdoc gem install mysql—include-dependencies—no-rdoc

    Then: —git your repository gem build goldberg_generator-0.2.2.gemspec gem install goldberg_generator -l

    Then: rails test2 cd test2 ruby.exe script\generate goldberg template ewnf edit the database/database.yml for mysql Then: get the error executing “rake goldberg:install”

    Any help is good help!!

    Cheers

    John

  2. Prabin Deka Says:

    Did you guys find out a solution for this? I have the exact same problem and its pissing me off! cheers Prabin

Leave a Reply