无法在 MacOSX 10.6 上安装 ruby 1.9.1
我似乎无法在 Mac 上安装 Ruby。到目前为止,我已经采取了以下步骤:
- 从 Ruby 站点 (http:// /www.ruby-lang.org/en/downloads/)
- 解压运行 { tar xzvf ruby-1.9.1-p376.tar.gz }
- 进入新的 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
因此,我无法制作包也无法安装它。我不知道出了什么问题。非常感谢任何帮助。谢谢!
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!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
您是否尝试过RVM?它可以让您管理 ruby 的多个版本,并为您安装它们并管理任何 gem 版本。这真是太神奇了!
安装完成后,您需要做的就是:
完成!
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:
Done!
如果配置输出的最后一行是,
那么您就有了一个 makefile,您可以尝试构建它。
我收到了 fusion.h 错误,然后运行
make
来构建一个可以工作的 ruby:If the last line of configure output is
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:看起来其他人也遇到了此问题。
如果您需要二进制文件,可以尝试 rubyosx。
我猜测问题是您在 /usr/local 中安装了 FUSE(或 MacFUSE),并且无论出于何种原因,配置阶段正在执行包含它的操作。如果您不想尝试使用某些本地扩展来构建 ruby,而是想自己构建 ruby,请尝试将 /usr/local 移到一边(至少暂时)。
(请注意,随意弄乱 /usr 和 /usr/local 目录可能会导致麻烦。)
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).
(Beware, randomly messing with /usr and /usr/local directories can lead to trouble.)
如果在执行 ./configure 之前设置 C_Flags 或 CPP_Flags 会发生什么?
What happens if you set C_Flags or CPP_Flags before doing your ./configure?
这不是一个答案,而是一个建议的替代方案......使用 macports :-)
This isnt ananswer so much as a suggested alternative... use macports :-)