I’m trying to run a Rails application using JRuby on Mac OS(10.6.2) ,
however I’m using MySQL version that comes with MAMP server.
Unfortunately it seems that the connection with the MySQL is not
established
even though I’m setting the socket correctly.
Here is an error log http://pastie.org/751216, I have followed some
instructions mentioned
herehttp://boonedocks.net/mike/archives/175-MAMP-and-the-Ruby-MySQL-Gem.htmlto
run the app on Ruby MRI, but I don’t know what to do to make it work
with
JRuby.
Any ideas?
On Mon, Dec 21, 2009 at 01:57:45AM +0200, Khaled al Habache wrote:
JRuby.
Any ideas?
First of all, in Unix ‘Connection refused’ means that the client
couldn’t
connect to the server because (con refused = tcp port not open).
This could mean:
Wrong host name, should probably be localhost
Wrong port (should probably be 3306)
Service not running (Start it according to the manual)
Firewall in between which rejects tcp connections (Only when not
localhost)
To see if mysql runs on your local machine you could do:
telnet localhost 3306
if you get
telnet: connect to address 127.0.0.1: Connection refused
your service is not running
if you see a mysql banner your db connector config must be wrong.
But I’d say this is not really related to JRuby or Rails.
And the instructions you were refering to are only for MRI – not for
jruby,
does it run with normal c ruby?
There are several tutorials out there which explain how to get to it
running
with JRuby, but get it working with MRI first.
Judging from the docs at http://kenai.com/projects/jruby/pages/ActiveRecord-JDBC it seems that
socket is not supported. Which confirms my findings that my applications
still worked after setting socket to a non existing file. So I would
remove the socket setting and check if the Ruby MRI app stills works.
Ah solved that one, still the connection to the DB is not established.
Anyway, I have installed normal stuff and things are working now. Just
wanted to check if things will work smoothly with MAMP but it didn’t.
I won’t waste the whole day on this
On Mon, Dec 21, 2009 at 02:48:20PM +0100, Roger G. wrote:
Judging from the docs at http://kenai.com/projects/jruby/pages/ActiveRecord-JDBC it seems that socket
is not supported. Which confirms my findings that my applications still
worked after setting socket to a non existing file. So I would remove the
socket setting and check if the Ruby MRI app stills works.