1

I'm trying to run Rails on JRuby 1.7.3 in userspace on Solaris and I get this error when running rake db:create.

-bash-3.2$ rake db:create
rake aborted!
undefined method `error' for #<ActiveRecord::JDBCError:0x109d7b8>
org/jruby/RubyArray.java:1613:in `each'
org/jruby/RubyProc.java:249:in `call'
org/jruby/RubyArray.java:1613:in `each'
org/jruby/RubyArray.java:1613:in `each'
org/jruby/RubyKernel.java:1046:in `load'
Tasks: TOP => db:create
(See full trace by running task with --trace)

I have looked at the JRuby source for this line, but I'm pretty far out of my depth on this and I'm not sure what's going on. Has anyone seen this before?

alnorth29
  • 3,525
  • 2
  • 34
  • 50

2 Answers2

0

I haven't run on that kind of error before, but just to double-check .. have you used jruby specific gem for making a connection to databases:

https://github.com/jruby/activerecord-jdbc-adapter

If not, try using that instead the ones you have been using so far for "regular" ruby

Aleks
  • 4,866
  • 3
  • 38
  • 69
0

I just run into this error. It seems like a bug in Rails. Your idea of inspecting the source for that line was a good one. I went there and changed $stdout.print error.error for just $stdout.print error because the error method didn't seem defined.

That revealed the actual error:

#<ActiveRecord::JDBCError: Access denied for user 'root'@'localhost' (using password: YES)>

In my case, I was mispelling the username key in the config/database.yml file, so it would assume the root user, but the password would be wrong.

deivid
  • 4,808
  • 2
  • 33
  • 38