2013-05-03 217 views
0

我试图安装foreman hooks但运行bundle install做捆绑安装

工头版本1.1

[[email protected] foreman]# bundle update 
/usr/share/foreman/config/settings.rb:2: undefined method `load_file' for YAML:Module (NoMethodError) 
    /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require' 
    /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require' 
    /usr/share/foreman/Gemfile:1:in `eval_gemfile' 
    /usr/lib/ruby/gems/1.8/gems/bundler-1.3.5/lib/bundler/dsl.rb:9:in `evaluate' 
    /usr/lib/ruby/gems/1.8/gems/bundler-1.3.5/lib/bundler/definition.rb:19:in `build' 
    /usr/lib/ruby/gems/1.8/gems/bundler-1.3.5/lib/bundler.rb:148:in `definition' 
    /usr/lib/ruby/gems/1.8/gems/bundler-1.3.5/lib/bundler/cli.rb:301:in `update' 
    /usr/lib/ruby/gems/1.8/gems/bundler-1.3.5/lib/bundler/vendor/thor/task.rb:27:in `__send__' 
    /usr/lib/ruby/gems/1.8/gems/bundler-1.3.5/lib/bundler/vendor/thor/task.rb:27:in `run' 
    /usr/lib/ruby/gems/1.8/gems/bundler-1.3.5/lib/bundler/vendor/thor/invocation.rb:120:in `invoke_task' 
    /usr/lib/ruby/gems/1.8/gems/bundler-1.3.5/lib/bundler/vendor/thor.rb:344:in `dispatch' 
    /usr/lib/ruby/gems/1.8/gems/bundler-1.3.5/lib/bundler/vendor/thor/base.rb:434:in `start' 
    /usr/lib/ruby/gems/1.8/gems/bundler-1.3.5/bin/bundle:20 
    /usr/lib/ruby/gems/1.8/gems/bundler-1.3.5/lib/bundler/friendly_errors.rb:3:in `with_friendly_errors' 
    /usr/lib/ruby/gems/1.8/gems/bundler-1.3.5/bin/bundle:20 
    /usr/bin/bundle:19:in `load' 
    /usr/bin/bundle:19 
There was an error in your Gemfile, and Bundler cannot continue. 

的Gemfile当我得到There was an error in your Gemfile, and Bundler cannot continue.时的Gemfile和捆扎机错误工头和Gemlock.file

[[email protected] foreman]# cat Gemfile.lock 
GEM 
    remote: http://rubygems.org/ 
    specs: 
    abstract (1.0.0) 
    actionmailer (3.0.20) 
     actionpack (= 3.0.20) 
     mail (~> 2.3.0) 
    actionpack (3.0.20) 
     activemodel (= 3.0.20) 
     activesupport (= 3.0.20) 
     builder (~> 2.1.2) 
     erubis (~> 2.6.6) 
     i18n (~> 0.5.0) 
     rack (~> 1.2.5) 
     rack-mount (~> 0.6.14) 
     rack-test (~> 0.5.7) 
     tzinfo (~> 0.3.23) 
    activemodel (3.0.20) 
     activesupport (= 3.0.20) 
     builder (~> 2.1.2) 
     i18n (~> 0.5.0) 
    activerecord (3.0.20) 
     activemodel (= 3.0.20) 
     activesupport (= 3.0.20) 
     arel (~> 2.0.10) 
     tzinfo (~> 0.3.23) 
    activeresource (3.0.20) 
     activemodel (= 3.0.20) 
     activesupport (= 3.0.20) 
    activesupport (3.0.20) 
    ancestry (1.3.0) 
     activerecord (>= 2.3.14) 
    apipie-rails (0.0.13) 
    arel (2.0.10) 
    audited (3.0.0.rc1) 
    audited-activerecord (3.0.0.rc1) 
     activerecord (~> 3.0) 
     audited (= 3.0.0.rc1) 
    builder (2.1.2) 
    erubis (2.6.6) 
     abstract (>= 1.0.0) 
    excon (0.14.0) 
    fog (1.9.0) 
     builder 
     excon (~> 0.14) 
     formatador (~> 0.2.0) 
     mime-types 
     multi_json (~> 1.0) 
     net-scp (~> 1.0.4) 
     net-ssh (>= 2.1.3) 
     nokogiri (~> 1.5.0) 
     ruby-hmac 
    foreman_hooks (0.3.1) 
    formatador (0.2.1) 
    i18n (0.5.0) 
    jquery-rails (1.0.19) 
     railties (~> 3.0) 
     thor (~> 0.14) 
    json (1.6.8) 
    mail (2.3.3) 
     i18n (>= 0.4.0) 
     mime-types (~> 1.16) 
     treetop (~> 1.4.8) 
    mime-types (1.18) 
    multi_json (1.2.0) 
    net-ldap (0.3.1) 
    net-scp (1.0.4) 
     net-ssh (>= 1.99.1) 
    net-ssh (2.3.0) 
    nokogiri (1.5.2) 
    oauth (0.4.7) 
    polyglot (0.3.3) 
    rabl (0.7.5) 
     activesupport (>= 2.3.14) 
     multi_json (~> 1.0) 
    rack (1.2.5) 
    rack-mount (0.6.14) 
     rack (>= 1.0.0) 
    rack-test (0.5.7) 
     rack (>= 1.0) 
    rails (3.0.20) 
     actionmailer (= 3.0.20) 
     actionpack (= 3.0.20) 
     activerecord (= 3.0.20) 
     activeresource (= 3.0.20) 
     activesupport (= 3.0.20) 
     bundler (~> 1.0) 
     railties (= 3.0.20) 
    railties (3.0.20) 
     actionpack (= 3.0.20) 
     activesupport (= 3.0.20) 
     rake (>= 0.8.7) 
     rdoc (~> 3.4) 
     thor (~> 0.14.4) 
    rake (0.9.2.2) 
    rbvmomi (1.5.1) 
     builder 
     nokogiri (>= 1.4.1) 
     trollop 
    rdoc (3.12) 
     json (~> 1.4) 
    rest-client (1.6.7) 
     mime-types (>= 1.16) 
    ruby-hmac (0.4.0) 
    ruby-libvirt (0.4.0) 
    ruby2ruby (2.0.1) 
     ruby_parser (~> 3.0.0) 
     sexp_processor (~> 4.0) 
    ruby_parser (3.0.1) 
     sexp_processor (~> 4.1) 
    safemode (1.2.0) 
     ruby2ruby (>= 2.0.1) 
     ruby_parser (>= 3.0.1) 
     sexp_processor (>= 4.1.2) 
    scoped_search (2.4.0) 
     activerecord (>= 2.1.0) 
    sexp_processor (4.1.2) 
    sqlite3 (1.3.5) 
    thor (0.14.6) 
    treetop (1.4.10) 
     polyglot 
     polyglot (>= 0.3.1) 
    trollop (1.16.2) 
    tzinfo (0.3.32) 
    uuidtools (2.1.1) 
    will_paginate (3.0.3) 

PLATFORMS 
    ruby 

DEPENDENCIES 
    ancestry 
    apipie-rails 
    audited-activerecord 
    fog (>= 1.9) 
    foreman_hooks 
    jquery-rails 
    json 
    net-ldap 
    oauth 
    rabl 
    rails 
    rbvmomi 
    rest-client 
    ruby-libvirt 
    ruby_parser 
    safemode 
    scoped_search 
    sqlite3 
    uuidtools 
    will_paginate 

回答

1

最近开始发生这种情况,我想由于bundler或可能的rvm的改变,这意味着YAML在Gemfile解析之前不会被加载。因此,它突出显示了Foreman中的一个bug,该bug在开发(1.2版)中得到了修复,但尚未回溯到1.1稳定分支。

要修复它,下面一行在工头安装添加到的config/settings.rb顶部:

require 'yaml' 
+0

谢谢,工作就像一个魅力! – jacksoncage 2013-05-03 08:58:02