[Nitro] problems with require on Debian Sarge
Bryan Soto
bryan.a.soto at gmail.com
Mon Feb 20 21:16:09 EST 2006
Hi,
On 2/19/06, Bakki Kudva <bakki.kudva at gmail.com> wrote:
>
> Hi,
>
> I was having trouble with require 'nitro' until I added
> RUBYOPT=rubygems to my env.
> Now I am following along with the video samples from the web site and
> everything was fine until I got to Og. Now I get...
> ./model.rb:11: uninitialized constant Og::Database (NameError)
> from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:21:in
> `require__'
> from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:21:in
> `require'
> from demo.rb:4
> which is the require 'model' line.
>
> I am trying to use pgsql and have added ..
> db = Og::Database.new(
> :database => 'mydb',
> :adapter => 'psql',
> :user => 'bakki',
> :password => ''
> )
Should be
db = Og.setup( # different
:name => 'mydb', # different
:store => 'psql', # different
:user => 'bakki',
:password => ''
)
I think you are reading this off the wiki? Unfortunately, that portion is
out of date and it's not showing changes properly so we can't fix :(
I think the rest is okay, so if you run into problems, please don't hesitate
to ask. :)
It's late and I am not seeing straight...so thought I'd shoot this one
> at the list.
> Thanks in advance for helping.
>
> -bakki
>
> PS: Which is the best place for the db config code? In the demo.rb or
> the model? Can you have different models which connect to different
> databases?
Wherever you like actually. :)
Though it's usually put it in a run.rb file (or in your case demo.rb) so
it's with the rest of the configuration stuff.
You can in theory. It was never used a whole lot so it has some quirks. If
you need more info on that please let me know.
Bryan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/nitro-general/attachments/20060220/1d1d1792/attachment.html
More information about the Nitro-general
mailing list