Ruby on Rails Thursday, January 31, 2013

Hello All --

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

In my database yaml file I have the following:
---
development:
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/RubyJdbcConnection.java:126:in `columns'
c:/temp/brownbag/gem_home/gems/activerecord-jdbc-adapter-1.2.5/lib/arjdbc/oracle/adapter.rb:358:in
`ora_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',
:username=>'brownbag',
:password=>'brownbag'
)

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

The table is created as expected!

Help!

Thanks,

Cris

--
Posted via http://www.ruby-forum.com/.

--
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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment