These are chat archives for opal/opal

17th
Jun 2015
Srikanth Kuppuswamy
@Hospira-MedNet
Jun 17 2015 09:51
i am getting an problem where opal couldn't understand the ruby gem during compile
for ex: if we add in the .rb file like require 'log4r' , getting an error like below
can't find file: "log4r" in ["C:/Ruby193/lib/ruby/gems/1.9.1/gems/opal-0.7.2/opal", "C:/Ruby193/lib/ruby/gems/1.9.1/gems/opal-0.7.2/stdlib", "C:/Ruby193/lib/ruby/gems/1.9.1/gems/opal-0.7.2/lib"] (Opal::Builder::MissingRequire
can anyone let me know how to resolve this
Elia Schito
@elia
Jun 17 2015 09:54
opal doesn't "understand" ruby gems
it runs on a different platform from ruby193 so many gems can't work with opal by their nature
Srikanth Kuppuswamy
@Hospira-MedNet
Jun 17 2015 10:01
thanks @elia
Ryan Stout
@ryanstout
Jun 17 2015 19:55
@adambeynon or @elia is there any docs on require_tree (in 0.7.2)
I'm trying it and it's looking like its just not requiring at all for some reason (but no error)
do I pass it a full path, or just a path based on $LOAD_PATH
Elia Schito
@elia
Jun 17 2015 20:13
@ryanstout on the client it will look in the paths it finds in Opal.modules
it can't deal with absolute paths
let me know if you want some help looking through the source, there's no other docs I'm aware of
Ryan Stout
@ryanstout
Jun 17 2015 20:41
@elia I think I found some docs. But its not requiring it for some reason. I see the requires in the generated JS: self.$require_tree("calendar/config/initializers");
but its not including the files in that folder
Opal.paths has the right folder in it
@elia I'm using Opal::Builder.new.build_str, could that be the reason?
(again, in 0.7.2)
Ryan Stout
@ryanstout
Jun 17 2015 21:02
@elia let me know next time your around, I think I figured out an issue with the way it works. (looks like its still the same code in 0.8.x)
Elia Schito
@elia
Jun 17 2015 21:04
@ryanstout do you have some code?
Ryan Stout
@ryanstout
Jun 17 2015 21:05
@elia not yet. Maybe I'm understanding require_tree wrong though.. Let me pull something up...