2011-11-24 72 views
13

当我试图将我的项目推送到Heroku时,我收到了错误(下面)。谷歌搜索发现有几个人出现了类似的问题,但在错误发生之前与最后一颗宝石有着不同的宝石,所以我认为这不适用于监狱长。我发现的几个类似的错误/ github问题有解决方案指向一个rubygems错误,这显然是to be fixed in 1.8.10(我已经得到了,所以我怀疑它是这个问题要么正在抛出normalize_yaml_input中的无效字节序列错误?

任何建议会可以理解的,我敢肯定这件事情简单的我已经错过了

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 

回答

39

我有同样的问题,通过把这个对我Gemfile顶部解决它:

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

在本post建议。

+0

也适用于capistrano部署情况(不只是heroku) –

-2

我遇到一个问题,当我使用哲基尔写在GitHub(Ruby193)静态博客网页:

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

我解决了这个问题通过改变从红宝石红宝石193 Ruby187。

相关问题