green_shoes icon indicating copy to clipboard operation
green_shoes copied to clipboard

Doesn't work on Mac OS X Lion

Open samnang opened this issue 13 years ago • 8 comments

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>'

samnang avatar Aug 20 '11 04:08 samnang

Same on Ubuntu, Ruby 1.9.2

kotp avatar Aug 20 '11 06:08 kotp

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

atomicules avatar Aug 20 '11 12:08 atomicules

@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 avatar Aug 20 '11 12:08 kotp

@kotp so you must have already had Hpricot installed?

atomicules avatar Aug 20 '11 16:08 atomicules

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

kotp avatar Aug 21 '11 00:08 kotp

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

ashbb avatar Aug 21 '11 05:08 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.

kotp avatar Aug 21 '11 12:08 kotp

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.

atomicules avatar Aug 21 '11 13:08 atomicules