isamu / isamu/rocksdb-ruby

LoadError: cannot load such file -- rocksdb/RocksDB

Open
#38 2 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
76
Forks
24
PR merge metrics
No merged PRs in 30d

Description

$ bundle config set --local path 'vendor/bundle'
$ bundle install
Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies...
Fetching ffi 1.15.5
Fetching rack 3.0.8
Fetching rocksdb-ruby 1.0.4
Fetching zlib 3.0.0
Fetching thread 0.2.2
Installing zlib 3.0.0 with native extensions
Installing thread 0.2.2
Installing rocksdb-ruby 1.0.4 with native extensions
Installing rack 3.0.8
Installing ffi 1.15.5 with native extensions
Fetching ffi-libarchive 1.1.3
Fetching sys-filesystem 1.4.3
Installing ffi-libarchive 1.1.3
Installing sys-filesystem 1.4.3
Bundle complete! 6 Gemfile dependencies, 8 gems now installed.
Bundled gems are installed into `./vendor/bundle`

$ pry
[1] pry(main)> require 'bundler/setup'
=> true
[2] pry(main)> require 'rocksdb'
LoadError: cannot load such file -- rocksdb/RocksDB
from <internal:/usr/local/lib/ruby/rubygems/core_ext/kernel_require.rb>:38:in `require'

After straceing that require call into logfile a:

$ grep vendor/bundle/ruby/3.1.0/gems/rocksdb-ruby-1.0.4.*RocksDB.so a
openat(AT_FDCWD, "vendor/bundle/ruby/3.1.0/gems/rocksdb-ruby-1.0.4/ext/rocksdb/RocksDB.so", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "vendor/bundle/ruby/3.1.0/gems/rocksdb-ruby-1.0.4/lib/rocksdb/RocksDB.so", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)

$ find -name RocksDB.so
./vendor/bundle/ruby/3.1.0/extensions/x86_64-linux/3.1.0/rocksdb-ruby-1.0.4/RocksDB/RocksDB.so
./vendor/bundle/ruby/3.1.0/gems/rocksdb-ruby-1.0.4/ext/RocksDB/RocksDB.so

$ ls -l vendor/bundle/ruby/3.1.0/gems/rocksdb-ruby-1.0.4/ext/
total 8
drwxr-xr-x 2 indexer indexer 4096 Aug 13 16:15 rocksdb
drwxr-xr-x 2 indexer indexer 4096 Aug 13 16:12 RocksDB

$ ls -l vendor/bundle/ruby/3.1.0/gems/rocksdb-ruby-1.0.4/ext/*
vendor/bundle/ruby/3.1.0/gems/rocksdb-ruby-1.0.4/ext/rocksdb:
total 76
-rw-r--r-- 1 indexer indexer  511 Aug 13 16:12 extconf.rb
-rw-r--r-- 1 indexer indexer 8517 Aug 13 16:12 Makefile
-rw-r--r-- 1 indexer indexer 1073 Aug 13 16:12 rocksdb_batch_rb.cc
-rw-r--r-- 1 indexer indexer  330 Aug 13 16:12 rocksdb_batch_rb.h
-rw-r--r-- 1 indexer indexer 8384 Aug 13 16:12 rocksdb_db_rb.cc
-rw-r--r-- 1 indexer indexer 1539 Aug 13 16:12 rocksdb_db_rb.h
-rw-r--r-- 1 indexer indexer 8496 Aug 13 16:12 rocksdb_iterator_rb.cc
-rw-r--r-- 1 indexer indexer 1308 Aug 13 16:12 rocksdb_iterator_rb.h
-rw-r--r-- 1 indexer indexer 5209 Aug 13 16:12 rocksdb_rb.cc
-rw-r--r-- 1 indexer indexer 1328 Aug 13 16:12 rocksdb_rb.h
-rw-r--r-- 1 indexer indexer   18 Aug 13 16:12 rocksdb_status_rb.cc
-rw-r--r-- 1 indexer indexer   18 Aug 13 16:12 rocksdb_status_rb.h

vendor/bundle/ruby/3.1.0/gems/rocksdb-ruby-1.0.4/ext/RocksDB:
total 564
-rwxr-xr-x 1 indexer indexer 576336 Aug 13 16:12 RocksDB.so

So RocksDB.so is in RocksDB/ not in rocksdb/, perhaps you should put it in rocksdb/. Not all systems have case insensitive filenames.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the require paths in ext/rocksdb and ext/RocksDB with the installed files shown in vendor/bundle, then reproduce the failure with require 'bundler/setup' and require 'rocksdb'. Done means the native RocksDB extension is found by the lowercase require path on case-sensitive systems and the reported LoadError no longer occurs.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
databases
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.