2013-10-23 85 views
1

我只是部署一些新的代码(仅在景色一些文本更新)(JSON),并在处理命令帽部署,我得到了以下错误消息:Amazon EC2 - Gem :: Installer :: ExtensionBuildError:错误:无法构建gem本机扩展。

** [out :: IP] Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. 
** [out :: IP] 
** [out :: IP] /usr/local/bin/ruby extconf.rb 
** [out :: IP] creating Makefile 
** [out :: IP] 
** [out :: IP] make "DESTDIR=" 
** [out :: IP] 
** [out :: IP] Gem files will remain installed in /home/deployer/fileto/shared/bundle/ruby/2.0.0/gems/json-1.8.1 for inspection. 
** [out :: IP] Results logged to /home/deployer/appname/shared/bundle/ruby/2.0.0/gems/json-1.8.1/ext/json/ext/generator/gem_make.out 
** [out :: IP] An error occurred while installing json (1.8.1), and Bundler cannot continue. 
** [out :: IP] Make sure that `gem install json -v '1.8.1'` succeeds before bundling. 

今天刚出现的时候,我没有”不要做任何与应用程序有关的2周。我已经尝试将gem添加到Gemfile中,但它没有帮助 - 仍然是同样的错误。

什么问题?

谢谢

回答

0

据我所知。这件事情可能会发生由于不同的原因,

1) The gem version you are using or their dependency are not supported with other gem version or the ruby version you are using. 
2) there is not enough permission to install the gem 
3) the gem version is not present in the repository. 

我很抱歉,我不能给你确切的解决方案,但你可以选中此选项,并相应地尝试。

0

这是EC2发展之谜之一。

我登录到EC2服务器解决了这个问题,并跑有以下命令:

sudo gem install json 

之后,我能够正确地部署应用程序。但是,我仍然不明白为什么或从哪里发生这个问题。

0

我有同样的问题,也许它可能是新版本的JSON宝石。为了覆盖JSON宝石的新版本bundle update:我加入这行到我的Gemfile:

gem 'json', '1.8.0' 

(JSON的宝石的以前版本)

然后运行。

我不知道新版本的gem有什么问题,但它在10月17日发布,如果你以前没有这个问题,也许它是更新的宝石...?

3

晚的答案,但因为我与谷歌来到这里,别人还不如:

您需要重新安装的命令行工具。我假设你升级到小牛队?它从xcode中剔除了CLI。您现在必须切实前往Apple开发者网站并下载适用于Mavericks的CL工具: https://developer.apple.com/downloads/index.action?name=for%20Xcode%20-#

安装后,应该可以使用捆绑包。

0

如果你正在运行RVM,那么除了安装了小牛的命令行工具,如通过@麦克 - manfrin提供的答案,你可能还需要做到以下几点:

  • 更新RVM

rvm get latest

  • 重新安装红宝石您的项目或宝石使用

rvm reinstall <ruby-version>

使用rvm list如果您不确定哪个红宝石您正在使用。经过这两个步骤后,我发现我可以捆绑项目并且json gem安装正确。

相关问题