Hi, I have ferret working fine on my Dev machine using a relative index path as follows: USER_INDEX = Index::Index.new(:path => "indexes/user", :key => ''id'', :auto_flush => true) And the indexes/user directory is located directly off the root of my project tree. But when I migrate this same code to my shared TextDrive account, Ferret cannot find the index directory and throws this exception: /usr/local/lib/ruby/gems/1.8/gems/ferret-0.3.2/lib/ferret/store/fs_store.rb:41:in `initialize'': There is no directory: indexes/user. Use create = true to create one (RuntimeError) Do I have to use absolute paths? Or is it perhaps looking somewhere else for the root of its relative paths in different environments? Thanks, Tom
I''m a relative nuby to Ruby, but my inclination would be to add a call
to Dir::pwd() right before you open the index to see what Ruby is using as its
current working directory (and then figure out why). One fix would be to use
Dir::chdir() to change the current working directory, although that
doesn''t seem to me to be a very robust solution.
James
--
James Fraumeni
Center for the Evaluation of Value and Risk in Health
Institute for Clinical Research and Health Policy Studies
750 Washington St.
Tufts-New England Medical Center, #063
Boston, MA 02111
jfraumeni at tufts-nemc.org
-----Original Message-----
From: ferret-talk-bounces at rubyforge.org
[mailto:ferret-talk-bounces at rubyforge.org]On Behalf Of Tom Davies
Sent: Thursday, February 16, 2006 9:39 AM
To: ferret-talk at rubyforge.org
Subject: [Ferret-talk] Ferret with relative index paths
Hi,
I have ferret working fine on my Dev machine using a relative index
path as follows:
USER_INDEX = Index::Index.new(:path => "indexes/user", :key =>
''id'',
:auto_flush => true)
And the indexes/user directory is located directly off the root of my
project tree.
But when I migrate this same code to my shared TextDrive account,
Ferret cannot find the index directory and throws this exception:
/usr/local/lib/ruby/gems/1.8/gems/ferret-0.3.2/lib/ferret/store/fs_store.rb:41:in
`initialize'': There is no directory: indexes/user. Use create = true
to create one (RuntimeError)
Do I have to use absolute paths? Or is it perhaps looking somewhere
else for the root of its relative paths in different environments?
Thanks,
Tom
_______________________________________________
Ferret-talk mailing list
Ferret-talk at rubyforge.org
http://rubyforge.org/mailman/listinfo/ferret-talk
**********************
Confidentiality Notice
**********************
The information transmitted in this e-mail is intended only for the person
or entity to which it is addressed and may contain confidential and/or
privileged information. Any review, retransmission, dissemination or other use
of or taking of any action in reliance upon this information by persons or
entities other than the intended recipient is prohibited.
If you received this e-mail in error, please contact the sender and delete
the e-mail and any attached material immediately. Thank you.
ok, it was due to the setup at TextDrive. The current directory was the public directory rather than the project root. Thanks for the idea James. It looks like I am going to have to configure my dev vs production independently. Tom On 2/16/06, Fraumeni, James <JFraumeni at tufts-nemc.org> wrote:> I''m a relative nuby to Ruby, but my inclination would be to add a call to Dir::pwd() right before you open the index to see what Ruby is using as its current working directory (and then figure out why). One fix would be to use Dir::chdir() to change the current working directory, although that doesn''t seem to me to be a very robust solution. > > > > James > > -- > James Fraumeni > Center for the Evaluation of Value and Risk in Health > Institute for Clinical Research and Health Policy Studies > 750 Washington St. > Tufts-New England Medical Center, #063 > Boston, MA 02111 > jfraumeni at tufts-nemc.org > > > -----Original Message----- > From: ferret-talk-bounces at rubyforge.org > [mailto:ferret-talk-bounces at rubyforge.org]On Behalf Of Tom Davies > Sent: Thursday, February 16, 2006 9:39 AM > To: ferret-talk at rubyforge.org > Subject: [Ferret-talk] Ferret with relative index paths > > > Hi, > > I have ferret working fine on my Dev machine using a relative index > path as follows: > > USER_INDEX = Index::Index.new(:path => "indexes/user", :key => ''id'', > :auto_flush => true) > > And the indexes/user directory is located directly off the root of my > project tree. > > But when I migrate this same code to my shared TextDrive account, > Ferret cannot find the index directory and throws this exception: > > /usr/local/lib/ruby/gems/1.8/gems/ferret-0.3.2/lib/ferret/store/fs_store.rb:41:in > `initialize'': There is no directory: indexes/user. Use create = true > to create one (RuntimeError) > > Do I have to use absolute paths? Or is it perhaps looking somewhere > else for the root of its relative paths in different environments? > > Thanks, > Tom > > _______________________________________________ > Ferret-talk mailing list > Ferret-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/ferret-talk > > > ********************** > Confidentiality Notice > ********************** > The information transmitted in this e-mail is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged information. Any review, retransmission, dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. > If you received this e-mail in error, please contact the sender and delete the e-mail and any attached material immediately. Thank you. > _______________________________________________ > Ferret-talk mailing list > Ferret-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/ferret-talk >