rake db:migrate strange behaviour "wrong number of arguments (1 for 0)"

Hi everybody,

May be somebody has a clue, why I get these errors below, while trying
to migrate.
Any help is very appreciated!

Greetinx

Rafael

I was trying to experiment a litte bit with redMine (www.redmine.org).
But I can only install it locally. On a system with already a
mongrel_cluster running, I get strange errors, already while trying to
start the migration rake db:migrate RAILS_ENV="production"

# rake db:migrate RAILS_ENV="production" --trace

(in /var/www/vhosts/beyoumedia.com/subdomains/ticketing/redmine-0.5.0)
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:migrate
rake aborted!
wrong number of arguments (1 for 0)
/usr/lib/ruby/site_ruby/1.8/active_record/vendor/mysql.rb:566:in
`initialize'
/usr/lib/ruby/site_ruby/1.8/active_record/vendor/mysql.rb:566:in `new'
/usr/lib/ruby/site_ruby/1.8/active_record/vendor/mysql.rb:566:in
`scramble41'
/usr/lib/ruby/site_ruby/1.8/active_record/vendor/mysql.rb:144:in
`real_connect'
/usr/lib/ruby/site_ruby/1.8/active_record/connection_adapters/
mysql_adapter.rb:389:in `connect'
/usr/lib/ruby/site_ruby/1.8/active_record/connection_adapters/
mysql_adapter.rb:152:in `initialize'
/usr/lib/ruby/site_ruby/1.8/active_record/connection_adapters/
mysql_adapter.rb:82:in `new'
/usr/lib/ruby/site_ruby/1.8/active_record/connection_adapters/
mysql_adapter.rb:82:in `mysql_connection'
/usr/lib/ruby/site_ruby/1.8/active_record/connection_adapters/abstract/
connection_specification.rb:262:in `send'
/usr/lib/ruby/site_ruby/1.8/active_record/connection_adapters/abstract/
connection_specification.rb:262:in `connection_without_query_cache='
/usr/lib/ruby/site_ruby/1.8/active_record/query_cache.rb:54:in
`connection='
/usr/lib/ruby/site_ruby/1.8/active_record/connection_adapters/abstract/
connection_specification.rb:230:in `retrieve_connection'
/usr/lib/ruby/site_ruby/1.8/active_record/connection_adapters/abstract/
connection_specification.rb:78:in `connection'
/usr/lib/ruby/site_ruby/1.8/active_record/migration.rb:284:in
`migrate'
/usr/lib/ruby/site_ruby/1.8/tasks/databases.rake:4
/usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in `call'
/usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in `each'
/usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:362:in `invoke'
/usr/lib/ruby/1.8/thread.rb:135:in `synchronize'
/usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:355:in `invoke'
/usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in `each'
/usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1761:in
`standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1733:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1711:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1761:in
`standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1708:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-0.7.3/bin/rake:7
/usr/bin/rake:16:in `load'
/usr/bin/rake:16

Hi Chris

Thank you for your reply.
Sorry but redmine has a hellot of migrations.
I also think, this come's from another part because, I tried it also
in the console to type in some commands... same error.
I guess something with the database connection is wrong, is there a
way to test the database connection?

thnx

# script/console production
Loading production environment.

User.find_all

ArgumentError: wrong number of arguments (1 for 0)
        from /usr/lib/ruby/site_ruby/1.8/active_record/vendor/mysql.rb:
566:in `initialize'
        from /usr/lib/ruby/site_ruby/1.8/active_record/vendor/mysql.rb:
566:in `new'
        from /usr/lib/ruby/site_ruby/1.8/active_record/vendor/mysql.rb:
566:in `scramble41'
        from /usr/lib/ruby/site_ruby/1.8/active_record/vendor/mysql.rb:
144:in `real_connect'
        from /usr/lib/ruby/site_ruby/1.8/active_record/
connection_adapters/mysql_adapter.rb:389:in `connect'
        from /usr/lib/ruby/site_ruby/1.8/active_record/
connection_adapters/mysql_adapter.rb:152:in `initialize'
        from /usr/lib/ruby/site_ruby/1.8/active_record/
connection_adapters/mysql_adapter.rb:82:in `new'
        from /usr/lib/ruby/site_ruby/1.8/active_record/
connection_adapters/mysql_adapter.rb:82:in `mysql_connection'
        from /usr/lib/ruby/site_ruby/1.8/active_record/
connection_adapters/abstract/connection_specification.rb:262:in `send'
        from /usr/lib/ruby/site_ruby/1.8/active_record/
connection_adapters/abstract/connection_specification.rb:262:in
`connection_without_query_cache='
        from /usr/lib/ruby/site_ruby/1.8/active_record/query_cache.rb:
54:in `connection='
        from /usr/lib/ruby/site_ruby/1.8/active_record/
connection_adapters/abstract/connection_specification.rb:230:in
`retrieve_connection'
        from /usr/lib/ruby/site_ruby/1.8/active_record/
connection_adapters/abstract/connection_specification.rb:78:in
`connection'
        from /usr/lib/ruby/site_ruby/1.8/active_record/base.rb:1140:in
`add_limit!'
        from /usr/lib/ruby/site_ruby/1.8/active_record/base.rb:1102:in
`construct_finder_sql'
        from /usr/lib/ruby/site_ruby/1.8/active_record/base.rb:997:in
`find_every'
        from /usr/lib/ruby/site_ruby/1.8/active_record/base.rb:418:in
`find'
        from /usr/lib/ruby/site_ruby/1.8/active_record/
deprecated_finders.rb:39:in `find_all_without_deprecation'
        from /usr/lib/ruby/site_ruby/1.8/active_support/deprecation.rb:
93:in `find_all'
        from (irb):1>>

Rafael wrote:

Hi Chris

Thank you for your reply.
Sorry but redmine has a hellot of migrations.
I also think, this come's from another part because, I tried it also
in the console to type in some commands... same error.
I guess something with the database connection is wrong, is there a
way to test the database connection?

I believe the issue stems from incompatible versions of Ruby libraries. Are you using the same versions of Rails, gems and mysql adapter on both machines?

Hi Jacob, Hi everybody

This was a good clue!
Thank you very much.

With the help of a redmine developer, I found the final solution.
Seems, that mysql adapter was not or false installed.
To fix this I did (re)install the mysql gem

I use FC 5, Apache 2.2.2, Mongrel, Mysql 5.0.27

Check out this Tutorial, this helped me
http://wiki.rubyonrails.org/rails/pages/MySQL+Database+access+problem

yum install ruby-devel
yum install mysql-devel

and finally:
// Find the path where mysql_config is
locate mysql_config
gem install mysql -- --with-mysql-config=/usr/bin/mysql_config

...

Then I could proceed with redmine installation...

Thanks to all of you who helped me out.

greetinx

Rafael