Hello, I've problem with xapian or sth. Ubuntu 8.04, ruby 1.9.3 with rvm, when Im trying to initialize database, Im getting this error: irb > require 'xapian' ==> true irb > database = Xapian::WritableDatabase.new('/full_path/db/xapian_db/development', Xapian::DB_CREATE_OR_OPEN) ArgumentError: Wrong arguments for overloaded method 'WritableDatabase.new'. Possible C/C++ prototypes are: WritableDatabase.new() WritableDatabase.new(std::string const &path, int action) WritableDatabase.new(Xapian::WritableDatabase const &other) from (irb):2:in `initialize' from (irb):2:in `new' from (irb):2 from script/rails:6:in `require' from script/rails:6:in `<main> If I use any idea what Im doing wrong? for example: database = Xapian::Database.new() ==> #<Xapian::Database:0x94fbb3c> and when I set path, I get error database = Xapian::Database.new('db/xapian_db/development/') ArgumentError: Wrong arguments for overloaded method 'Database.new'. Possible C/C++ prototypes are: Database.new() Database.new(std::string const &path) Database.new(Xapian::Database const &other) from (irb):5:in `initialize' from (irb):5:in `new' from (irb):5 any help will be very welcome :) -- Best regards, Rafi mailto:webdeveloper at poczta.onet.pl
Damian Janowski
2012-Jul-26 19:19 UTC
[Xapian-discuss] ruby bindings, ruby 1.9.3 and xapian
On Thu, Jul 26, 2012 at 3:09 PM, Rafi <webdeveloper at poczta.onet.pl> wrote:> any help will be very welcome :)Check how we do it in XapianFu [1]. While you're at it, check the readme [2] and see if you find the gem useful. It makes interacting with Xapian much more Ruby-like. [1] https://github.com/johnl/xapian-fu/blob/master/lib/xapian_fu/xapian_db.rb#L352-362 [2] https://github.com/johnl/xapian-fu#readme
On Thu, Jul 26, 2012 at 08:09:11PM +0200, Rafi wrote:> I've problem with xapian or sth. > Ubuntu 8.04, ruby 1.9.3 with rvm, when Im trying to initialize > database, Im getting this error:What version of Xapian were you using and how did you install it? I'm wondering if it was built for a different Ruby version, and the issue is that it's not actually compatible with your 1.9.3 install. It clearly works to some extent, but perhaps the parameter type gets read incorrectly for this case.> irb > database = Xapian::WritableDatabase.new('/full_path/db/xapian_db/development', Xapian::DB_CREATE_OR_OPEN)Looks right to me. Cheers, Olly