Try the attached gem file first, if it doesn’t work then follow these steps
You can download the gem file from Here
First, try to use command ‘sudo gem install stemmer4r’, yeah, you get an error, that is right, don’t clean up your screen yet. It will give your the stemmer4r gem path you installed, mine is /Library/Ruby/Gems/1.8/gems/stemmer4r-0.6, maybe yours is different.
Go to that directory search the entire gems directory and replace ’/usr/local/ruby/lib/ruby/1.8/i686-linux’ to be something like ’/System/Library/Frameworks/Ruby.framework/Versions/1.8/Headers’, because your ruby headers are in this directory, you are not using Linux, right?
Go to /Library/Ruby/Gems/1.8/gems/stemmer4r-0.6/ext/stemmer4r folder, and modify the extconf.rb file ,replace the first line from ’#!/usr/bin/ruby -w’ to ’#ruby -w’
Stay in this directory and do command ‘sudo make’
Go to ’/Library/Ruby/Gems/1.8/gems/stemmer4r-0.6’ and type command ‘gem build stemmer4r.gemspec’
Then you got your own stemmer4r-0.6.gem file and you can do ‘sudo gem install stemmer4r-0.6.gem’, succeeded? Good job!
