简体   繁体   English

在Mac OS X(Yosemite)上安装滑轨时遇到问题

[英]Having trouble installing rails on Mac OS X (Yosemite)

I'm trying to install rails on my Mac OS X (Yosemite). 我正在尝试在Mac OS X(Yosemite)上安装滑轨。 I get the following error: 我收到以下错误:

Mohammads-iMac:~ mohammadriazi$ gem install rails --no-ri --no-rdoc
Building native extensions.  This could take a while... ERROR:  Error
installing rails:   ERROR: Failed to build gem native extension.

    /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
extconf.rb checking if the C compiler accepts ... yes checking if the
C compiler accepts
-Wno-error=unused-command-line-argument-hard-error-in-future... no 
Building nokogiri using packaged libraries. checking for gzdopen() in
-lz... yes checking for iconv... yes
************************************************************************ IMPORTANT NOTICE:

Building Nokogiri with a packaged version of libxml2-2.9.2 with the
following patches applied:
    - 0001-Revert-Missing-initialization-for-the-catalog-module.patch
    - 0002-Fix-missing-entities-after-CVE-2014-3660-fix.patch

Team Nokogiri will keep on doing their best to provide security
updates in a timely manner, but if this is a concern for you and want
to use the system library instead; abort this installation process and
reinstall nokogiri as follows:

    gem install nokogiri -- --use-system-libraries
        [--with-xml2-config=/path/to/xml2-config]
        [--with-xslt-config=/path/to/xslt-config]

If you are using Bundler, tell it to use the option:

    bundle config build.nokogiri --use-system-libraries
    bundle install

Note, however, that nokogiri is not fully compatible with arbitrary
versions of libxml2 provided by OS/package vendors.

I did try updating gem, but I still get the error. 我确实尝试过更新gem,但是仍然出现错误。 I have also installed home-brew 我还安装了自制的

Please help! 请帮忙! Thanks 谢谢

Thanks for the pointers guys! 感谢指针的家伙! I read this article here: https://github.com/sstephenson/rbenv#homebrew-on-mac-os-x 我在这里阅读了这篇文章: https : //github.com/sstephenson/rbenv#homebrew-on-mac-os-x

It helped me understand rbenv. 它帮助我了解了rbenv。

  • I then updated my rbenv and Homebrew to the latest version. 然后,我将rbenv和Homebrew更新为最新版本。
  • Set my default ruby version to the latest version available. 将我的默认ruby版本设置为可用的最新版本。 (I guess the System Ruby installed on my MAC OS X was the default and this was causing the problem) (我猜我的MAC OS X上安装的System Ruby是默认的,这引起了问题)
  • Finally I used gem to install the latest version of rails and then a rehash. 最后,我使用gem安装了最新版本的rails,然后进行了重新哈希处理。

Everything works great now! 现在一切正常! Thanks 谢谢

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM