From mail at paulhart.ca Mon Dec 19 15:25:01 2005 From: mail at paulhart.ca (Paul Hart) Date: Mon, 19 Dec 2005 15:25:01 -0500 Subject: [Schemagenerator-users] Issues with schema generator Message-ID: <43A7171D.9030701@paulhart.ca> Scott, Well, now there's two of us! :) I'm having problems with the schema generator. As an FYI, I'm attempting to use it to create my initial schema (so I can start by doing the Right Thing). My rails app is configured to use PostgreSQL, and I have the appropriate gem installed for that (and config/database.yml is pointing in the right place). Other environmental stuff: Rails 1.0, Ruby 1.8.3, Gentoo Linux, PowerPC. I perform the following commands: rails cd vi config/database.yml # fix up to point at my PostgreSQL DB script/generate migration initial_schema vi db/migrate/001_initial_schema.rb script/generate schema If I don't have the mysql gem installed... nothing happens. No output, no files generated. If I have the mysql gem installed (version 2.7), I get a nasty stack trace which I've pasted at the bottom of this message (along with the rest of the output). There are a couple of things with this output: firstly, it seems that the generator isn't picking up the file at all (the migration tool seems to start at '001' rather than '0' now). Secondly, if I "fix" the MySqlAdapter call and give it four parameters, then it whines with a different error. Suggestions? I'd really like this to work ;) Thanks, Paul Found 0 migration classes Migrations complete. Tables found: 0 Indexes found: 0 Records found: 0 exists db create db/schema.postgresql.sql create db/schema.mysql.sql Error: wrong number of arguments (3 for 4) /usr/lib/ruby/gems/1.8/gems/schema_generator-0.9.0/schema_generator.rb:259:in `initialize' /usr/lib/ruby/gems/1.8/gems/schema_generator-0.9.0/schema_generator.rb:259:in `dump' (erb):8:in `template' /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/rails_generator/commands.rb:271:in `template' /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/rails_generator/commands.rb:221:in `file' /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/rails_generator/commands.rb:219:in `file' /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/rails_generator/commands.rb:218:in `file' /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/rails_generator/commands.rb:268:in `template' /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/rails_generator/manifest.rb:47:in `send_actions' /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/rails_generator/manifest.rb:46:in `send_actions' /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/rails_generator/manifest.rb:31:in `replay' /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/rails_generator/commands.rb:41:in `invoke!' /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/rails_generator/scripts/../scripts.rb:31:in `run' /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/commands/generate.rb:6 /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require' /usr/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:214:in `require' script/generate:3 create db/schema.sqlite.sql create db/schema.rb From whitley at acm.org Mon Dec 19 19:05:16 2005 From: whitley at acm.org (John Whitley) Date: Mon, 19 Dec 2005 16:05:16 -0800 Subject: [Schemagenerator-users] Issues with schema generator Message-ID: Paul Hart writes: > I'm having problems with the schema generator. [...] Other > environmental stuff: Rails 1.0, Ruby 1.8.3, Gentoo Linux, PowerPC. Short form: Paul, try downgrading Rails to 0.14.4 as a temporary workaround. Details: Paul's onto something -- I was also running PostgreSQL without the mysql gem installed. Recently I did a reinstall of ruby on my Mac to fix some problems; I didn't reinstall mysql support. I downgraded Rails + deps to 0.14.4, and again encountered the no output problem. Once I installed the mysql gem, schema generator worked properly. I then (re-)upgraded to Rails 1.0 and also received the same error as Paul: "Error: wrong number of arguments (3 for 4)". Thus there are two issues: 1) an implicit dependency (== not represented in gem dependencies) on a mysql driver being present, and 2) an interface incompatibility introduced in Rails 1.0. -- John Installed gem versions exhibiting problems with schema generator and Rails 1.0: *** LOCAL GEMS *** actionmailer (1.1.5) actionpack (1.11.2) actionwebservice (1.0.0) activerecord (1.13.2) activesupport (1.2.5) fcgi (0.8.6.1) mysql (2.7) needle (1.2.1) net-ssh (1.0.3) postgres-pr (0.4.0) rails (1.0.0) rake (0.6.2) schema_generator (0.9.0) sources (0.0.1) switchtower (0.9.0) From mail at paulhart.ca Tue Dec 20 10:18:17 2005 From: mail at paulhart.ca (Paul Hart) Date: Tue, 20 Dec 2005 10:18:17 -0500 Subject: [Schemagenerator-users] Issues with schema generator In-Reply-To: References: Message-ID: <43A820B9.4070806@paulhart.ca> John Whitley wrote: > Paul Hart writes: > >>I'm having problems with the schema generator. [...] Other >>environmental stuff: Rails 1.0, Ruby 1.8.3, Gentoo Linux, PowerPC. > > Short form: Paul, try downgrading Rails to 0.14.4 as a temporary > workaround. John, Thanks for the suggestion. I pulled out all of my rails-related gems, and installed 0.14.4 exclusively (I had a lot of cruft in there). It didn't really help though, I'm getting the "uninitialized constant Mysql" error message. Might be that the version of activesupport that was installed by default was 1.2.4 rather than the 1.2.5 that you listed in your email. I've put back rails 1.0 and its dependencies for now. The other question still unanswered is why the generator isn't finding my migration script. My file is in the default location, db/migrate/001_initial_schema.rb in my case, but when I run the schema generator the first line is "Found 0 migration classes" and then all the rest of the outputs are also zeros. All very weird. I'm tempted to hack out the mysql schema generation for my own purposes, but that leaves the unprocessed migration. For the record, here is my current list of gems: actionmailer (1.1.5) actionpack (1.11.2) actionwebservice (1.0.0) activerecord (1.13.2) activesupport (1.2.5) gruff (0.0.7) mysql (2.7) postgres (0.7.1) rails (1.0.0) rake (0.6.2, 0.5.4) RedCloth (3.0.4) schema_generator (0.9.0) sources (0.0.1) tzinfo (0.1.1, 0.0.4) Thanks, Paul From scott at sigkill.org Sat Dec 31 11:41:40 2005 From: scott at sigkill.org (Scott Laird) Date: Sat, 31 Dec 2005 08:41:40 -0800 Subject: [Schemagenerator-users] Issues with schema generator In-Reply-To: References: Message-ID: On Dec 19, 2005, at 4:05 PM, John Whitley wrote: > Paul Hart writes: >> I'm having problems with the schema generator. [...] Other >> environmental stuff: Rails 1.0, Ruby 1.8.3, Gentoo Linux, PowerPC. > > Short form: Paul, try downgrading Rails to 0.14.4 as a temporary > workaround. > > Details: > Paul's onto something -- I was also running PostgreSQL without the > mysql gem installed. Recently I did a reinstall of ruby on my Mac to > fix some problems; I didn't reinstall mysql support. > > I downgraded Rails + deps to 0.14.4, and again encountered the no > output problem. Once I installed the mysql gem, schema generator > worked properly. I then (re-)upgraded to Rails 1.0 and also received > the same error as Paul: "Error: wrong number of arguments (3 for 4)". > > Thus there are two issues: 1) an implicit dependency (== not > represented in gem dependencies) on a mysql driver being present, and > 2) an interface incompatibility introduced in Rails 1.0. I just released version 1.0.1 of the schema generator; this *should* be compatible with Rails 1.0 *and* it should remove the implicit MySQL dependancy. Sorry for the delay. Scott