繁体   English   中英

Xcode无法安装在OSX 10.9.2上

[英]Xcode can not be installed on OSX 10.9.2

使用OS X 10.9.2 Mavericks

我在安装github-pages gem时遇到了麻烦。 我需要先安装Xcode,但这会导致错误。 我尝试使用以下命令安装Xcode: xcode-select --install 该对话框显示三个选项:“下载Xcode”,“不立即安装”,“安装”当我选择“安装”并选择“接受”后,该过程开始并在一段时间后停止。 显示该软件在更新服务器上不可用。 当我选择“下载Xcode”时,App Store启动,我可以安装Xcode。 仍然似乎未安装Xcode,请参阅以下步骤。

安装Xcode后,我启动终端并按照与页面一起使用Jekyll上的说明进行操作

当我在根文件夹中运行sudo bundle install --verbose ,编译器会生成error:/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:430:in 'try_do': The compiler failed to generate an executable file. (RuntimeError) error:/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:430:in 'try_do': The compiler failed to generate an executable file. (RuntimeError)

您必须先安装开发工具。

Below the output of the `sudo bundle install` command:

Fetching from: https://rubygems.org/api/v1/dependencies
HTTP Redirection
Fetching from: https://bundler.rubygems.org/api/v1/dependencies
HTTP Success
Fetching gem metadata from https://rubygems.org/
Query List: ["RedCloth", "blankslate", "fast-stemmer", "classifier", "colorator", "highline", "commander", "ffi", "liquid", "rb-fsevent", "rb-inotify", "rb-kqueue", "listen", "maruku", "posix-spawn", "yajl-ruby", "pygments.rb", "redcarpet", "safe_yaml", "parslet", "toml", "jekyll", "kramdown", "rdiscount", "github-pages"]
Query Gemcutter Dependency Endpoint API: RedCloth,blankslate,fast-stemmer,classifier,colorator,highline,commander,ffi,liquid,rb-fsevent,rb-inotify,rb-kqueue,listen,maruku,posix-spawn,yajl-ruby,pygments.rb,redcarpet,safe_yaml,parslet,toml,jekyll,kramdown,rdiscount,github-pages
Fetching from: https://rubygems.org/api/v1/dep...ramdown,rdiscount,github-pages
HTTP Redirection
Fetching from: https://bundler.rubygems.org/ap...ramdown,rdiscount,github-pages
HTTP Success
Query List: ["stemmer", "rake", "bones", "jekyll-redirect-from", "jekyll-mentions", "jemoji", "termios", "jekyll-coffeescript", "sass", "mercenary", "directory_watcher", "open4", "hoe", "albino", "celluloid-io", "celluloid", "rb-fchange", "syntax", "rubypython", "echoe", "psych"]
Query Gemcutter Dependency Endpoint API: stemmer,rake,bones,jekyll-redirect-from,jekyll-mentions,jemoji,termios,jekyll-coffeescript,sass,mercenary,directory_watcher,open4,hoe,albino,celluloid-io,celluloid,rb-fchange,syntax,rubypython,echoe,psych
Fetching from: https://rubygems.org/api/v1/dep...,syntax,rubypython,echoe,psych
HTTP Redirection
Fetching from: https://bundler.rubygems.org/ap...,syntax,rubypython,echoe,psych
HTTP Success
Query List: ["loquacious", "little-plugger", "rdoc", "rspec", "bones-git", "bones-extras", "timers", "facter", "nio4r", "allison", "rubyforge", "gemcutter", "rcov", "RubyInline", "coffee-script", "html-pipeline", "gemoji", "win32-api"]
Query Gemcutter Dependency Endpoint API: loquacious,little-plugger,rdoc,rspec,bones-git,bones-extras,timers,facter,nio4r,allison,rubyforge,gemcutter,rcov,RubyInline,coffee-script,html-pipeline,gemoji,win32-api
Fetching from: https://rubygems.org/api/v1/dep...html-pipeline,gemoji,win32-api
HTTP Redirection
Fetching from: https://bundler.rubygems.org/ap...html-pipeline,gemoji,win32-api
HTTP Success
Query List: ["bones-rcov", "bones-rubyforge", "bones-rspec", "bones-zentest", "git", "coffee-script-source", "execjs", "win32console", "windows-pr", "windows-api", "win32-dir", "sys-admin", "CFPropertyList", "json", "json_pure", "net-scp", "activesupport", "nokogiri", "escape_utils", "rinku", "sanitize", "github-markdown", "github-linguist", "minitest", "rspec-mocks", "rspec-expectations", "rspec-core", "cucumber", "diff-lcs", "spicycode-rcov", "ZenTest", "hitimes", "test-unit"]
Query Gemcutter Dependency Endpoint API: bones-rcov,bones-rubyforge,bones-rspec,bones-zentest,git,coffee-script-source,execjs,win32console,windows-pr,windows-api,win32-dir,sys-admin,CFPropertyList,json,json_pure,net-scp,activesupport,nokogiri,escape_utils,rinku,sanitize,github-markdown,github-linguist,minitest,rspec-mocks,rspec-expectations,rspec-core,cucumber,diff-lcs,spicycode-rcov,ZenTest,hitimes,test-unit
Fetching from: https://rubygems.org/api/v1/dep...rcov,ZenTest,hitimes,test-unit
HTTP Redirection
Fetching from: https://bundler.rubygems.org/ap...rcov,ZenTest,hitimes,test-unit
HTTP Success
Query List: ["thread_safe", "tzinfo", "multi_json", "i18n", "builder", "memcache-client", "libxml-ruby", "multi_test", "gherkin", "term-ansicolor", "treetop", "polyglot", "mime-types", "charlock_holmes", "configuration", "mkrf", "rake-compiler", "spruz", "net-ssh", "mini_portile", "racc", "tenderlove-frex", "rexical", "weakling", "rspec-support", "hpricot", "htmlentities", "win32-security"]
Query Gemcutter Dependency Endpoint API: thread_safe,tzinfo,multi_json,i18n,builder,memcache-client,libxml-ruby,multi_test,gherkin,term-ansicolor,treetop,polyglot,mime-types,charlock_holmes,configuration,mkrf,rake-compiler,spruz,net-ssh,mini_portile,racc,tenderlove-frex,rexical,weakling,rspec-support,hpricot,htmlentities,win32-security
Fetching from: https://rubygems.org/api/v1/dep...ot,htmlentities,win32-security
HTTP Redirection
Fetching from: https://bundler.rubygems.org/ap...ot,htmlentities,win32-security
HTTP Success
Query List: ["trollop", "archive-tar-minitar", "needle", "jruby-pageant", "tins", "atomic", "facets"]
Query Gemcutter Dependency Endpoint API: trollop,archive-tar-minitar,needle,jruby-pageant,tins,atomic,facets
Fetching from: https://rubygems.org/api/v1/dep...uby-pageant,tins,atomic,facets
HTTP Redirection
Fetching from: https://bundler.rubygems.org/ap...uby-pageant,tins,atomic,facets
HTTP Success
Query List: []
Fetching additional metadata from https://rubygems.org/
Query List: ["tenderlove-frex", "spicycode-rcov"]
Query Gemcutter Dependency Endpoint API: tenderlove-frex,spicycode-rcov
Fetching from: https://rubygems.org/api/v1/dep...tenderlove-frex,spicycode-rcov
HTTP Redirection
Fetching from: https://bundler.rubygems.org/ap...tenderlove-frex,spicycode-rcov
HTTP Success
Query List: []

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb --with-cflags=-w
checking for main() in -lc... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.

Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
--with-redcloth_scan-dir
--without-redcloth_scan-dir
--with-redcloth_scan-include
--without-redcloth_scan-include=${redcloth_scan-dir}/include
--with-redcloth_scan-lib
--without-redcloth_scan-lib=${redcloth_scan-dir}/
--with-clib
--without-clib
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:430:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:509:in `block in try_link0'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/tmpdir.rb:88:in `mktmpdir'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:506:in `try_link0'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:530:in `try_link'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:716:in `try_func'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:946:in `block in have_library'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:891:in `block in checking_for'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:336:in `block (2 levels) in postpone'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:306:in `open'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:336:in `block in postpone'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:306:in `open'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:332:in `postpone'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:890:in `checking_for'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:941:in `have_library'
from extconf.rb:5:in `<main>'

Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/RedCloth-4.2.9 for inspection.
Results logged to /Library/Ruby/Gems/2.0.0/gems/RedCloth-4.2.9/ext/redcloth_scan/gem_make.out
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/ext/builder.rb:60:in `run'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/ext/ext_conf_builder.rb:37:in `block in build'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/tempfile.rb:324:in `open'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/ext/ext_conf_builder.rb:18:in `build'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/installer.rb:678:in `block (2 levels) in build_extensions'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/installer.rb:677:in `chdir'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/installer.rb:677:in `block in build_extensions'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/installer.rb:652:in `each'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/installer.rb:652:in `build_extensions'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/installer.rb:218:in `install'
/Library/Ruby/Gems/2.0.0/gems/bundler-1.5.3/lib/bundler/source/rubygems.rb:100:in `block in install'
/Library/Ruby/Gems/2.0.0/gems/bundler-1.5.3/lib/bundler/rubygems_integration.rb:118:in `preserve_paths'
/Library/Ruby/Gems/2.0.0/gems/bundler-1.5.3/lib/bundler/source/rubygems.rb:93:in `install'
/Library/Ruby/Gems/2.0.0/gems/bundler-1.5.3/lib/bundler/installer.rb:111:in `block in install_gem_from_spec'
/Library/Ruby/Gems/2.0.0/gems/bundler-1.5.3/lib/bundler/rubygems_integration.rb:150:in `with_build_args'
/Library/Ruby/Gems/2.0.0/gems/bundler-1.5.3/lib/bundler/installer.rb:110:in `install_gem_from_spec'
/Library/Ruby/Gems/2.0.0/gems/bundler-1.5.3/lib/bundler/installer.rb:265:in `block in install_sequentially'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/forwardable.rb:171:in `each'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/forwardable.rb:171:in `each'
/Library/Ruby/Gems/2.0.0/gems/bundler-1.5.3/lib/bundler/installer.rb:264:in `install_sequentially'
/Library/Ruby/Gems/2.0.0/gems/bundler-1.5.3/lib/bundler/installer.rb:97:in `run'
/Library/Ruby/Gems/2.0.0/gems/bundler-1.5.3/lib/bundler/installer.rb:15:in `install'
/Library/Ruby/Gems/2.0.0/gems/bundler-1.5.3/lib/bundler/cli.rb:255:in `install'
/Library/Ruby/Gems/2.0.0/gems/bundler-1.5.3/lib/bundler/vendor/thor/command.rb:27:in `run'
/Library/Ruby/Gems/2.0.0/gems/bundler-1.5.3/lib/bundler/vendor/thor/invocation.rb:121:in `invoke_command'
/Library/Ruby/Gems/2.0.0/gems/bundler-1.5.3/lib/bundler/vendor/thor.rb:363:in `dispatch'
/Library/Ruby/Gems/2.0.0/gems/bundler-1.5.3/lib/bundler/vendor/thor/base.rb:440:in `start'
/Library/Ruby/Gems/2.0.0/gems/bundler-1.5.3/lib/bundler/cli.rb:10:in `start'
/Library/Ruby/Gems/2.0.0/gems/bundler-1.5.3/bin/bundle:20:in `block in <top (required)>'
/Library/Ruby/Gems/2.0.0/gems/bundler-1.5.3/lib/bundler/friendly_errors.rb:5:in `with_friendly_errors'
/Library/Ruby/Gems/2.0.0/gems/bundler-1.5.3/bin/bundle:20:in `<top (required)>'
/usr/bin/bundle:23:in `load'
/usr/bin/bundle:23:in `<main>'
An error occurred while installing RedCloth (4.2.9), and Bundler cannot continue.
Make sure that `gem install RedCloth -v '4.2.9'` succeeds before bundling.

您面临的问题特定于OSX Mavericks和最新版本的XCode (截至今天,2014年5月21日) 我也在10.9.2上,并且我遇到了以下问题,我相信这也是您面临的问题。

以下是我在尝试安装/构建Ruby gem时遇到的问题,这些问题涉及编译本机代码和/或某些依赖的依赖项:

  • Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers.您得到类似Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. 在输出中的某处。

    原因:您的系统上未安装ubiquitus 命令行工具

    解决方案:有3种安装命令行工具的方法1)安装完整的XCode套件,启动它,然后让它为您安装命令行工具2)运行xcode-select --install ,将弹出一个对话框,询问您是否要安装完整的XCode仅安装命令行工具或“ 取消” 第二种方法是我所做的,并且对我有用一次,但是我发现它在其他机器上失败了,因为有时可以访问(有时无法访问)在线查找软件包的位置,因此请尝试尝试此操作,但它可能无法正常运行,最后3)从Web上的Apple Developer Tools页面下载(需要使用Apple帐户登录)

  • 您会在输出中的某处得到类似clang: error: unknown argument: '-multiply_definedsuppress' [-Wunused-command-line-argument-hard-error-in-future]

    原因:最新版本的XCode删除了对未使用的命令行参数的支持,因为XCode 5.1发行说明提到

    编译器

    从Apple LLVM编译器版本5.1(clang-502)及更高版本开始,优化级别-O4不再意味着链接时间优化(LTO)。 为了使用LTO进行构建,除了优化级别标志之外,还明确使用-flto选项。 (15633276)

    Xcode 5.1中的Apple LLVM编译器将无法识别的命令行选项视为错误。 在构建Python本机扩展和Ruby Gems(其中当前指定了一些无效的编译器选项)时,已经看到了此问题。

    使用无效的编译器选项的项目将需要更改以删除这些选项。 为了帮助简化过渡,编译器将临时接受一个选项,将错误降级为警告:

    -Wno误差=未使用的命令行参数的硬错误功能于未来

    注意:将来将不再支持此选项。

    要解决此问题,请设置ARCHFLAGS环境变量以将错误降级为警告。 例如,您可以使用以下命令安装Python本机扩展:

    $ ARCHFLAGS = -Wno-error =未使用的命令行参数-将来的硬错误easy_install ExtensionName

    同样,您可以使用以下命令安装Ruby Gem:

    $ ARCHFLAGS = -Wno-error =未使用的命令行参数-将来的错误错误gem install GemName(16214764)

    解决方案:上面的XCode发行说明的摘录中提到了该解决方案,并且基本上意味着在运行gem install之前设置环境变量ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future ,像这样:

     export ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future gem install <your-desired-gem> 

    ...或者,如果您需要以sudo身份执行它,请将上述两行放在脚本中并以sudo身份执行,或者以sudo inline的形式运行,如下所示:

     sudo bash -c "export ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future; gem install <your-desired-gem>;"; 

    注意:如上述发行说明所述,上述解决方案(设置ARCHFLAGS环境变量)将在将来的某个时候停止工作。 希望到那时,当前的Ruby gems将从其Makefile删除未使用的命令行选项。

注意:我使用上面概述的方法在OSX 10.9.2中成功安装了github-pages Ruby gem

从App Store安装后,请在Applications目录中找到Xcode并启动它(而不是从终端启动)。 它可能会告诉您它需要下载更多内容。 让它。 然后,您可以继续进行操作,并按照需要Xcode的其他软件的说明进行操作。 如果仍然无法正常运行,则可能是其他软件的安装说明存在问题。 我会联系该软件的维护者以询问详细信息。 祝好运!

暂无
暂无

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

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