Windows上的Gem更新 - 是否被破坏? [英] Gem update on Windows - is it broken?

查看:93
本文介绍了Windows上的Gem更新 - 是否被破坏?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是此问题的后续行动

a>。



当我在Windows上发布 gem update 命令时,得到一个
的宝石,它的最新版本没有Windows二进制文件,它会尝试
构建本地扩展,当然这会失败。例如:

 更新sqlite3-ruby 
构建本机扩展。这可能需要一段时间...
错误:执行gem时(Gem :: Installer :: ExtensionBuildError)
错误:无法构建gem原生扩展。

c:/ruby/bin/ruby.exe extconf.rb更新
在rt.lib中检查fdatasync()...没有
检查sqlite3.h ...无

nmake
'nmake'不被识别为内部或外部命令,
可操作程序或批处理文件。

请求所需平台至少
的旧版1.x行为更新可能。现在我无法更新,除非我卸载
麻烦的宝石(目前是sqlite3-ruby和hpricot),运行更新,
然后使用--version开关重新安装宝石。



有没有人有解决这个问题的方法,或者我们坚持使用它?




注:

  $ gem -v 
1.2.0

$ ruby​​ -v
ruby​​ 1.8.6(2007-09-24 patchlevel 111)[i386-mswin32]






注意(2008年9月26日):我刚刚更新到gem 1.3.0,并且此问题仍然存在。 / p>

注意(2008年11月18日):刚刚更新至gems 1.3.1,问题仍然存在。



注意(2009年4月28日):最新版本的Gems( 1.3.2 )现在跳过了更新期间本机扩展的构建失败的任何宝石;换句话说,问题是固定的。 Hooray!

解决方案

宝石, version 1.3.2 ,现在将跳过无法构建的宝石,因此请将Rubygems更新为最新版本,并在此处讨论此问题

  gem update --system 

现在不推荐使用以下解决方案,但我将其留在此处作为记录。

b $ b

我在在Ruby论坛上启动了关于此问题的线程(这是邮件列表的前端)。有一些有趣的讨论;值得一读。这里有一个非常黑客的解决方案:

 `gem.bat outdated`.split(/ \\\
/ ).MAP {| Z | z.scan(/ ^ [^ [:空间:]] + /)}。flatten.each {| Z | `gem.bat update#{z}`}

它调用 gem过时的命令,并建立一个所有过时宝石的列表。然后它遍历列表并针对每个过期的gem调用 gem update 。如果一个失败了,它就会移到下一个。


This is a follow-up to this question.

When I issue the gem update command on Windows, whenever it gets to a gem whose latest version DOESN'T have Windows binaries, it'll attempt to build the native extension which will, of course, fail. For example:

Updating sqlite3-ruby
Building native extensions.  This could take a while...
ERROR:  While executing gem ... (Gem::Installer::ExtensionBuildError)
  ERROR: Failed to build gem native extension.

c:/ruby/bin/ruby.exe extconf.rb update
checking for fdatasync() in rt.lib... no
checking for sqlite3.h... no

nmake
'nmake' is not recognized as an internal or external command,
operable program or batch file.

The old pre-1.x behavior of asking for the required platform at least made updating possible. Now I can't update at all unless I uninstall the troublesome gems (currently sqlite3-ruby and hpricot), run the update, then re-install the gems using the --version switch.

Does anyone have a solution to this conundrum or are we stuck with it?


Note:

$ gem -v
1.2.0

$ ruby -v
ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]


Note (26 September 2008): I just updated to gems 1.3.0 and this problem persists.

Note (18 November 2008): Just updated to gems 1.3.1 and the problem persists.

Note (28 April 2009): The latest version of Gems (1.3.2) now skips any gems where building of native extensions fails during update; in other words, the problem is fixed. Hooray!

解决方案

Gems, as of version 1.3.2, will now skip gems that fail to build, so update Rubygems to the latest version and the problem discussed here should be solved.

gem update --system

The following solution is now deprecated, but I leave it here for the record.

I started a thread on this issue on the Ruby Forum (it's a front end to the mailing list). There's some interesting discussion; it's worth a read. There's even a very hacky solution to this problem on there:

`gem.bat outdated`.split(/\n/).map{|z|z.scan(/^[^[:space:]]+/)}.flatten.each{|z| `gem.bat update #{z}`}

It calls the gem outdated command and builds a list of all of the outdated gems. It then iterates over the list and calls gem update for each individual outdated gem. If one fails, it just moves onto the next.

这篇关于Windows上的Gem更新 - 是否被破坏?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆