Rake db:migrate strange behaviour "wrong number of arguments

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

Rafael wrote:

Hi everybody,

May be somebody has a clue, why I get these errors below, while trying
to migrate.

Can you post the migration you’re trying to run?

Chris K.
http://kampers.net

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>>

On 23 Jun., 15:16, Chris K. [email protected]

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?


Cheers,

  • Jacob A.

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

Am 23.06.2007 um 16:00 schrieb Jacob A.:

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:

I got these same errors using ruby 1.8.6 with any version of rails
before 1.2.3
see:

Matthew R. wrote:

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:

I got these same errors using ruby 1.8.6 with any version of rails
before 1.2.3
see:
Ruby on Rails — Rails 1.2.3: Compatible with Ruby 1.8.6 (and other fixes)

I performed a gem update. It didn’t fixed it. Another curiosity is that
I have another rails project in the same development environment and it
works fine. I couldn’t figure it out but I fix -or skip- my problem by
creating a new rails project and then copying all my code to it.

Thanks for your answers.

Hi. I’m having the same problem. Every time a DB request is made, I get
“wrong number of arguments (1 for 0)”. My development environment is my
desktop PC and a remote database server. The production is a remote
application server and the same database server. The problem only
happens in development environment (lucky me).
The rails version in both environments is the same (1.1.6) and the
database is the same (since it’s the same DB server).

Anyone has a further clue about it? I could really use some help. I’m
really having problems because of this. Thanks.

Fernando

beYou media { Rafael Schär } wrote:

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

Am 23.06.2007 um 16:00 schrieb Jacob A.: