0

我不是 ruby​​ 专家,但我设法收集了足够的信息来设置Gemfile和安装所需的 Gemfile。

然而,最近,我遇到了一些问题。无论出于何种原因,我现在收到此错误:

> 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

我已经查看了推荐的链接,但问题仍然存在。我Gemfile的很简单:

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

以及随附的Gemfile.lock

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

PLATFORMS
  ruby

DEPENDENCIES
  sass

为什么捆绑器无法安装?

更多细节
使用旧版本的捆绑器(比如 1.2),工作得很好。只是不是1.3.1

我正在使用 ruby​​ 1.8.7 和 ruby​​gems 1.8.11。

4

2 回答 2

0

当您安装 ruby​​ 时,您可能没有在系统上安装 libyaml。Ruby 需要 libyaml 才能运行它的标准库 yaml 库。

尝试安装 libyaml(查看如何为您的特定操作系统),然后重新安装 ruby​​。

于 2013-03-04T20:07:49.370 回答
0

刚刚遇到同样的问题并通过卸载最新的捆绑器版本 1.3.1 解决了它

gem uninstall bundler -v 1.3.1

bundler 1.3.0应该让它通过 ;)

编辑:不知道为什么:|

于 2013-03-05T07:30:27.560 回答