Ruby-on-rails Rails 安装错误:“原子”本机 gem 需要安装构建工具

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/17499946/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-02 22:17:24  来源:igfitidea点击:

Rails Installation error :The 'atomic' native gem requires installed build tools

ruby-on-railsrubyruby-on-rails-3rubygemsopen-source

提问by Tatarao voleti

i m installing Rails 3 on my windows. I installed latest ruby 2.0.0, and i updated gems. but when i installing rails by using gem install rails , successful message has come but at last i found

我在我的 Windows 上安装 Rails 3。我安装了最新的 ruby​​ 2.0.0,并更新了 gems。但是当我使用 gem install rails 安装 rails 时,成功的消息来了,但最后我发现

 ERROR:  Error installing rails:
     The 'atomic' native gem requires installed build tools

    Please update your PATH to include build tools or download the DevKit
    from 'http://rubyinstaller.org/downloads' and follow the instructions
    at 'http://github.com/oneclick/rubyinstaller/wiki/Development-Kit'

plese help me...

请帮帮我...

采纳答案by Krishna Rani Sahoo

I have also gone through the same problem. After doing a lot of research, I found a solution that works.

我也遇到了同样的问题。经过大量研究,我找到了一个有效的解决方案。

Run this command:

运行此命令:

pik list

It should show you

它应该告诉你

187: ruby 1.8.7 (2010-08-16 patchlevel 302) [i386-mingw32]
192: ruby 1.9.2p290 (2011-07-09) [i386-mingw32]
193: ruby 1.9.3p327 (2012-11-10) [i386-mingw32]
200: ruby 2.0.0p247 (2013-06-27) [i386-mingw32]

If it's not pointing to Ruby version 200 then run the following:

如果它不是指向 Ruby 版本 200,则运行以下命令:

pik use 200

Now run the following to enhance DevKit to your installed Ruby:

现在运行以下命令来增强 DevKit 到你安装的 Ruby:

ruby dk.rb install

Finally, run the following:

最后,运行以下命令:

gem install rails

This will install latest Rails version 4 for Ruby 2.0.

这将为 Ruby 2.0 安装最新的 Rails 版本 4。

回答by Erkut Evirgen

As error message said, you need to install Ruby DevKit which can be obtained from RubyInstaller.org. (also need to check suitable Devkit version from there..)

如错误消息所述,您需要安装可从 RubyInstaller.org 获得的 Ruby DevKit。(还需要从那里检查合适的 Devkit 版本..)

And extract the DevKit zip file into somewhere (you are using windows then-> : c:\xxxx) Navigate to c:\xxxx and run "ruby dk.rb init" and then "ruby dk.rb install"..

并将 DevKit zip 文件解压缩到某处(您正在使用 windows then-> : c:\xxxx)导航到 c:\xxxx 并运行“ruby dk.rb init”,然后运行“ruby dk.rb install”..

And try to re-insall rails..

并尝试重新安装导轨..

I hope this helps,

我希望这有帮助,

回答by dada

I also gone through the same problem. :) but is my first install of ruby on windows and "pik" is not avaible so i place me in the devkit folder and try : ruby dk.rb init and ruby dk.rb install and finaly gem install rails ... no more faillure

我也遇到了同样的问题。:) 但这是我第一次在 Windows 上安装 ruby​​ 并且“pik”不可用,所以我将我放在 devkit 文件夹中并尝试: ruby​​ dk.rb init 和 ruby​​ dk.rb install 和 finaly gem install rails ... 没有更多失败

回答by ChocapicSz

github.comtells us that:

github.com告诉我们:

The path to your RUBY_INSTALL_DIR must not contain any whitespaces (like in “C:\Program Files\Ruby193”). This is very important because whitespaces in the path to your ruby installation will cause certain error messages as soon as you try to install gems which require the DevKit.

RUBY_INSTALL_DIR 的路径不得包含任何空格(如“C:\Program Files\Ruby193”)。这非常重要,因为只要您尝试安装需要 DevKit 的 gem,ruby 安装路径中的空格就会导致某些错误消息。

This solved the problem of this kind for me.

这为我解决了此类问题。

回答by Craig

You're probably not going to like this answer but if you go: https://github.com/oneclick/rubyinstaller/wiki/Development-Kit
like it says in the message it actually helps you quite a bit.

你可能不会喜欢这个答案,但如果你去:https: //github.com/oneclick/rubyinstaller/wiki/Development-Kit
就像它在消息中所说的那样,它实际上对你有很大帮助。

It tells you to install the Development-Kit then cd to the directory that you put it the run “ruby dk.rb init” and “ruby dk.rb install” and when it finishes then you can run "gem install rails" and it simply works.

它告诉你安装开发工具包,然后 cd 到你放置它的目录,运行“ruby dk.rb init”和“ruby dk.rb install”,当它完成后你可以运行“gem install rails”,它简单的工作。

Easy to miss as I didn't see it the first time either

很容易错过,因为我也不是第一次看到