1

上周左右我一直在对这个问题进行大量研究,但没有找到适合我的解决方案,这非常令人沮丧。希望有人能指出我正确的方向。这是我收到的错误

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

/Users/Name/.rvm/rubies/ruby-2.0.0-p247/bin/ruby extconf.rb
* 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=/Users/Name/.rvm/rubies/ruby-2.0.0-p247/bin/ruby --with-atomic_reference-dir --without-atomic_reference-dir --with-atomic_reference-include --without-atomic_reference-include=${atomic_reference-dir}/include --with-atomic_reference-lib --without-atomic_reference-lib=${atomic_reference-dir}/ /Users/Name/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/mkmf.rb:434:in try_do': The compiler failed to generate an executable file. (RuntimeError) You have to install development tools first. from /Users/Name/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/mkmf.rb:519:intry_link0' from /Users/Name/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/mkmf.rb:817:in try_run' from extconf.rb:24:in'

Gem files will remain installed in /Users/Name/.rvm/gems/ruby-2.0.0-p247@swi----ense/gems/atomic-1.1.12 for inspection. Results logged to /Users/Name/.rvm/gems/ruby-2.0.0-p247@sw-----nse/gems/atomic-1.1.12/ext/gem_make.out

An error occurred while installing atomic (1.1.12), and Bundler cannot continue. Make sure that gem install atomic -v '1.1.12' succeeds before bundling.
4

2 回答 2

2

这应该有效:

gem install atomic -V

进而:

gem install rails -V

-V 表示详细。你会看到会发生什么。它在 Linux 机器上对我有用,gem update但没有。

您还需要拥有最新的 ruby​​gem / bundler。

于 2013-09-25T15:56:35.023 回答
0

这发生在我身上是因为我没有适用于 OS X Mavericks 的正确版本的 XCode 开发人员工具。然后当我尝试更新它时,它说它不能从软件更新服务器获得。详情在这里

于 2014-04-15T14:34:46.400 回答