问题
I can't seem to be get Ruby installed on my Mac. These are the steps I've taken so far:
- Downloaded the package from Ruby's site (http://www.ruby-lang.org/en/downloads/)
- Unpacked it running { tar xzvf ruby-1.9.1-p376.tar.gz }
- Went into the new ruby folder, and configured using {./configure}
This is where the error happens. When I run the configure, it gives me the error:
/usr/local/include/fuse/fuse_common.h:32:2: error: #error Please add -D_FILE_OFFSET_BITS=64 to your compile flags!
In file included from /usr/local/include/fuse/fuse.h:857,
from <command-line>:0:
/usr/local/include/fuse/fuse_compat.h:69:24: error: sys/statfs.h: No such file or directory
As a result, I can't make the package nor install it. I have no idea what is wrong. Any help is greatly appreciated. Thanks!
回答1:
This isnt ananswer so much as a suggested alternative... use macports :-)
回答2:
Have you tried RVM? It lets you manage multiple versions of ruby and will take of installing them and managing any gem versions for you. It's pretty magic!
After you've installed it all you need to do is:
`rvm install 1.9`
Done!
回答3:
If the last line of configure output is
config.status: creating Makefile
then you have a makefile and you can try building it.
I got the fuse.h error, and just ran make
to build a working ruby:
[neilk@maczombie ~]$ ruby --version
ruby 1.9.1p376 (2009-12-07 revision 26041) [i386-darwin10.2.0]
回答4:
Looks like others have run into this issue.
If you want need the binary, you could try rubyosx.
I guessing that the issue is that you have FUSE (or MacFUSE) installed in /usr/local and for whatever reason, the configure phase is doing something that's including it. If you're not trying to build ruby with some local extensions, but you want to build ruby yourself, try moving aside /usr/local (at least temporarily).
sudo mv /usr/local /usr/local.aside
(Beware, randomly messing with /usr and /usr/local directories can lead to trouble.)
回答5:
What happens if you set C_Flags or CPP_Flags before doing your ./configure?
来源:https://stackoverflow.com/questions/2143568/cant-install-ruby-1-9-1-on-macosx-10-6