views:

228

answers:

1

I'm kicking off a new Rails project in NetBeans using JRuby (v1.2.0) which uses Rails (2.3.2). I don't need a database, all my data comes from the cloud.

I've uncommented this line in my environment

config.frameworks -= [ :active_record, :active_resource, :action_mailer]

However, I still get the following errors just trying to call an action. Hosting on GlassFish.

java.net.SocketException: java.net.ConnectException: Connection refused: connect at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:156) at com.mysql.jdbc.MysqlIO.(MysqlIO.java:276) at com.mysql.jdbc.Connection.createNewIO(Connection.java:2666) at com.mysql.jdbc.Connection.(Connection.java:1531)

Any ideas where else I might need changes to not use a database? thanks

+1  A: 

First step, make sure you dont have any environment specific overrides in config/environments/[your env].rb

I just did a test:

  1. Create a new rails app
  2. Edit config/environment.rb to uncomment the config.frameworks -= [ :active_record, :active_resource, :action_mailer] line
  3. jruby script/generate controller hello index
  4. jruby script/server
  5. Point browser at localhost:3000/hello

All seems ok - no ActiveRecord error. How about for you?

Rob
This actually works, the difference is I was using GlassFish from inside NetBeans - if I run it outside using webrick as you did, then it works fine. This poses a problem however, when/if I put it into production on GlassFish then it would break again :(
typemismatch
Fair 'nuff... Glassfish must be executing code paths that webrick or mongrel do not - but that doesn't make any sense to me...
Rob