From: Avram L. <aj...@gm...> - 2008-02-03 14:31:26
|
I'm working on a RubyCocoa front-end for a Ruby library I wrote to access a certain web forum. The library uses the Tidy gem to normalize the messy HTML it gets from the web server before using REXML to parse out the needed content. This works fine for me when I'm using plain old Ruby, but when I call: Tidy.path=LOCAL_TIDY_LIB_PATH from my RubyCocoa app, I get a RuntimeError (trace below). As the trace shows, the error is thrown when dl/import.rb tries to load the local HTMLTidy library (/usr/lib/libtidy.dylib). My gut instinct here is that this a limitation of RubyCocoa -- I can't use dynamic loading. Is that the case? If so, is there a way to work around it? I've looked at the Tidy gem project documentation and the RubyCocoa documentation, and I don't see anything related to this. Thanks in advance for any and all advice, Avram Lyon Trace from XCode Debugger console follows: ==snip== /Development/Mac_Plans/build/Release/Mac_Plans.app/Contents/Resources/rb_main.rb:23 /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/dl/import.rb:126:in `symbol': can't find the symbol `tidyCreate' (RuntimeError) from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/dl/import.rb:145:in `import' from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/dl/import.rb:61:in `extern' from /Library/Ruby/Gems/1.8/gems/tidy-1.1.2/lib/tidy/tidylib.rb:17:in `load' from /Library/Ruby/Gems/1.8/gems/tidy-1.1.2/lib/tidy.rb:46:in `path=' from /Development/Mac_Plans/build/Release/Mac_Plans.app/Contents/Resources/plans_client.rb:195:in `tidy_up_html' from /Development/Mac_Plans/build/Release/Mac_Plans.app/Contents/Resources/plans_client.rb:123:in `parse_v2' from /Development/Mac_Plans/build/Release/Mac_Plans.app/Contents/Resources/plans_client.rb:114:in `parse' from /Development/Mac_Plans/build/Release/Mac_Plans.app/Contents/Resources/plans_client.rb:72:in `login' from /Development/Mac_Plans/build/Release/Mac_Plans.app/Contents/Resources/plans_window_controller.rb:25:in `loginClient' from /Development/Mac_Plans/build/Release/Mac_Plans.app/Contents/Resources/rb_main.rb:23:in `NSApplicationMain' from /Development/Mac_Plans/build/Release/Mac_Plans.app/Contents/Resources/rb_main.rb:23 The Debugger has exited with status 1.The Debugger has exited with status 1. ==end of trace== |