0

我似乎无法在我的 Mac 上安装 Ruby。这些是我到目前为止采取的步骤:

  1. 从 Ruby 的网站 ( http://www.ruby-lang.org/en/downloads/ )下载了包
  2. 解压它运行 { tar xzvf ruby​​-1.9.1-p376.tar.gz }
  3. 进入新的 ruby​​ 文件夹,并使用 {./configure} 进行配置

这就是错误发生的地方。当我运行配置时,它给了我错误:

/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

结果,我无法制作包或安装它。我不知道出了什么问题。任何帮助是极大的赞赏。谢谢!

4

5 回答 5

3

你试过RVM吗?它可以让您管理多个版本的 ruby​​,并会为您安装和管理任何 gem 版本。这很神奇!

安装完成后,您需要做的就是:

`rvm install 1.9`

完毕!

于 2010-01-27T00:41:58.390 回答
2

如果配置输出的最后一行是

config.status: creating Makefile

然后你有一个makefile,你可以尝试构建它。

我得到了 fuse.h 错误,然后跑去make构建一个工作红宝石:

[neilk@maczombie ~]$ ruby --version
ruby 1.9.1p376 (2009-12-07 revision 26041) [i386-darwin10.2.0]
于 2010-02-10T20:34:24.527 回答
1

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

于 2010-01-27T01:22:50.813 回答
0

如果在进行 ./configure 之前设置 C_Flags 或 CPP_Flags 会发生什么?

于 2010-01-27T00:08:20.887 回答
-2

这与其说是一个建议的替代方案,不如说是一个答案……使用 macports :-)

于 2010-01-27T01:01:35.787 回答