简体   繁体   中英

`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.

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:

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

And the accompanying 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. Just not 1.3.1

I am using ruby 1.8.7, and rubygems 1.8.11.

Any chance the when you installed ruby you didn't have libyaml installed on the system. Ruby requires libyaml for it's standardlib yaml library to function.

Try installing libyaml (look up how to for your particular OS) and then re-installing ruby.

Just had the same issue and solved it by uninstalling the latest bundler version 1.3.1

gem uninstall bundler -v 1.3.1

bundler 1.3.0 should make it pass ;)

edit: no idea why though :|

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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