开发者

Can't install ruby 1.9.1 on MacOSX 10.6

I can't seem to be get Ruby installed开发者_StackOverflow中文版 on my Mac. These are the steps I've taken so far:

  1. Downloaded the package from Ruby's site (http://www.ruby-lang.org/en/downloads/)
  2. Unpacked it running { tar xzvf ruby-1.9.1-p376.tar.gz }
  3. 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!


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!


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]


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.)


What happens if you set C_Flags or CPP_Flags before doing your ./configure?


This isnt ananswer so much as a suggested alternative... use macports :-)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜