Ruby on Rails Thursday, January 31, 2013

Hello All --

I am using jruby with rails 3.2.11 to create a brown bag for
several other developers. I cannot get the migration to work to save my

In my database yaml file I have the following:
adapter: jdbc
driver: oracle.jdbc.driver.OracleDriver
url: jdbc:oracle:thin:@localhost:1521:xe
username: brownbag
password: brownbag
pool: 500

When I run:
rake db:create --trace
** Invoke db:create (first_time)
** Invoke rails_env (first_time)
** Execute rails_env
** Invoke db:load_config (first_time)
** Execute db:load_config
** Execute db:create

when I run:
C:\temp\brownbag\my_workout>rake db:migrate --trace
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Invoke db:load_config (first_time)
** Execute db:load_config
** Execute db:migrate
rake aborted!
Table schema_migrations does not exist
arjdbc/jdbc/ `columns'
c:/temp/brownbag/gem_home/gems/activerecord-3.2.11/lib/active_record ...

If I switch my database.yml file to the original slite3 that rails auto
generates all is fine.

If I place the following in irb:

require 'rubygems'
require 'activerecord-jdbc-adapter'
require 'active_record'
require 'active_record/version'

a= ActiveRecord::Base.establish_connection(
:adapter => 'jdbc',
:driver => 'oracle.jdbc.driver.OracleDriver',
:url => 'jdbc:oracle:thin:@localhost:1521:xe',

c = a.connection
ct = "CREATE TABLE example (id INT, data VARCHAR(100) )"
d = c.exec_query(ct)

The table is created as expected!




Posted via

You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
For more options, visit

No comments:

Post a Comment