Comments (13)
Hi ababich,
Thanks for reporting this.
Somehow it works for me under Mac OS X 10.6.6 with ruby 1.9.2p136 under rvm 1.2.7:
$ rvm use ruby-1.9.2-p136
$ ruby -v
ruby 1.9.2p136 (2010-12-25 revision 30365) [x86_64-darwin10.5.0]
$ gem -v
1.3.7
$ gem install ruby-stemmer
Building native extensions. This could take a while...
Successfully installed ruby-stemmer-0.8.2
1 gem installed
$ irb
ruby-1.9.2-p136 :002 > require 'lingua/stemmer'
=> true
ruby-1.9.2-p136 :003 > Lingua.stemmer( %w(incontestabil nendoielnic), :language => "ro" )
=> ["incontest", "nendoieln"]
$ rvm -v
rvm 1.2.7 by Wayne E. Seguin
There must be some particularity of you system, can you please post more details?
- What's the exact failure?
- What gives you:
%x[file #{File.expand_path(File.join(Config::CONFIG['bindir'], Config::CONFIG['RUBY_INSTALL_NAME']))}]
if you run it in an irb session? - What's the output of
echo $ARCHFLAGS
(in bash or in your shell)? - Can you post (e.g. in a gist / pull request) your changes?
For a history of issues related with compilation problems on Mac OS X, please check: issue 3, issue 5 and issue 6.
from ruby-stemmer.
1.
Your way didn't work for me and no solution was found, so what I did to solve the problem
https://gist.github.com/860186
This was caused by failing compilation of comptest.c using libstemmer.o in includes
https://gist.github.com/860194
This can be fixed using ranlib:
$ ranlib libstemmer_c/libstemmer.o
I've added a patch to extconf.rb:
# make libstemmer_c. unless we're cross-compiling.
unless RUBY_PLATFORM =~ /i386-mingw32/
system "cd #{LIBSTEMMER}; #{make} libstemmer.o; cd #{ROOT};"
exit unless $? == 0
end
if RUBY_PLATFORM =~ /darwin/
system "ranlib #{File.expand_path(File.join(LIBSTEMMER, 'libstemmer.o'))}"
end
last three lines - is my addition
after that it was almost work but compiling fails with ld message:
archive member '' with length 0 is not mach-o or bitcode
with exact empty '' - I found that this should hint to wrong arch when compiling internals of libstemmer.o
So, I have to provide ARCHFLAGS.
2.
The expression you have provided fails:
$ irb ruby-1.9.2-p136 :001 > %x[file #{File.expand_path(File.join(Config::CONFIG['bindir'], Config::CONFIG['RUBY_INSTALL_NAME']))}]
NameError: uninitialized constant Object::Config
from (irb):1
from /Users/coyote/.rvm/rubies/ruby-1.9.2-p136/bin/irb:16:in `<main>'
And I didn't resolve this.
3.
$ echo $ARCHFLAGS
<- EMPTY
So, I've noticed that logic is a bit wrong and changed clause in your code in extconf.rb:
- ENV['ARCHFLAGS']= "-arch " + %x[file #{File.expand_path(File.join(Config::CONFIG['bindir'], Config::CONFIG['RUBY_INSTALL_NAME']))}].strip!.match(/executable (.+)$/)[1] unless ENV['ARCHFLAGS'].nil?
+ ENV['ARCHFLAGS']= "-arch " + %x[file #{File.expand_path(File.join(Config::CONFIG['bindir'], Config::CONFIG['RUBY_INSTALL_NAME']))}].strip!.match(/executable (.+)$/)[1] if ENV['ARCHFLAGS'].nil?
in fact changed unless to if which allows me to provide external ARCHFLAGS
which makes me successful execution:
https://gist.github.com/860210
Making
$ gem build ruby-stemmer.gemspec
Successfully built RubyGem
Name: ruby-stemmer
Version: 0.8.5
File: ruby-stemmer-0.8.5.gem
this resulted gem was installed successfully.
Please, investigate :)
from ruby-stemmer.
Yeah, some issues like foo.txt I've sorted out too, but yesterday it was 0.8.2 and today a 0.8.5 :)
from ruby-stemmer.
Hi ababich,
Thanks for providing those details.
One more thing, what's the value of your COMMAND_MODE?
You can get it by running:
$ echo $COMMAND_MODE
in your shell. If is not unix2003 can you change it with:
$ export COMMAND_MODE=unix2003
and then try to compile it again? ( gem install ruby-stemmer should do it )
Does it work?
Thanks again.
ps. yeah, bumped the version number earlier today.
from ruby-stemmer.
NameError: uninitialized constant Object::Config #---> forgot to add but most likely you'll need require 'mkmf' before :|
from ruby-stemmer.
ruby-1.9.2-p136 :001 > require 'mkmf'
=> true
ruby-1.9.2-p136 :002 > %x[file #{File.expand_path(File.join(Config::CONFIG['bindir'], Config::CONFIG['RUBY_INSTALL_NAME']))}]
=> "/Users/coyote/.rvm/rubies/ruby-1.9.2-p136/bin/ruby: Mach-O 64-bit executable\n"
from ruby-stemmer.
Hi ababich,
So, what's the value of your COMMAND_MODE? (see this comment: https://github.com/aurelian/ruby-stemmer/issues#issue/9/comment/847166 )
I'm trying to figure-out a solution for your problem without forcing -arch flag (rumors that Apple compilers will drop it).
from ruby-stemmer.
Oh, sorry - few moments
from ruby-stemmer.
$ echo $COMMAND_MODE
legacy
$ export COMMAND_MODE=unix2003
$ echo $COMMAND_MODE
unix2003
$ ruby -v #to ensure correct environment
ruby 1.9.2p136 (2010-12-25 revision 30365) [x86_64-darwin10]
$ gem uninstall ruby-stemmer
$ gem install ruby-stemmer
Fetching: ruby-stemmer-0.9.0.gem (100%)
Building native extensions. This could take a while...
Successfully installed ruby-stemmer-0.9.0
1 gem installed
Installing ri documentation for ruby-stemmer-0.9.0...
Installing RDoc documentation for ruby-stemmer-0.9.0...
Like a charm!! Many thanks!
from ruby-stemmer.
Without setting COMMAND_MODE still does not work with the same errors
from ruby-stemmer.
Looks like everybody who uses iTerm instead of system Terminal.app may be affected by COMMAND_MODE issue and should add this export to ~/.profile by default
from ruby-stemmer.
Great!
Will try to come up with a proper fix soon (like exporting unix2003 in extconf.rb).
from ruby-stemmer.
bump to 0.9.1 (closed by b124b72)
from ruby-stemmer.
Related Issues (20)
- warning: implicit conversion shortens 64-bit value into a 32-bit value
- Bundler uses :require, not :lib HOT 1
- Mac OS X installation with/without ARCHFLAGS + rvm not working HOT 5
- czech stemmer
- Bulgarian stemmer HOT 5
- This stemmer doesn't support spanish language HOT 1
- version.rb missing from 0.9.4 release HOT 2
- Stemming single-item array should yield an array HOT 1
- "simply" and "simple" give different stems HOT 1
- How to detect supported languages? HOT 2
- RubyNLP HOT 1
- libstemmer_c build is broken on Ubuntu HOT 2
- jruby support HOT 2
- German umlauts are being converted HOT 1
- [Windows] Can't install stemmer by any means. HOT 10
- Gem installation failing on Windows 10
- Compile problems on OSX HOT 2
- Latin support HOT 1
- Ruby 1.9 and encoding HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ruby-stemmer.