简体   繁体   English

无法在Rails 4.0中安装原子红宝石原子宝石

[英]Can't install atomic ruby atomic gem in rails 4.0

I've been doing quite a bit of research on this issue the last week or so but haven't found a solution that works for me, it's very frustrating. 上个星期左右,我一直在对该问题进行大量研究,但没有找到适合我的解决方案,这非常令人沮丧。 Hopefully somebody can point me in the right direction. 希望有人可以指出正确的方向。 Here's the error I recieve 这是我收到的错误

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.

This should work: 这应该工作:

gem install atomic -V

And then: 接着:

gem install rails -V

The -V is for Verbose. -V用于详细。 You'll see what happen. 您会看到发生了什么。 It worked for me on a Linux box, when gem update didn't. 它在Linux机器上对我有用,而gem update没有。

You also need to have the latest rubygem / bundler. 您还需要具有最新的rubygem /捆绑器。

This happened to me because I didn't have the right version of XCode Developer Tools for OS X Mavericks. 发生这种情况是因为我没有适用于OS X Mavericks的正确版本的XCode开发人员工具。 Then when I tried to update it, it said it wasn't available from the Software Update server. 然后,当我尝试更新它时,它说它不能从软件更新服务器上获得。 Details here . 详细信息在这里

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

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