green_shoes
green_shoes copied to clipboard
Doesn't work on Mac OS X Lion
I try to use homebrew to follow the instruction from https://github.com/ashbb/green_shoes/wiki/Building-Green-Shoes-on-OSX. But it doesn't work when I run Shoes.show_manual 'English'
. I get the following error
LoadError: no such file to load -- /Users/samnang/.rvm/gems/ruby-1.9.2-p180@dev/gems/green_shoes-1.0.273/lib/ext/hpricot/hpricot_scan
from /Users/samnang/.rvm/gems/ruby-1.9.2-p180@dev/gems/green_shoes-1.0.273/lib/ext/hpricot.rb:20:in `require_relative'
from /Users/samnang/.rvm/gems/ruby-1.9.2-p180@dev/gems/green_shoes-1.0.273/lib/ext/hpricot.rb:20:in `<top (required)>'
from /Users/samnang/.rvm/gems/ruby-1.9.2-p180@dev/gems/green_shoes-1.0.273/lib/shoes/help.rb:6:in `<class:Manual>'
from /Users/samnang/.rvm/gems/ruby-1.9.2-p180@dev/gems/green_shoes-1.0.273/lib/shoes/help.rb:1:in `<top (required)>'
from /Users/samnang/.rvm/gems/ruby-1.9.2-p180@dev/gems/green_shoes-1.0.273/lib/shoes/manual.rb:4:in `load'
from /Users/samnang/.rvm/gems/ruby-1.9.2-p180@dev/gems/green_shoes-1.0.273/lib/shoes/manual.rb:4:in `show_manual'
from (irb):2
from /Users/samnang/.rvm/rubies/ruby-1.9.2-p180/bin/irb:16:in `<main>'
Same on Ubuntu, Ruby 1.9.2
I think this is because the included version of Hpricot is for windows only.
Here is a workaround:
- Install Hpricot
gem install hpricot
- Start IRB and be sure to require Hpricot first:
require 'hpricot'
- Then require Green Shoes
require 'green_shoes'
- Then you will be able to show the manual:
Shoes.show_manual 'English'
Just tried on Fedora 15, Ruby 1.9.2-p290, worked fine.
@ashbb,
Since green shoes is a gem, it would make sense to just have Hpricot as a dependency rather than include it. Would also be worth looking at swopping with Nokogiri
@i5m It indeed works as you describe here as well (Though I didn't need to do the hpricot install, even in this gemset).
@kotp so you must have already had Hpricot installed?
Yeah, either from my global RVM gemset or the default. I have yet to track it down. Obviously it is installed somewhere/sometime.
Warmest Regards,
Victor H. Goff III 維克多 My GPlus Profile http://bit.ly/rqK71A
Hi all,
The reason that I include Hpricot binary library files is because gem install hpricot
doesn't work on Windows (can't make .so files without C compiler).
But think over again, Green Shoes manual is just one of the Green Shoes apps. So, it may be better to separate it from the green_shoes gem itself. It many be better to make a new gem, e.g. green_shoes_manual gem, and replace Hpricot to Nokogiri.
ashbb
I think the manual may be important enough to 'just run' though. You can conditionally require 'hpricot' or 'hpricot_scan' based on the active OS.
I've never had any problems with gem install hpricot
on Windows as long as using the Ruby Installer versions of Ruby and their DevKit.