Hello,
I have just tested with
Debian GNU/Linux, ffi 0.3.5, TC 1.4.32 or TC 1.4.36, Ruby 1.9.1p129
and it works,
MacOSX snoleo, ffi 0.5.0, TC 1.4.{32|36}, Ruby 1.8.7p72 or Ruby
1.9.1p243 and it works.
That is strange.
Best regards,
--
John Mettraux - http://jmettraux.wordpress.com
Dmitry is also working with ffi 0.5.1, I ran my tests with ffi 0.5.0
and 0.3.5. I thought it might be a factor in the issue but now it
seems that it's Slackware related, too bad.
?
> eveel@notazik{~}% cat /etc/redhat-release
> Fedora release 11 (Leonidas)
> eveel@notazik{~}% rvm ree
> eveel@notazik{~}% ruby -v
> ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-linux], MBARI 0x8770,
> Ruby Enterprise Edition 2009.10
> eveel@notazik{~}% gem list | egrep '(ffi|rufus)'
> ffi (0.5.1, 0.5.0)
> rufus-tokyo (1.0.1)
> eveel@notazik{~}% irb -rrufus/tokyo
>>> Rufus::Tokyo::Cabinet.new('data.tch')
> Rufus::Tokyo::TokyoError: failed to open/create db 'data.tch' {}
> from /home/eveel/.rvm/gems/ree/1.8.7/gems/rufus-tokyo-1.0.1/lib/rufus/
> tokyo/cabinet/abstract.rb:195:in `initialize'
> from (irb):1:in `new'
> from (irb):1
> from :0
>>> Rufus::Tokyo::Table.new('table.tch')
> => #<Rufus::Tokyo::Table:0x93c8f30>
OK, understood. I will take some time to try on REE tomorrow.
Thanks and best regards,
OK, if meanwhile you find anything, please post here, I have no clue
where to look.
I'm going to bed. Cheers,
Hello,
does it work with REE on your Fedora 11 ?
Best regards,
Hello Dmitry,
I tried with ruby-enterprise-1.8.6-20090610 and ruby-ffi 0.5.0 with
rufus-tokyo 1.0.1 on both Mac OSX 10.6 and Arch GNU/Linux. Works fine.
However, I could reproduce your issue with :
---8<---
jmettraux@arch ~ $ ruby -v
ruby 1.8.6 (2008-08-11 patchlevel 287) [x86_64-linux]
Ruby Enterprise Edition 20090610
jmettraux@arch ~ $ irb
ruby-enterprise-1.8.6-20090610 > require 'rubygems'; require 'rufus-tokyo'
=> true
ruby-enterprise-1.8.6-20090610 > h = Rufus::Tokyo::Cabinet.new('data.tch')
=> #<Rufus::Tokyo::Cabinet:0x7f050d1d1c08 @path="data.tch",
@db=#<FFI::Pointer address=0x1c435c0>,
@default_proc=#<Proc:0x00007f050d21a458@/home/jmettraux/.rvm/gems/ruby-enterprise/1.8.6/gems/rufus-tokyo-1.0.1/lib/rufus/tokyo/hmethods.rb:103>>
ruby-enterprise-1.8.6-20090610 > h = Rufus::Tokyo::Cabinet.new('data.tch')
Rufus::Tokyo::TokyoError: failed to open/create db 'data.tch' {}
from /home/jmettraux/.rvm/gems/ruby-enterprise/1.8.6/gems/rufus-tokyo-1.0.1/lib/rufus/tokyo/cabinet/abstract.rb:195:in
`initialize'
from (irb):3:in `new'
from (irb):3
ruby-enterprise-1.8.6-20090610 >
--->8---
This error occurs on "double-opening". Is your pasted output accurate ?
bash-4.0$ rvm use ree
bash-4.0$ ruby -v
OK, I could reproduce the issue on Arch GNU/Linux with the same REE.
This seems to fix the issue :
---8<---
diff --git a/lib/rufus/tokyo/cabinet/abstract.rb
b/lib/rufus/tokyo/cabinet/abstract.rb
index 1330165..2b3f3ab 100644
--- a/lib/rufus/tokyo/cabinet/abstract.rb
+++ b/lib/rufus/tokyo/cabinet/abstract.rb
@@ -217,7 +217,8 @@ module Rufus::Tokyo
name = name + params.collect { |k, v| "##{k}=#{v}" }.join('')
- (lib.tcadbopen(@db, name) == 1) || raise(
+ #(lib.tcadbopen(@db, name) == 1) || raise(
+ (lib.tcadbopen(@db, name) != 0) || raise(
TokyoError.new("failed to open/create db '#{name}' #{params.inspect}"))
#
--->8---
Please tell me if it's OK for you as well and if I need to apply this
technique to other Tokyo structures.
Thanks in advance,
Yes, this error looks nullified, but now I have some new problem:
bash-4.0$ script/server
=> Booting WEBrick
=> Rails 2.3.4 application starting on http://0.0.0.0:3000
/home/lumrandir/workspace/peppery-school/vendor/gems/rufus-tokyo-1.0.1/lib/rufus/tokyo/cabinet/abstract.rb:195:in
`initialize': failed to open/create db
'/home/lumrandir/workspace/peppery-school/db/strawberry/development/database.tch#mode=wcef'
{:mode=>"wcef"} (Rufus::Tokyo::TokyoError)
As far I can tell by looking at the rufus-tokyo source, it's similar to
the previous case.
Hello,
I don't understand your email.
The error seems to occur exactly at the same place so it is not "nullified".
Maybe it's linked to the wcef mode... Does it occur when you drop that mode ?
Which ruby ? Which platform ?
Sorry,
Oh, I'm sorry, it's my mistake.
I've edited source in gem directory, but forgot to re-unpack gem in
vendor/.
Surely, now it looks like working.
Thank you for help.
OK,
I've updated the code with what we learnt here :
http://github.com/jmettraux/rufus-tokyo/commit/cf43603f0b033c83c5c1a862fff20632d9686c63
The tests are all green for me on Arch GNU/Linux with REE 2009.10
(1.8.7), green for my traditional platforms as well.
Thanks to you and Dmitry for the input, best regards,
Hello, I just released rufus-tokyo 1.0.2 via http://gemcutter.org
gem install rufus-tokyo --source http://gemcutter.org
Best regards,