warbler icon indicating copy to clipboard operation
warbler copied to clipboard

not able to find library files

Open danielb2 opened this issue 13 years ago • 3 comments

#!/usr/bin/env ruby                         
$: << File.dirname(__FILE__) + '/../lib'    
require 'my-project/class'

directory structure is lib/my-project/class.rb. and bin/my-project

when I run warble, and java -Djruby.compat.version=1.9 -jar my-project.jar I get errors saying:

LoadError: no such file to load -- my-project/class

Any ideas why this would be?

gemspec looks like this

# ...
gem.files         = `git ls-files`.split($\)                                                                        
gem.executables   = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
gem.require_paths = ["lib"]                                                                                         
# ...


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

danielb2 avatar May 09 '12 23:05 danielb2

OK, after playing around it seems there's a bug around the hyphen in the library name.

require 'my-project' didn't work either despite there being a lib/my-project

So I tried removing the hyphen, and that works fine :/

danielb2 avatar May 09 '12 23:05 danielb2

same problem occurs with underscores.

danielb2 avatar May 10 '12 00:05 danielb2

Same here, but I would not like to rename my library

tfoldi avatar May 07 '13 05:05 tfoldi