Forum: Ruby on Rails undefined method 'define_a_column' for class 'OCI8::Cursor'

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
10f7e00c1c5c60e2173995eb16f4ffc7?d=identicon&s=25 pepe (Guest)
on 2009-03-22 03:30
(Received via mailing list)
Hello. Tired of searching and finding nothing useful.

Moving application to laptop for trip.

Installed:
- Ruby (1.8.6, patchlevel 111)
- Rails (2.2.2)
- Oracle adapter (1.0.0.9250)
- ruby-oci8 (2.0.1)
- Oracle 10g Express Edition

database.yml:
development:
  adapter:  oracle
etc...

When I start Mongrel (ruby script/server) I get the error above. I've
looked everywhere I can think of. Any ideas what might be happening?

Thanks a lot.

Pepe
10f7e00c1c5c60e2173995eb16f4ffc7?d=identicon&s=25 pepe (Guest)
on 2009-03-22 03:47
(Received via mailing list)
Never mind.

I installed oci8 as a gem and it seemed not to like it. I uninstalled
the gem and then donwloaded the version that needs to be installed by
running a ruby program and now everything is happy.

Sorry for the interruption.

Pepe
D263b17c8c7fd4e0accd2b0c2260a2ac?d=identicon&s=25 Brendan Boesen (dugong)
on 2009-05-26 07:49
I had this same issue so in the interest of shortening someone else's
search I thought I'd document it a little more.

The problem I was having (and I assume pepe) was that the OCI8::Cursor
interface has changed between 1.0.x and 2.0.x.  The rails oracle support
(activerecord-oracle-adapter gem) uses 1.0.x.  ie: you need to install
the ruby-oci8 gem using:

    gem install ruby-oci8 --version "< 2.0.0"

The other time people are getting errors like this seems to be when the
environment variables are not correctly set.  You can check out whether
this is the case by executing:

$ irb
>> require 'oci8'
=> true

If it barfs then you need to set your environment variables
appropriately (eg: DYLD_LIBRARY_PATH (Mac) or LD_LIBRARY_PATH
(everything else I think) plus maybe ORACLE_HOME and TNS_ADMIN).
C44bb94018fa23cb7e1dfd6e4689a0b4?d=identicon&s=25 Gordon Jensen (gordonotspanish)
on 2009-11-25 19:47
I was having this same issue, except I'm running on WEBrick. I had 1.x
and 2.x versions of the ruby-oci8 gem along with version 1.0.0.9250 of
the activerecord-oracle-adapter gem. Removing the 2.x ruby-oci8 fixed
it.

Thanks!!

Brendan Boesen wrote:
> I had this same issue so in the interest of shortening someone else's
> search I thought I'd document it a little more.
>
> The problem I was having (and I assume pepe) was that the OCI8::Cursor
> interface has changed between 1.0.x and 2.0.x.  The rails oracle support
> (activerecord-oracle-adapter gem) uses 1.0.x.  ie: you need to install
> the ruby-oci8 gem using:
>
>     gem install ruby-oci8 --version "< 2.0.0"
>
> The other time people are getting errors like this seems to be when the
> environment variables are not correctly set.  You can check out whether
> this is the case by executing:
>
> $ irb
>>> require 'oci8'
> => true
>
> If it barfs then you need to set your environment variables
> appropriately (eg: DYLD_LIBRARY_PATH (Mac) or LD_LIBRARY_PATH
> (everything else I think) plus maybe ORACLE_HOME and TNS_ADMIN).
F10c2645c2e6b7675b554a9f574e8c67?d=identicon&s=25 njakobsen (Guest)
on 2010-05-17 20:41
(Received via mailing list)
Adam Akhtar-2 wrote:
>     gem install ruby-oci8 --version "< 2.0.0"
>

On Snow Leopard I was able to use:

activerecord-oracle_enhanced-adapter (1.2.4)
ruby-oci8 (2.0.4)

for the enhanced adapter, use 'oracle_enhanced' in your database yml
--
View this message in context:
http://old.nabble.com/undefined-method-%27define_a...
Sent from the RubyOnRails Users mailing list archive at Nabble.com.
This topic is locked and can not be replied to.