Skip to content

Updated Gem cannot be installed via bundler on 1.9.2p-290 #667

Closed
ghost opened this Issue Aug 18, 2011 · 26 comments

8 participants

@ghost
ghost commented Aug 18, 2011

Using rails_admin (0.0.1) from git://github.com/sferik/rails_admin.git (at rails-3.0) /usr/local/rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1915:in gsub': invalid byte sequence in US-ASCII (ArgumentError)
from /usr/local/rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1915:in
to_yaml'
from /usr/local/rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/builder.rb:79:in block (2 levels) in write_package'
from /usr/local/rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/package/tar_output.rb:73:in
block (3 levels) in add_gem_contents'
from /usr/local/rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/package/tar_writer.rb:83:in new'
from /usr/local/rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/package/tar_output.rb:67:in
block (2 levels) in add_gem_contents'
from /usr/local/rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/package/tar_output.rb:65:in wrap'
from /usr/local/rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/package/tar_output.rb:65:in
block in add_gem_contents'
from /usr/local/rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/package/tar_writer.rb:113:in add_file'
from /usr/local/rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/package/tar_output.rb:63:in
add_gem_contents'
from /usr/local/rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/package/tar_output.rb:31:in open'
from /usr/local/rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/package.rb:44:in
open'
from /usr/local/rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/builder.rb:78:in block in write_package'
from /usr/local/rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/open-uri.rb:35:in
open'
from /usr/local/rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/open-uri.rb:35:in open'
from /usr/local/rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/builder.rb:77:in
write_package'
from /usr/local/rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/builder.rb:39:in build'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.18/lib/bundler/source.rb:456:in
block in generate_bin'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.18/lib/bundler/source.rb:456:in chdir'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.18/lib/bundler/source.rb:456:in
generate_bin'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.18/lib/bundler/source.rb:565:in install'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.18/lib/bundler/installer.rb:58:in
block (2 levels) in run'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.18/lib/bundler/rubygems_integration.rb:93:in with_build_args'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.18/lib/bundler/installer.rb:57:in
block in run'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.18/lib/bundler/installer.rb:49:in run'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.18/lib/bundler/installer.rb:8:in
install'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.18/lib/bundler/cli.rb:220:in install'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.18/lib/bundler/vendor/thor/task.rb:22:in
run'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.18/lib/bundler/vendor/thor/invocation.rb:118:in invoke_task'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.18/lib/bundler/vendor/thor.rb:263:in
dispatch'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.18/lib/bundler/vendor/thor/base.rb:386:in start'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.18/bin/bundle:13:in
'
from /usr/local/rvm/gems/ruby-1.9.2-p290/bin/bundle:19:in load'
from /usr/local/rvm/gems/ruby-1.9.2-p290/bin/bundle:19:in

'

@hooopo
hooopo commented Aug 18, 2011

yeah,i met the same issue last night.But ruby1.9.2-p180 is ok.

@JeroenKnoops

I've got this problem on ruby.1.9.2-p180

@JeroenKnoops

'unset LC_ALL' fixed it on my machine.

@ghost
ghost commented Aug 19, 2011
@sferik sferik was assigned Aug 20, 2011
@sferik
Owner
sferik commented Aug 20, 2011

I suspect this is a bug in syck. Can you try adding a psych dependency to your Gemfile?

What's the output when you type the following line in the console before/after making this change?

YAML::ENGINE.yamler
@ghost
ghost commented Aug 23, 2011

Before adding gem 'psych' to Gemfile:

ruby-1.9.2-p290 :001 > YAML::ENGINE.yamler
 => "syck"

After adding gem 'psych' to Gemfile and bundle updating:

ruby-1.9.2-p290 :001 > YAML::ENGINE.yamler
 => "syck"
@sferik
Owner
sferik commented Aug 23, 2011

Are you, by any chance, using delayed_job in your project?

@ghost
ghost commented Aug 23, 2011

Nope - I tried this too..
http://bookmarks.honewatson.com/2009/05/30/perl-warning-please-check-that-your-locale-settings-ubuntu/

It works fine under OS X, but when i cap deploy to my ubuntu box is doesnt like it one bit.

@sferik
Owner
sferik commented Aug 23, 2011

So, basically, this is a load order issue. You could try moving gem 'psych' to the top of your Gemfile (just below the source statement) or writing an initializer that ensures psych is loaded before Rails but I can't guarantee either of these things will work.

@ghost
ghost commented Aug 23, 2011

I've actually tried both of those things. It happens during my bundle install, not when i run the rails app:

* executing "cd /home/din/www/staging/rails/releases/20110823024314 && bundle install --gemfile /home/din/www/staging/rails/releases/20110823024314/Gemfile --path /home/din/www/staging/rails/shared/bundle --deployment --quiet --without development test"
   servers: ["din.com"]
   [din.com] executing command
** [out :: din.com] /usr/local/rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1915:in `gsub': invalid byte sequence in US-ASCII (
** [out :: din.com] ArgumentError)
** [out :: din.com] from /usr/local/rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1915:in `to_yaml'
** [out :: din.com] from /usr/local/rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/builder.rb:79:in `block (2 levels) in write_package'
** [out :: din.com] from /usr/local/rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/package/tar_output.rb:73:in `block (3 levels) in add_gem_contents'```
@sferik
Owner
sferik commented Aug 23, 2011

Hailing @tenderlove!

@tenderlove

This looks like a bug in rubygems. Possibly related to this bug.

What version of rubygems are you running, and can you try upgrading to the latest (1.8.8) and see if it still breaks?

@tenderlove

In fact, I would say it's quite likely related to this rubygems bug. I see that there are non us-ascii characters in your gemspec. My bug was during reading gems from Rubygems, but it's possible that a similar bug exists when creating gems from a gemspec.

Also syck vs psych is probably not a factor in this issue.

@sferik
Owner
sferik commented Aug 23, 2011

@tenderlove thanks for clearing things up!

@ghost
ghost commented Aug 23, 2011

@sferik - are you going to resolve in your gemspec or should i fork? Thanks @tenderlove!

@tenderlove

@emp29 if you upgrade rubygems, does everything work? If not, we need to report a bug to the rubygems team.

@ghost
ghost commented Aug 23, 2011

Updated to rubygems 1.8.8 and it still seems to have the problem.

Is there any way to check to make sure bundler is using the latest?

I am running a system-wide rvm on my vps, not sure if that could impact anything.

```david@linode:~/din$ gem -v
1.8.8

@tenderlove

Oh boy, now I think this is a psych issue! :(

It looks like the YAML is coming back out of psych as an ASCII-8BIT string. Upgrading to the gem version will help, but we also need to patch rubygems before it can use the gem version. (we need to do this work to get rubygems.org upgraded too).

Give me a couple minutes and I'll send a pull request to the rubygems team.

@akzhan
akzhan commented Aug 24, 2011

Looks like simular problem exists in another gem - rest-client. But related to timestamps.

Take a look at rubygems/rubygems#57 .

As I see, author of rest-client workarounds it by rebuilding gem using ruby 1.8.7 (archiloque/rest-client@6a4ac72).

@tenderlove

Hi folks,

I think this is a duplicate of this rubygems ticket. It should be fixed with the combination of:

  • psych version 1.2.1
  • Rubygems 1.8.10
@bbenezech
Collaborator

Cool! Closing.

@bbenezech bbenezech closed this Sep 5, 2011
@maia
maia commented Sep 17, 2011

Running OSX 10.7.2 and ruby-1.9.2-p290 I'm seeing the same error after upgrading to Rails 3.1 and running bundle update:

Using rails_admin (0.0.1) from git://github.com/sferik/rails_admin.git (at master) /Users/lex/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1915:in gsub': invalid byte sequence in US-ASCII (ArgumentError)
from /Users/lex/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1915:in
to_yaml'

In my Gemfile I'm using gem 'rails_admin', :git => 'git://github.com/sferik/rails_admin.git', and I have no reference to psych in my Gemfile. And if I add gem 'psych' to the top of my Gemfile, I end up with the same error:

Installing psych (1.2.1) with native extensions
Using rails (3.1.0)
Using rails_admin (0.0.1) from git://github.com/sferik/rails_admin.git (at master) /Users/lex/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1915:in gsub': invalid byte sequence in US-ASCII (ArgumentError)
from /Users/lex/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1915:in
to_yaml'

gem -v returns 1.8.10 and the output of locale is:

LANG="C"
LC_COLLATE="C"
LC_CTYPE="C"
LC_MESSAGES="C"
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_ALL="C"

Any hints on how I could solve the problem?

@sferik sferik reopened this Sep 17, 2011
@sferik
Owner
sferik commented Sep 17, 2011

@tenderlove any idea why someone would still be having this issue, despite using rubygems 1.8.10 and psych?

@bbenezech
Collaborator

Is this a dup of #721?

@maia
maia commented Sep 18, 2011

The fix mentioned in #721 solves the problem:

gem 'rails_admin', :git => 'git://github.com/gunn/rails_admin.git', :ref => "bundler_fix"

@gunn
Collaborator
gunn commented Sep 18, 2011

Okay, I've removed the non-ascii characters in the gemspec to work around the problem for now. When enough time's passed that no one's likely to be using a flawed combination of rubygems / psych / bundler / whatever we should re-add them.

@gunn gunn closed this Sep 18, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.