Giter Site home page Giter Site logo

Fails when writing about leveldb-ruby HOT 7 OPEN

xumingyong avatar xumingyong commented on August 19, 2024
Fails when writing

from leveldb-ruby.

Comments (7)

xumingyong avatar xumingyong commented on August 19, 2024

I guess the reason is:

the default write_buffer_size is 4MB, so when the Memory flush to disk, LevelDB call snappy function, but the LevelDB-ruby did not include the snappy lib.

from leveldb-ruby.

xumingyong avatar xumingyong commented on August 19, 2024

It solved.

  1. download leveldb-ruby source code.
  2. modify the line12 of ./ext/leveldb/extconf.rb
    from
    $LIBS << " -L../../leveldb -lleveldb"
    to
    $LIBS << " -L../../leveldb -lleveldb -lsnappy"
  3. run
    # rake -T spec
    # ruby setup.rb
    # cd /usr/local/lib/site-ruby/1.9.1/i686-linux/
    # cp leveldb.so ../leveldb/
  4. copy snappy.so.1 to above leveldb path.
  5. try the test code.

from leveldb-ruby.

wmorgan avatar wmorgan commented on August 19, 2024

Hello,

Thanks for the report. But I can't reproduce this. What version of the leveldb-ruby gem do you have installed?

from leveldb-ruby.

xumingyong avatar xumingyong commented on August 19, 2024

The gem version is 5975fd7

My test enviroment is UNBUNTU 11.10

from leveldb-ruby.

wmorgan avatar wmorgan commented on August 19, 2024

Can you try the latest master? I've updated to the latest leveldb code and this solved the snappy problem for some people (e.g. #20)

from leveldb-ruby.

xumingyong avatar xumingyong commented on August 19, 2024

1. Try the new rubyforge gem

I tried the :

gem install level-ruby

again, something make me confused, the ruby report
in put: wrong argument type LevelDB::DB (expected Data) (TypeError)

but your test file works.

2. Try the latest master, and build it manually

commands:

rake gem
setup.ruby
cp ./i686-linux/leveldb.so ./leveldb/

.../lib/leveldb/leveldb.so: undefined symbol: _ZN6snappy19MaxCompressedLengthEj

It seems it does not work, I guess the g++ command need -lsnappy switch in Makefile of google leveldb source files.

from leveldb-ruby.

emnl avatar emnl commented on August 19, 2024

I don't know if you're still experiencing this problem, but I solved this by just remove snappy/leveldb from my package manager, then reinstalled the gem.

from leveldb-ruby.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.