gpt4 book ai didi

ruby - 安装 gem 时未初始化的常量 Psych::Syck

转载 作者:数据小太阳 更新时间:2023-10-29 07:11:19 25 4
gpt4 key购买 nike

我将 gem 推送到 ruby​​gems.org,当我执行“gem install (gem)”时出现此错误:

ERROR:  While executing gem ... (NameError)
uninitialized constant Psych::Syck

我可以执行“gem build (gem).gemspec”来生成本地 gem,然后 gem install (gem).gem 并且安装正常。我还可以将 gem 放入我的 Rails 应用程序的 Gemfile 中,并带有指向 Github 存储库的指针,这也可以。我试过在多台计算机上安装 gem(来自 ruby​​gems.org,它们都遇到相同的错误。

我不知道是什么原因导致从 ruby​​gems.org 完成安装失败,但在本地生成时却没有。我正在使用 Jeweler 将 gem 推送到 ruby​​gems.org。

最佳答案

我得到的具体错误是:uninitialized constant Psych::Syck (NameError) when doing bundle install.

这发生在安装 simplecov(很棒的代码覆盖工具)版本 0.5.0 时。在 Ubuntu 11.04 中工作并使用 RVM。

修复了 gem update --system 的问题

这会更新 ruby​​gems 并产生以下输出:

Updating rubygems-update
Fetching: rubygems-update-1.8.10.gem (100%)
Successfully installed rubygems-update-1.8.10
Installing RubyGems 1.8.10
RubyGems 1.8.10 installed

== 1.8.10 / 2011-08-25

RubyGems 1.8.10 contains a security fix that prevents malicious gems from
executing code when their specification is loaded. See
https://github.com/rubygems/rubygems/pull/165 for details.

* 5 bug fixes:

* RubyGems escapes strings in ruby-format specs using #dump instead of #to_s
and %q to prevent code injection. Issue #165 by Postmodern
* RubyGems attempt to activate the psych gem now to obtain bugfixes from
psych.
* Gem.dir has been restored to the front of Gem.path. Fixes remaining
problem with Issue #115
* Fixed Syck DefaultKey infecting ruby-format specifications.
* `gem uninstall a b` no longer stops if gem "a" is not installed.


------------------------------------------------------------------------------

RubyGems installed the following executables:
/home/baller/.rvm/rubies/ruby-1.9.2-p180/bin/gem

RubyGems system software updated

关于ruby - 安装 gem 时未初始化的常量 Psych::Syck,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6591594/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com