【问题标题】:Error in the push Heroku, json and ruby ​​1.9.2Heroku、json和ruby 1.9.2推送错误
【发布时间】:2011-11-01 01:44:24
【问题描述】:

我在推送Heroku的时候有问题,按照下面的错误提示

-----> Gemfile detected, running Bundler version 1.0.7
   Unresolved dependencies detected; Installing...
   Using --without development:test
   Fetching source index for http://rubygems.org/
   Installing rake (0.9.2) 
   Installing abstract (1.0.0) 
   Installing activesupport (3.0.9) 
   Installing builder (2.1.2) 
   Installing i18n (0.5.0) 
   Installing activemodel (3.0.9) 
   Installing erubis (2.6.6) 
   Installing rack (1.2.3) 
   Installing rack-mount (0.6.14) 
   Installing rack-test (0.5.7) 
   Installing tzinfo (0.3.29) 
   Installing actionpack (3.0.9) 
   Installing mime-types (1.16) 
   Installing polyglot (0.3.2) 
   Installing treetop (1.4.10) 
   Installing mail (2.2.19) 
   Installing actionmailer (3.0.9) 
   Installing arel (2.0.10) 
   Installing activerecord (3.0.9) 
   Installing activeresource (3.0.9) 
   Installing diff-lcs (1.1.2) 
   Installing json (1.5.3) with native extensions 
   /usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/specification.rb:519:in `normalize_yaml_input': invalid byte sequence in US-ASCII (ArgumentError)
    from /usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/specification.rb:479:in `from_yaml'
    from /usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/package/tar_input.rb:183:in `load_gemspec'
    from /usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/package/tar_input.rb:51:in `block in initialize'
    from /usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/package/tar_reader.rb:64:in `block in each'
    from /usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/package/tar_reader.rb:55:in `loop'
    from /usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/package/tar_reader.rb:55:in `each'
    from /usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/package/tar_input.rb:32:in `initialize'
    from /usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/package/tar_input.rb:17:in `new'
    from /usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/package/tar_input.rb:17:in `open'
    from /usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/package.rb:58:in `open'
    from /usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/format.rb:63:in `from_io'
    from /usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/format.rb:51:in `block in from_file_by_path'
    from /usr/ruby1.9.2/lib/ruby/1.9.1/open-uri.rb:35:in `open'
    from /usr/ruby1.9.2/lib/ruby/1.9.1/open-uri.rb:35:in `open'
    from /usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/format.rb:50:in `from_file_by_path'
    from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/source.rb:72:in `fetch'
    from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/installer.rb:45:in `block in run'
    from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/spec_set.rb:12:in `block in each'
    from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/spec_set.rb:12:in `each'
    from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/spec_set.rb:12:in `each'
    from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/installer.rb:44:in `run'
    from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/installer.rb:8:in `install'
    from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/cli.rb:225:in `install'
    from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/vendor/thor/task.rb:22:in `run'
    from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
    from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/vendor/thor.rb:246:in `dispatch'
    from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/vendor/thor/base.rb:389:in `start'
    from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/bin/bundle:13:in `<top (required)>'
    from /usr/ruby1.9.2/bin/bundle:19:in `load'
    from /usr/ruby1.9.2/bin/bundle:19:in `<main>'
   FAILED: http://devcenter.heroku.com/articles/bundler

! Heroku 推送被拒绝,无法通过 Bundler 安装 gems

我正在使用 ruby​​ 1.9.2。

【问题讨论】:

  • 你能发布“捆绑安装”命令的输出吗?

标签: ruby-on-rails json heroku git-push


【解决方案1】:

我的解决方法是将其添加到 Gemfile 的顶部

if RUBY_VERSION =~ /1.9/
    Encoding.default_external = Encoding::UTF_8
    Encoding.default_internal = Encoding::UTF_8
end

参考:http://www.ruby-forum.com/topic/178706

【讨论】:

    【解决方案2】:

    根据另一个gem上github上的类似问题,看起来是因为gemspec文件上缺少编码声明

    https://github.com/RubyMoney/money/pull/87

    我检查了 json 1.5.3 和 1.5.4 的源代码,它们都有。

    所以,可能是 json 旁边的另一个 gem,可能没有那一行。

    您可能想在项目根文件夹中使用命令bundle install 找出这些宝石。

    【讨论】:

      猜你喜欢
      • 2015-06-18
      • 1970-01-01
      • 2019-06-01
      • 1970-01-01
      • 1970-01-01
      • 2011-07-04
      • 2018-07-09
      • 1970-01-01
      • 2011-08-30
      相关资源
      最近更新 更多