Uninitialized constant Phash

163 Views Asked by At

I started to learn ruby ​​recently. I trying to use a library pHash on ruby for my own project. I trying during for 2 days, but I don't understand what I'm doing wrong.I included old and new versions library, I installed in local directory and home directory. I got constantly error on compile ruby and in command line ubuntu. At last I tried to use a bundler/inline and got next error.

enter image description here

Code here:

require 'bundler/inline'

gemfile do
      source 'https://rubygems.org'
      gem 'pHash', require: 'ffi'
      gem 'rspec', require: false
    end

Phash::Text.new('first.txt') % Phash::Text.new('second.txt')

The last line I take from documentation.

1

There are 1 best solutions below

2
matthewd On

require: 'ffi' seems unlikely to do what you need... and indeed the examples in the documentation all include a specific require call first. The one you referenced looks like this in full:

require 'phash/text'

Phash::Text.new('first.txt') % Phash::Text.new('second.txt')