typemismatch
typemismatch

Reputation: 2058

JRuby on Rails without a database

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

Upvotes: 1

Views: 601

Answers (1)

Robert Brown
Robert Brown

Reputation: 11016

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?

Upvotes: 1

Related Questions