Michael Satterwhite wrote in post #969181:
> Peter Vandenabeele wrote in post #969175:
>> Michael Satterwhite wrote in post #969123:
...
>>> I just installed it. Same result.
>>>
>>> I'm not sure my gem is installing correctly, though - or if there is
>>> something else needed. Note the following:
>>>
>>>    irb(main):001:0> require 'pg'
>>>    => true
>>>    irb(main):002:0> cn = PGconn.open(:dbname => 'movies')
>>>    NameError: uninitialized constant PGconn
>>>      from (irb):2
>>
>> Actually ... are you using ruby 1.8.x ?
>>
>> Is that line
>>
>>   irb(main):001> require 'pg'
>>
>> really your first line in the irb session ?
>>
>> Should you not do
>>
>>   require 'rubygems'
>>
>> first ?  (IIRC, required in 1.8.x but no longer in 1.9.x)
>
> I have the environment variable
>
>    RUBYOPT=rubygems
>
> set. This causes 1.8.x to automatically set rubygems as in 1.9.x.

Ah, thanks for that info.
It works that way here too.

pet...@asus:~$ export RUBYOPT=rubygems
pet...@asus:~$ echo $RUBYOPT
rubygems
pet...@asus:~$ irb
irb(main):001:0> require 'pg'
=> true
irb(main):002:0> Object.constants.grep(/PG/)
=> ["PGconn", "PGresult", "PGError"]

Peter

-- 
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to