Normalize_yaml_input 中抛出无效字节序列错误?

发布于 2024-12-17 21:28:59 字数 7889 浏览 0 评论 0原文

当尝试将我的项目推送到 Heroku 时,我收到错误(如下)。谷歌搜索发现一些人出现了类似的问题,但错误之前的最后一个宝石是不同的宝石,所以我认为这与典狱长无关。我发现的一些类似的错误/github问题有指向 ruby​​gems 错误的解决方案,这显然是 在 1.8.10 中修复(我已经得到了,所以我怀疑这也是这个问题。

任何建议将不胜感激 - 我确信这很简单我也错过了。

cobychapple at shiva in ~/code/zzz on master!
± git push heroku master
Counting objects: 201, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (181/181), done.
Writing objects: 100% (201/201), 92.14 KiB, done.
Total 201 (delta 38), reused 0 (delta 0)

-----> Heroku receiving push
-----> Ruby/Rails app detected
-----> Detected Rails is not set to serve static_assets
       Installing rails3_serve_static_assets... done
-----> Configure Rails 3 to disable x-sendfile
       Installing rails3_disable_x_sendfile... done
-----> Configure Rails to log to stdout
       Installing rails_log_stdout... done
-----> 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.2) 
       Installing multi_json (1.0.3) 
       Installing activesupport (3.1.2) 
       Installing builder (3.0.0) 
       Installing i18n (0.6.0) 
       Installing activemodel (3.1.2) 
       Installing erubis (2.7.0) 
       Installing rack (1.3.5) 
       Installing rack-cache (1.1) 
       Installing rack-mount (0.8.3) 
       Installing rack-test (0.6.1) 
       Installing hike (1.2.1) 
       Installing tilt (1.3.3) 
       Installing sprockets (2.1.2) 
       Installing actionpack (3.1.2) 
       Installing mime-types (1.17.2) 
       Installing polyglot (0.3.3) 
       Installing treetop (1.4.10) 
       Installing mail (2.3.0) 
       Installing actionmailer (3.1.2) 
       Installing arel (2.2.1) 
       Installing tzinfo (0.3.31) 
       Installing activerecord (3.1.2) 
       Installing activeresource (3.1.2) 
       Installing addressable (2.2.6) 
       Installing bcrypt-ruby (3.0.1) with native extensions 
       Installing coffee-script-source (1.1.3) 
       Installing execjs (1.2.9) 
       Installing coffee-script (2.2.0) 
       Installing rack-ssl (1.3.2) 
       Installing json (1.6.1) with native extensions 
       Installing rdoc (3.11) 
       Installing thor (0.14.6) 
       Installing railties (3.1.2) 
       Installing coffee-rails (3.1.1) 
       Installing orm_adapter (0.0.5) 
       Installing warden (1.1.0) 
       /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 push rejected, failed to install gems via Bundler

To [email protected]:zzz.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to '[email protected]:zzz.git'

这是 bundle install 的输出,以防有帮助:

cobychapple at shiva in ~/code/zzz on master
± bundle install
Using rake (0.9.2.2) 
Using multi_json (1.0.3) 
Using activesupport (3.1.2) 
Using builder (3.0.0) 
Using i18n (0.6.0) 
Using activemodel (3.1.2) 
Using erubis (2.7.0) 
Using rack (1.3.5) 
Using rack-cache (1.1) 
Using rack-mount (0.8.3) 
Using rack-test (0.6.1) 
Using hike (1.2.1) 
Using tilt (1.3.3) 
Using sprockets (2.1.2) 
Using actionpack (3.1.2) 
Using mime-types (1.17.2) 
Using polyglot (0.3.3) 
Using treetop (1.4.10) 
Using mail (2.3.0) 
Using actionmailer (3.1.2) 
Using arel (2.2.1) 
Using tzinfo (0.3.31) 
Using activerecord (3.1.2) 
Using activeresource (3.1.2) 
Using addressable (2.2.6) 
Using ansi (1.4.1) 
Using bcrypt-ruby (3.0.1) 
Using bundler (1.0.18) 
Using coffee-script-source (1.1.3) 
Using execjs (1.2.9) 
Using coffee-script (2.2.0) 
Using rack-ssl (1.3.2) 
Using json (1.6.1) 
Using rdoc (3.11) 
Using thor (0.14.6) 
Using railties (3.1.2) 
Using coffee-rails (3.1.1) 
Using orm_adapter (0.0.5) 
Using warden (1.1.0) 
Using devise (1.5.1) 
Using faker (1.0.1) 
Using rails (3.1.2) 
Using formtastic (2.0.2) 
Using formtastic-bootstrap (1.0.1) 
Using haml (3.1.3) 
Using launchy (2.0.5) 
Using rest-client (1.6.7) 
Using rubyzip (0.9.4) 
Using term-ansicolor (1.0.7) 
Using heroku (2.14.0) 
Using jquery-rails (1.0.18) 
Using kaminari (0.12.4) 
Using populator (1.0.0) 
Using sass (3.1.10) 
Using sass-rails (3.1.5) 
Using sequel (3.20.0) 
Using sinatra (1.0) 
Using sqlite3 (1.3.4) 
Using sqlite3-ruby (1.3.3) 
Using taps (0.3.23) 
Using turn (0.8.2) 
Using uglifier (1.1.0) 
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.

Rubygems 版本:

cobychapple at shiva in ~/code/zzz on master
± gem -v
1.8.10

I'm getting the error (below) when trying to push my project to Heroku. Googling found a few people with similar issues turning up, but with a different gem as the last gem before the error, so I don't think it's got to do with warden. A few of the similar errors/github issues I found had solutions pointing back to a rubygems error, which was apparently to be fixed in 1.8.10 (which I've got already, so I'm doubtful that it's that issue either.

Any suggestions would be appreciated—I'm sure it's something simple I've missed.

cobychapple at shiva in ~/code/zzz on master!
± git push heroku master
Counting objects: 201, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (181/181), done.
Writing objects: 100% (201/201), 92.14 KiB, done.
Total 201 (delta 38), reused 0 (delta 0)

-----> Heroku receiving push
-----> Ruby/Rails app detected
-----> Detected Rails is not set to serve static_assets
       Installing rails3_serve_static_assets... done
-----> Configure Rails 3 to disable x-sendfile
       Installing rails3_disable_x_sendfile... done
-----> Configure Rails to log to stdout
       Installing rails_log_stdout... done
-----> 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.2) 
       Installing multi_json (1.0.3) 
       Installing activesupport (3.1.2) 
       Installing builder (3.0.0) 
       Installing i18n (0.6.0) 
       Installing activemodel (3.1.2) 
       Installing erubis (2.7.0) 
       Installing rack (1.3.5) 
       Installing rack-cache (1.1) 
       Installing rack-mount (0.8.3) 
       Installing rack-test (0.6.1) 
       Installing hike (1.2.1) 
       Installing tilt (1.3.3) 
       Installing sprockets (2.1.2) 
       Installing actionpack (3.1.2) 
       Installing mime-types (1.17.2) 
       Installing polyglot (0.3.3) 
       Installing treetop (1.4.10) 
       Installing mail (2.3.0) 
       Installing actionmailer (3.1.2) 
       Installing arel (2.2.1) 
       Installing tzinfo (0.3.31) 
       Installing activerecord (3.1.2) 
       Installing activeresource (3.1.2) 
       Installing addressable (2.2.6) 
       Installing bcrypt-ruby (3.0.1) with native extensions 
       Installing coffee-script-source (1.1.3) 
       Installing execjs (1.2.9) 
       Installing coffee-script (2.2.0) 
       Installing rack-ssl (1.3.2) 
       Installing json (1.6.1) with native extensions 
       Installing rdoc (3.11) 
       Installing thor (0.14.6) 
       Installing railties (3.1.2) 
       Installing coffee-rails (3.1.1) 
       Installing orm_adapter (0.0.5) 
       Installing warden (1.1.0) 
       /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 push rejected, failed to install gems via Bundler

To [email protected]:zzz.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to '[email protected]:zzz.git'

Here's the output of bundle install too, in case it helps:

cobychapple at shiva in ~/code/zzz on master
± bundle install
Using rake (0.9.2.2) 
Using multi_json (1.0.3) 
Using activesupport (3.1.2) 
Using builder (3.0.0) 
Using i18n (0.6.0) 
Using activemodel (3.1.2) 
Using erubis (2.7.0) 
Using rack (1.3.5) 
Using rack-cache (1.1) 
Using rack-mount (0.8.3) 
Using rack-test (0.6.1) 
Using hike (1.2.1) 
Using tilt (1.3.3) 
Using sprockets (2.1.2) 
Using actionpack (3.1.2) 
Using mime-types (1.17.2) 
Using polyglot (0.3.3) 
Using treetop (1.4.10) 
Using mail (2.3.0) 
Using actionmailer (3.1.2) 
Using arel (2.2.1) 
Using tzinfo (0.3.31) 
Using activerecord (3.1.2) 
Using activeresource (3.1.2) 
Using addressable (2.2.6) 
Using ansi (1.4.1) 
Using bcrypt-ruby (3.0.1) 
Using bundler (1.0.18) 
Using coffee-script-source (1.1.3) 
Using execjs (1.2.9) 
Using coffee-script (2.2.0) 
Using rack-ssl (1.3.2) 
Using json (1.6.1) 
Using rdoc (3.11) 
Using thor (0.14.6) 
Using railties (3.1.2) 
Using coffee-rails (3.1.1) 
Using orm_adapter (0.0.5) 
Using warden (1.1.0) 
Using devise (1.5.1) 
Using faker (1.0.1) 
Using rails (3.1.2) 
Using formtastic (2.0.2) 
Using formtastic-bootstrap (1.0.1) 
Using haml (3.1.3) 
Using launchy (2.0.5) 
Using rest-client (1.6.7) 
Using rubyzip (0.9.4) 
Using term-ansicolor (1.0.7) 
Using heroku (2.14.0) 
Using jquery-rails (1.0.18) 
Using kaminari (0.12.4) 
Using populator (1.0.0) 
Using sass (3.1.10) 
Using sass-rails (3.1.5) 
Using sequel (3.20.0) 
Using sinatra (1.0) 
Using sqlite3 (1.3.4) 
Using sqlite3-ruby (1.3.3) 
Using taps (0.3.23) 
Using turn (0.8.2) 
Using uglifier (1.1.0) 
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.

Rubygems version:

cobychapple at shiva in ~/code/zzz on master
± gem -v
1.8.10

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

勿忘初心 2024-12-24 21:29:00

我遇到了同样的问题,并通过将其放在我的 Gemfile 之上解决了它:

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

按照此 帖子

I had same issue and solved it by putting this on top of my Gemfile:

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

as suggested in this post.

○闲身 2024-12-24 21:29:00

我在GitHub上使用jekyll写静态博客页面时遇到一个问题(Ruby193):

液体错误:不兼容的字符编码:UTF-8 和 ASCII-8BIT

我通过将 Ruby 从 Ruby 193 更改为 Ruby187 修复了此问题。

I meet a problem when I use jekyll to write static blog pages on GitHub(Ruby193):

Liquid error: incompatible character encodings: UTF-8 and ASCII-8BIT

I fixed this by change Ruby from Ruby 193 to Ruby187.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文