cfis / proj4rb

Proj4rb is a ruby binding for the Proj carthographic projections library.
MIT License
24 stars 11 forks source link

Error when loading library from gem #14

Closed jklimke closed 4 years ago

jklimke commented 4 years ago

Hi,

i tried out the newest gem version 2.1.0.

When starting my rails server, i noticed that there is an error when requiring the gem:

gems/ruby-2.6.5/gems/proj4rb-2.1.0/lib/proj.rb:3:in `require_relative': cannot load such file -- .rvm/gems/ruby-2.6.5/gems/proj4rb-2.1.0/lib/api/api (LoadError)

There is currently a require_relative within the code of proj.rb that requires the api/api file (https://github.com/cfis/proj4rb/blob/b3b369e14ff09d253227bae20be770aa62fcf72b/lib/proj.rb#L3), but the whole subfolder lib/api from the github repository is not contained in the within the packed gem. Maybe there is something wrong with the build ? Did i miss something

jklimke commented 4 years ago

I just had a short look on the gemspec and it seems that the pattern for the lib directory does not match for the files in lib/api/.

spec.files = Dir['ChangeLog',
                   'Gemfile',
                   'MIT-LICENSE',
                   'proj4rb.gemspec',
                   'Rakefile',
                   'README.rdoc',
                   'lib/*.rb',
                   'test/*.rb']

it should probably be enough to add 'lib/**.rb' to the gem spec files