Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

can't find the gem packet 'bloomfilter' #4

Closed
yaoweibin opened this Issue · 5 comments

2 participants

@yaoweibin

Hi,

I use Ubuntu-10.04. I install your gem packet first:


#gem install bloomfilter-rb

This packet did install in my server. You can see it like that:


$gem list

*** LOCAL GEMS ***

bloomfilter-rb (2.1.1)
redis (2.2.2)

When I tested with your example code in the README:


require 'bloomfilter'

bf = BloomFilter::Native.new(:size => 100, :hashes => 2, :seed => 1, :bucket => 3, :raise => false)
bf.insert("test")
bf.include?("test") # => true
bf.include?("blah") # => false

bf.delete("test")
bf.include?("test") # => false

bf["test2"] = "bar"
bf["test2"] # => true
bf["test3"] # => false

bf.stats


$ruby test.rb

test.rb:3:in `require': no such file to load -- bloomfilter (LoadError)
from test.rb:3

I also tried "require 'bloomfilter-rb'". It still can't find the packet:


test.rb:2:in `require': no such file to load -- bloomfilter-rb (LoadError)
from test.rb:2

@igrigorik
Owner

Which version of Ruby? If you're running 1.8.x, then add "require 'rubygems'" at the top of the file, otherwise it won't find the gem. 1.9+ does this automatically.

@yaoweibin

I tested both in ruby1.8 and ruby1.9:


yaoweibin@li398-116:~/work/simple/active_loader$ ruby1.8 test.rb
/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require': no such file to load -- bloomfilter (LoadError)
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in
require'
from test.rb:4
yaoweibin@li398-116:~/work/simple/active_loader$ ruby1.9 test.rb
test.rb:4:in require': no such file to load -- bloomfilter (LoadError)
from test.rb:4:in
'
yaoweibin@li398-116:~/work/simple/active_loader$ gem1.8 list

*** LOCAL GEMS ***

bloomfilter-rb (2.1.1)
redis (2.2.2)
yaoweibin@li398-116:~/work/simple/active_loader$ gem1.9 list

*** LOCAL GEMS ***

bloomfilter-rb (2.1.1)
memcached (1.3.5)
redis (2.2.2)

@igrigorik igrigorik closed this in 6ab061e
@igrigorik
Owner

Ah, my bad, didn't update the examples. If you build the gem from master it should be fixed.. alternatively: require "bloomfilter-rb"

@yaoweibin

Hi,

It's still strange when I install your latest revision :


yaoweibin@li398-116:~/work/simple/active_loader$ ruby1.9 test.rb
/var/lib/gems/1.9.0/gems/bloomfilter-rb-2.1.1/lib/bloomfilter-rb.rb:1:in require': no such file to load -- redis (LoadError)
from /var/lib/gems/1.9.0/gems/bloomfilter-rb-2.1.1/lib/bloomfilter-rb.rb:1:in
'
from /var/lib/gems/1.9.0/gems/bloomfilter-rb-2.1.1/lib/bloomfilter.rb:1:in require'
from /var/lib/gems/1.9.0/gems/bloomfilter-rb-2.1.1/lib/bloomfilter.rb:1:in
'
from test.rb:4:in require'
from test.rb:4:in
'
yaoweibin@li398-116:~/work/simple/active_loader$ ruby1.8 test.rb
WARNING: using the built-in Timeout class which is known to have issues when used for opening connections. Install the SystemTimer gem if you want to make sure the Redis client will not hang.
test.rb:13:in `[]=': wrong number of arguments (2 for 1) (ArgumentError)
from test.rb:13

@igrigorik
Owner

You don't have redis installed on your 1.9 version -- gem install redis (although the actual command will depend on your install of 1.9).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.