简体   繁体   English

`bundler install --deployment`缺少`to_yaml`吗?

[英]`bundler install --deployment` missing `to_yaml`?

I am not a ruby expert, but I have managed to gather enough information to setup a Gemfile and install required Gemfiles. 我不是红宝石专家,但是我设法收集了足够的信息来设置Gemfile和安装所需的Gemfile。

Lately, however, I've had some problems. 但是最近,我遇到了一些问题。 For whatever reason, I am now getting this error: 无论出于何种原因,我现在都会收到此错误:

> bundle install --deployment
      Unfortunately, a fatal error has occurred. Please see the Bundler
      troubleshooting documentation at http://bit.ly/bundler-issues. Thanks!
/usr/lib/ruby/gems/1.8/gems/bundler-1.3.1/lib/bundler/settings.rb:129:in `set_key': undefined method `to_yaml' for {"BUNDLE_FROZEN"=>"1"}:Hash (NoMethodError)
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.3.1/lib/bundler/settings.rb:129:in `open'
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.3.1/lib/bundler/settings.rb:129:in `set_key'
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.3.1/lib/bundler/settings.rb:17:in `[]='
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.3.1/lib/bundler/cli.rb:219:in `install'
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.3.1/lib/bundler/vendor/thor/task.rb:27:in `__send__'
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.3.1/lib/bundler/vendor/thor/task.rb:27:in `run'
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.3.1/lib/bundler/vendor/thor/invocation.rb:120:in `invoke_task'
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.3.1/lib/bundler/vendor/thor.rb:344:in `dispatch'
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.3.1/lib/bundler/vendor/thor/base.rb:434:in `start'
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.3.1/bin/bundle:20
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.3.1/lib/bundler/friendly_errors.rb:3:in `with_friendly_errors'
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.3.1/bin/bundle:20
    from /usr/bin/bundle:19:in `load'
    from /usr/bin/bundle:19

I have taken a look at the recommended link , but the problem remains. 我看了推荐的链接 ,但是问题仍然存在。 My Gemfile is quite simple: 我的Gemfile很简单:

source "https://rubygems.org"
gem 'sass'

And the accompanying Gemfile.lock : 以及随附的Gemfile.lock

GEM
  remote: https://rubygems.org/
  specs:
    sass (3.2.6)

PLATFORMS
  ruby

DEPENDENCIES
  sass

Why is bundler failing to install? 捆绑器为何无法安装?

Further details : 进一步的细节
Using an older version of bundler (say, 1.2), works just fine. 使用较旧版本的捆绑程序(例如1.2)可以正常工作。 Just not 1.3.1 只是不是1.3.1

I am using ruby 1.8.7, and rubygems 1.8.11. 我正在使用ruby 1.8.7和rubygems 1.8.11。

Any chance the when you installed ruby you didn't have libyaml installed on the system. 在您安装ruby时,您没有在系统上安装libyaml的任何可能。 Ruby requires libyaml for it's standardlib yaml library to function. Ruby需要libyaml才能正常运行它的standardlib yaml库。

Try installing libyaml (look up how to for your particular OS) and then re-installing ruby. 尝试安装libyaml(查找特定操作系统的操作方法),然后重新安装ruby。

Just had the same issue and solved it by uninstalling the latest bundler version 1.3.1 刚刚遇到了同样的问题,并通过卸载最新的捆绑程序版本1.3.1解决了该问题

gem uninstall bundler -v 1.3.1

bundler 1.3.0 should make it pass ;) 捆绑器1.3.0应该通过它;)

edit: no idea why though :| 编辑:不知道为什么,

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

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