Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Exception when Gemfile contains :git gems #1239

Closed
yob opened this Issue · 58 comments
@yob

If my Gemfile contains any :git gems, then I get a YAML related exception when running this command: "bundle update --local".

⚡ bundle --version
Bundler version 1.0.15

⚡ ruby -v
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-linux]

⚡ gem --version
1.3.7

⚡ bundle update --local      
Updating https://github.com/yob/delayed_job.git
Updating https://github.com/yob/active_merchant.git
Using rake (0.8.7) 
Using Ascii85 (1.0.1) 
Using aaronh-chronic (0.3.9) 
Using aasm (2.2.0) 
Using abstract (1.0.0) 
Using activesupport (3.0.7) 
Using builder (2.1.2) 
Using i18n (0.5.0) 
Using activemodel (3.0.7) 
Using erubis (2.6.6) 
Using rack (1.2.2) 
Using rack-mount (0.6.14) 
Using rack-test (0.5.7) 
Using tzinfo (0.3.28) 
Using actionpack (3.0.7) 
Using mime-types (1.16) 
Using polyglot (0.3.1) 
Using treetop (1.4.9) 
Using mail (2.2.17) 
Using actionmailer (3.0.7) 
Using braintree (2.10.1) 
Using activemerchant (1.15.0) from https://github.com/yob/active_merchant.git (at nab) /usr/lib/ruby/1.9.1/psych/visitors   /emitter.rb:17:in `end_document': undefined method `write' for #<Syck::Emitter:0x000000044f1b28> (NoMethodError)
from /usr/lib/ruby/1.9.1/psych/visitors/emitter.rb:17:in `visit_Psych_Nodes_Document'
from /usr/lib/ruby/1.9.1/psych/visitors/visitor.rb:10:in `accept'
from /usr/lib/ruby/1.9.1/psych/visitors/emitter.rb:10:in `block in visit_Psych_Nodes_Stream'
from /usr/lib/ruby/1.9.1/psych/visitors/emitter.rb:10:in `each'
from /usr/lib/ruby/1.9.1/psych/visitors/emitter.rb:10:in `visit_Psych_Nodes_Stream'
from /usr/lib/ruby/1.9.1/psych/visitors/visitor.rb:11:in `accept'
from /usr/lib/ruby/1.9.1/psych/nodes/node.rb:36:in `to_yaml'
from /usr/lib/ruby/1.9.1/psych.rb:166:in `dump'
from /usr/lib/ruby/1.9.1/psych/core_ext.rb:13:in `psych_to_yaml'

If I remove all the :git gems, then the update completes as expected.

@indirect
Owner

Is that the full backtrace? Please provide the other information in ISSUES.

@dcunited001

Ruby 1.9.2
Rails 3.0.7
Bundler 1.0.14

i'm on windows and just upgraded to Bundler 1.0.14 and i can't seem to install gems with :git either, although my symptoms are different. It's trying to run git clone 'git://blah.git' with single quotes.

downgraded to 1.0.13 and i'm good for now.

Output from Rubymine:
C:\Ruby192\bin\ruby.exe -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) C:\Ruby192\bin/bundle install

Fetching git://github.com/ugisozols/refinerycms-blog.git
fatal: I don't handle protocol ''git'
Git error: command git clone 'git://github.com/ugisozols/refinerycms-blog.git' "C:/Ruby192/lib/ruby/gems/1.9.1/cache/bundler/git/refinerycms-blog-9de4f3264f97a0a6652a29f8156aaef34075c3ab" --bare --no-hardlinks in directory C:/Users/DCONNER/RubymineProjects/StartNorfolk has failed.

Process finished with exit code 11

@indirect
Owner
@yob

Sorry, here's the extra info.

Full backtrace.

⚡ bundle update --local
Updating https://github.com/yob/delayed_job.git
Updating https://github.com/yob/active_merchant.git
Using rake (0.8.7) 
Using Ascii85 (1.0.1) 
Using aaronh-chronic (0.3.9) 
Using aasm (2.2.0) 
Using abstract (1.0.0) 
Using activesupport (3.0.7) 
Using builder (2.1.2) 
Using i18n (0.5.0) 
Using activemodel (3.0.7) 
Using erubis (2.6.6) 
Using rack (1.2.2) 
Using rack-mount (0.6.14) 
Using rack-test (0.5.7) 
Using tzinfo (0.3.28) 
Using actionpack (3.0.7) 
Using mime-types (1.16) 
Using polyglot (0.3.1) 
Using treetop (1.4.9) 
Using mail (2.2.19) 
Using actionmailer (3.0.7) 
Using braintree (2.10.1) 
Using activemerchant (1.15.0) from https://github.com/yob/active_merchant.git (at nab) /usr/lib/ruby/1.9.1/psych/visitors/emitter.rb:17:in `end_document': undefined method `write' for #<Syck::Emitter:0x000000044a9738> (NoMethodError)
from /usr/lib/ruby/1.9.1/psych/visitors/emitter.rb:17:in `visit_Psych_Nodes_Document'
from /usr/lib/ruby/1.9.1/psych/visitors/visitor.rb:10:in `accept'
from /usr/lib/ruby/1.9.1/psych/visitors/emitter.rb:10:in `block in visit_Psych_Nodes_Stream'
from /usr/lib/ruby/1.9.1/psych/visitors/emitter.rb:10:in `each'
from /usr/lib/ruby/1.9.1/psych/visitors/emitter.rb:10:in `visit_Psych_Nodes_Stream'
from /usr/lib/ruby/1.9.1/psych/visitors/visitor.rb:11:in `accept'
from /usr/lib/ruby/1.9.1/psych/nodes/node.rb:36:in `to_yaml'
from /usr/lib/ruby/1.9.1/psych.rb:166:in `dump'
from /usr/lib/ruby/1.9.1/psych/core_ext.rb:13:in `psych_to_yaml'
from /usr/lib/ruby/1.9.1/rubygems/specification.rb:687:in `node_export'
from /usr/lib/ruby/1.9.1/rubygems/specification.rb:687:in `add'
from /usr/lib/ruby/1.9.1/rubygems/specification.rb:687:in `encode_with'
from /usr/lib/ruby/1.9.1/rubygems/specification.rb:708:in `block (2 levels) in to_yaml'
from /usr/lib/ruby/1.9.1/rubygems/specification.rb:707:in `map'
from /usr/lib/ruby/1.9.1/rubygems/specification.rb:707:in `block in to_yaml'
from /usr/lib/ruby/1.9.1/syck.rb:401:in `call'
from /usr/lib/ruby/1.9.1/syck.rb:401:in `emit'
from /usr/lib/ruby/1.9.1/syck.rb:401:in `quick_emit'
from /usr/lib/ruby/1.9.1/rubygems/specification.rb:706:in `to_yaml'
from /usr/lib/ruby/1.9.1/rubygems/builder.rb:75:in `block (2 levels) in write_package'
from /usr/lib/ruby/1.9.1/rubygems/package/tar_output.rb:73:in `block (3 levels) in add_gem_contents'
from /usr/lib/ruby/1.9.1/rubygems/package/tar_writer.rb:83:in `new'
from /usr/lib/ruby/1.9.1/rubygems/package/tar_output.rb:67:in `block (2 levels) in add_gem_contents'
from /usr/lib/ruby/1.9.1/rubygems/package/tar_output.rb:65:in `wrap'
from /usr/lib/ruby/1.9.1/rubygems/package/tar_output.rb:65:in `block in add_gem_contents'
from /usr/lib/ruby/1.9.1/rubygems/package/tar_writer.rb:113:in `add_file'
from /usr/lib/ruby/1.9.1/rubygems/package/tar_output.rb:63:in `add_gem_contents'
from /usr/lib/ruby/1.9.1/rubygems/package/tar_output.rb:31:in `open'
from /usr/lib/ruby/1.9.1/rubygems/package.rb:58:in `open'
from /usr/lib/ruby/1.9.1/rubygems/builder.rb:74:in `block in write_package'
from /usr/lib/ruby/1.9.1/open-uri.rb:35:in `open'
from /usr/lib/ruby/1.9.1/open-uri.rb:35:in `open'
from /usr/lib/ruby/1.9.1/rubygems/builder.rb:73:in `write_package'
from /usr/lib/ruby/1.9.1/rubygems/builder.rb:38:in `build'
from /var/lib/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/source.rb:450:in `block in generate_bin'
from /var/lib/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/source.rb:450:in `chdir'
from /var/lib/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/source.rb:450:in `generate_bin'
from /var/lib/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/source.rb:559:in `install'
from /var/lib/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/installer.rb:58:in `block (2 levels) in run'
from /var/lib/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/rubygems_integration.rb:93:in `with_build_args'
from /var/lib/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/installer.rb:57:in `block in run'
from /var/lib/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/spec_set.rb:12:in `block in each'
from /var/lib/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/spec_set.rb:12:in `each'
from /var/lib/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/spec_set.rb:12:in `each'
from /var/lib/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/installer.rb:49:in `run'
from /var/lib/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/installer.rb:8:in `install'
from /var/lib/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/cli.rb:270:in `update'
from /var/lib/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/vendor/thor/task.rb:22:in `run'
from /var/lib/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
from /var/lib/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/vendor/thor.rb:246:in `dispatch'
from /var/lib/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/vendor/thor/base.rb:389:in `start'
from /var/lib/gems/1.9.1/gems/bundler-1.0.15/bin/bundle:13:in `<top (required)>'
from /usr/local/bin/bundle:19:in `load'
from /usr/local/bin/bundle:19:in `<main>'

My Gemfile

⚡ cat Gemfile
source 'http://rubygems.org'

gem 'rails', '3.0.7'
gem 'rake',  '0.8.7'
gem 'mysql2', '~> 0.2.7'
gem 'thin', '1.2.11'
gem 'jquery-rails'
gem 'prawn',        '0.11.1'
gem 'formtastic',   '1.1.0'
gem 'aasm',         '2.2.0'
gem "geokit",       '1.5.0'
gem "geokit-rails3",'0.1.2'
gem "andand",       '1.3.1'
gem 'whenever',     '0.6.2', :require => false
gem 'hoptoad_notifier', '~>2.0'
gem 'will_paginate', '3.0.pre2'
gem 'delayed_job',   "2.1.4", :git => "https://github.com/yob/delayed_job.git", :branch => "seconds_2.1.4"
gem 'httpclient',    '2.1.5.2'
gem 'batchbook',     '1.0.4'
gem 'activemerchant', '1.15.0', :require => "active_merchant", :git => "https://github.com/yob/active_merchant.git",    :branch => "nab"
gem 'newrelic_rpm',   '~> 3.0.1'
gem 'timecop',        '0.3.5'
gem 'authlogic',      '~> 3.0.3'
gem 'paperclip',      "~> 2.3"
gem 'arboreal',       '~> 0.1.2'
gem 'roo',            '~> 1.9.3'
gem 'spreadsheet',    '~> 0.6.5'
gem 'google-spreadsheet-ruby'
gem 'rubyzip',        '0.9.4'

group :development, :test do
  gem 'capistrano',       '!= 2.5.20'
  gem 'rspec-rails',      '~>2.5.0'
  gem 'machinist',        '1.0.6'
  gem 'shoulda',          '2.11.3'
  gem 'capybara',         '1.0.0'
  gem 'launchy'
  gem 'roodi'
  gem 'rcov'
end

Gemfile.lock

⚡ cat Gemfile.lock 
GIT
  remote: https://github.com/yob/active_merchant.git
  revision: c22f72ce6570306b813616f0d77f44a59e7c6839
  branch: nab
  specs:
    activemerchant (1.15.0)
    activesupport (>= 2.3.8)
    braintree (>= 2.0.0)
    builder (>= 2.0.0)

GIT
  remote: https://github.com/yob/delayed_job.git
  revision: 73c043a22b13a692fc077a3bbfcb8d90d396f06a
  branch: seconds_2.1.4
  specs:
    delayed_job (2.1.4)
    activesupport (~> 3.0)
  daemons

GEM
  remote: http://rubygems.org/
  specs:
    Ascii85 (1.0.1)
    aaronh-chronic (0.3.9)
aasm (2.2.0)
abstract (1.0.0)
actionmailer (3.0.7)
  actionpack (= 3.0.7)
  mail (~> 2.2.15)
actionpack (3.0.7)
  activemodel (= 3.0.7)
  activesupport (= 3.0.7)
  builder (~> 2.1.2)
  erubis (~> 2.6.6)
  i18n (~> 0.5.0)
  rack (~> 1.2.1)
  rack-mount (~> 0.6.14)
  rack-test (~> 0.5.7)
  tzinfo (~> 0.3.23)
activemodel (3.0.7)
  activesupport (= 3.0.7)
  builder (~> 2.1.2)
  i18n (~> 0.5.0)
activerecord (3.0.7)
  activemodel (= 3.0.7)
  activesupport (= 3.0.7)
  arel (~> 2.0.2)
  tzinfo (~> 0.3.23)
activeresource (3.0.7)
  activemodel (= 3.0.7)
  activesupport (= 3.0.7)
activesupport (3.0.7)
andand (1.3.1)
arboreal (0.1.2)
  activerecord (>= 2.3.0)
  activesupport (>= 2.3.0)
arel (2.0.9)
authlogic (3.0.3)
  activerecord (>= 3.0.7)
  activerecord (>= 3.0.7)
batchbook (1.0.4)
  activeresource (>= 2.3.5)
braintree (2.10.0)
  builder
builder (2.1.2)
capistrano (2.6.0)
  highline
  net-scp (>= 1.0.0)
  net-sftp (>= 2.0.0)
  net-ssh (>= 2.0.14)
  net-ssh-gateway (>= 1.1.0)
capybara (1.0.0)
  mime-types (>= 1.16)
  nokogiri (>= 1.3.3)
  rack (>= 1.0.0)
  rack-test (>= 0.5.4)
  selenium-webdriver (~> 0.2.0)
  xpath (~> 0.1.4)
childprocess (0.1.9)
  ffi (~> 1.0.6)
configuration (1.2.0)
daemons (1.1.3)
diff-lcs (1.1.2)
erubis (2.6.6)
  abstract (>= 1.0.0)
eventmachine (0.12.10)
ffi (1.0.9)
formtastic (1.1.0)
  actionpack (>= 2.3.0)
  activesupport (>= 2.3.0)
  i18n (>= 0.4.0)
geokit (1.5.0)
geokit-rails3 (0.1.2)
  geokit (~> 1.5.0)
  rails (~> 3.0.0)
google-spreadsheet-ruby (0.1.5)
  nokogiri (>= 1.4.3.1)
  oauth (>= 0.3.6)
highline (1.6.2)
hoptoad_notifier (2.4.11)
  activesupport
  builder
httpclient (2.1.5.2)
i18n (0.5.0)
jquery-rails (1.0.9)
  railties (~> 3.0)
  thor (~> 0.14)
json_pure (1.5.2)
launchy (0.4.0)
  configuration (>= 0.0.5)
  rake (>= 0.8.1)
machinist (1.0.6)
mail (2.2.17)
  activesupport (>= 2.3.6)
  i18n (>= 0.4.0)
  mime-types (~> 1.16)
  treetop (~> 1.4.8)
mime-types (1.16)
mysql2 (0.2.7)
net-scp (1.0.4)
  net-ssh (>= 1.99.1)
net-sftp (2.0.5)
  net-ssh (>= 2.0.9)
net-ssh (2.1.4)
net-ssh-gateway (1.1.0)
  net-ssh (>= 1.99.1)
newrelic_rpm (3.0.1)
nokogiri (1.4.4)
oauth (0.4.4)
paperclip (2.3.11)
  activerecord (>= 2.3.0)
  activesupport (>= 2.3.2)
pdf-reader (0.9.2)
  Ascii85 (>= 0.9)
polyglot (0.3.1)
prawn (0.11.1)
  pdf-reader (>= 0.9.0)
  ttfunk (~> 1.0.0)
rack (1.2.2)
rack-mount (0.6.14)
  rack (>= 1.0.0)
rack-test (0.5.7)
  rack (>= 1.0)
rails (3.0.7)
  actionmailer (= 3.0.7)
  actionpack (= 3.0.7)
  activerecord (= 3.0.7)
  activeresource (= 3.0.7)
  activesupport (= 3.0.7)
  bundler (~> 1.0)
  railties (= 3.0.7)
railties (3.0.7)
  actionpack (= 3.0.7)
  activesupport (= 3.0.7)
  rake (>= 0.8.7)
  thor (~> 0.14.4)
rake (0.8.7)
rcov (0.9.9)
roo (1.9.3)
roodi (2.1.0)
  ruby_parser
rspec (2.5.0)
  rspec-core (~> 2.5.0)
  rspec-expectations (~> 2.5.0)
  rspec-mocks (~> 2.5.0)
rspec-core (2.5.2)
rspec-expectations (2.5.0)
  diff-lcs (~> 1.1.2)
rspec-mocks (2.5.0)
rspec-rails (2.5.0)
  actionpack (~> 3.0)
  activesupport (~> 3.0)
  railties (~> 3.0)
  rspec (~> 2.5.0)
ruby-ole (1.2.11.1)
ruby_parser (2.0.6)
  sexp_processor (~> 3.0)
rubyzip (0.9.4)
selenium-webdriver (0.2.1)
  childprocess (>= 0.1.7)
  ffi (>= 1.0.7)
  json_pure
  rubyzip
sexp_processor (3.0.5)
shoulda (2.11.3)
spreadsheet (0.6.5.4)
  ruby-ole (>= 1.0)
thin (1.2.11)
  daemons (>= 1.0.9)
  eventmachine (>= 0.12.6)
  rack (>= 1.0.0)
thor (0.14.6)
timecop (0.3.5)
treetop (1.4.9)
  polyglot (>= 0.3.1)
ttfunk (1.0.1)
tzinfo (0.3.27)
whenever (0.6.2)
  aaronh-chronic (>= 0.3.9)
  activesupport (>= 2.3.4)
will_paginate (3.0.pre2)
xpath (0.1.4)
  nokogiri (~> 1.3)

PLATFORMS
  ruby

DEPENDENCIES
aasm (= 2.2.0)
activemerchant (= 1.15.0)!
andand (= 1.3.1)
arboreal (~> 0.1.2)
authlogic (~> 3.0.3)
batchbook (= 1.0.4)
capistrano (!= 2.5.20)
capybara (= 1.0.0)
delayed_job (= 2.1.4)!
formtastic (= 1.1.0)
geokit (= 1.5.0)
geokit-rails3 (= 0.1.2)
google-spreadsheet-ruby
hoptoad_notifier (~> 2.0)
httpclient (= 2.1.5.2)
jquery-rails
launchy
machinist (= 1.0.6)
mysql2 (~> 0.2.7)
newrelic_rpm (~> 3.0.1)
paperclip (~> 2.3)
prawn (= 0.11.1)
rails (= 3.0.7)
rake (= 0.8.7)
rcov
roo (~> 1.9.3)
roodi
rspec-rails (~> 2.5.0)
rubyzip (= 0.9.4)
shoulda (= 2.11.3)
spreadsheet (~> 0.6.5)
thin (= 1.2.11)
timecop (= 0.3.5)
whenever (= 0.6.2)
will_paginate (= 3.0.pre2)

bundler config:

⚡ bundle config
Settings are listed in order of priority. The top value will be used.

I'm not using RVM or the rubygems-bundler gem.

Downgrading to bundler 1.0.7 avoids the exception.

@indirect
Owner

Did you try 1.0.15?

@indirect indirect closed this
@yob

Yes, as in the initial report:

⚡ bundle --version
Bundler version 1.0.15
@francois2metz

Same issue with bundler 1.0.15. I have installed bundler 1.0.9 and it works.

@yob

Can this issue be re-opened? It was reported against 1.0.15, so the suggestion to try that isn't applicable.

@indirect
Owner

Yup, this is on my list. Reopening...

@indirect indirect reopened this
@yob

cheers

@jdguyot

Same thing here. Tell us if you need tests.

@joevandyk

I get the same error on 1.0.15. Reverting to bundler 1.0.9 fixes it.

@joliss

Here is an easy way to reproduce the problem:

rails new testapp
cd testapp
echo "gem 'devise', :git => 'git://github.com/plataformatec/devise.git'" >> Gemfile # for example
bundle install

And bundle install yields undefined method 'write' for #<Syck::Emitter:0x0000000506b260>(NoMethodError) -- the full output is here:
https://gist.github.com/1071909

And here is the version info:

$ bundle config
Settings are listed in order of priority. The top value will be used.

$ bundle -v
Bundler version 1.0.15
$ ruby -v
ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-linux]
$ gem -v
1.3.7
$ rails -v
git://github.com/plataformatec/devise.git (at master) is not checked out. Please run `bundle install`
$ # No RVM, no rubygems-bundler

Downgrading to 1.0.9 solves the problem for me, but I seem to recall that there are some gems that require newer bundler versions, so getting this fixed in master would be much appreciated!

@joevandyk

I got the error on the prerelease gem version of bundler as well.

cd sites/bellechic && bundle install --binstubs  
Fetching dependency information from the API at http://rubygems.org/......
Fetching git://github.com/joevandyk/monkey_forms.git
remote: Counting objects: 657, done.
remote: Compressing objects: 100% (307/307), done.
remote: Total 657 (delta 318), reused 650 (delta 311)
Receiving objects: 100% (657/657), 85.78 KiB, done.
Resolving deltas: 100% (318/318), done.
Fetching git://github.com/joevandyk/rack-bug.git
remote: Counting objects: 1611, done.
remote: Compressing objects: 100% (598/598), done.
remote: Total 1611 (delta 947), reused 1472 (delta 848)
Receiving objects: 100% (1611/1611), 210.01 KiB, done.
Resolving deltas: 100% (947/947), done.
Fetching git://github.com/sstephenson/sprockets.git
remote: Counting objects: 4364, done.
remote: Compressing objects: 100% (1598/1598), done.
remote: Total 4364 (delta 2769), reused 4162 (delta 2610)
Receiving objects: 100% (4364/4364), 537.39 KiB, done.
Resolving deltas: 100% (2769/2769), done.
Fetching git://github.com/mislav/will_paginate.git
remote: Counting objects: 2838, done.
remote: Compressing objects: 100% (1038/1038), done.
remote: Total 2838 (delta 1837), reused 2711 (delta 1745)
Receiving objects: 100% (2838/2838), 398.41 KiB, done.
Resolving deltas: 100% (1837/1837), done.
Installing rake (0.8.7) 
Installing Platform (0.4.0) 
Installing open4 (1.0.1) 
Installing POpen4 (0.1.4) 
Installing RedCloth (4.2.7) with native extensions 
Installing abstract (1.0.0) 
Using activesupport (3.0.8.rc4) from git://github.com/joevandyk/rails.git (at 6ca0c56) Unfortunately, a fatal error has occurred. Please report this error to the Bundler issue tracker at https://github.com/carlhuda/bundler/issues so that we can fix it. Thanks!
/opt/ruby19/lib/ruby/1.9.1/psych/visitors/emitter.rb:17:in `end_document': undefined method `write' for # (NoMethodError)
    from /opt/ruby19/lib/ruby/1.9.1/psych/visitors/emitter.rb:17:in `visit_Psych_Nodes_Document'
    from /opt/ruby19/lib/ruby/1.9.1/psych/visitors/visitor.rb:10:in `accept'
    from /opt/ruby19/lib/ruby/1.9.1/psych/visitors/emitter.rb:10:in `block in visit_Psych_Nodes_Stream'
    from /opt/ruby19/lib/ruby/1.9.1/psych/visitors/emitter.rb:10:in `each'
    from /opt/ruby19/lib/ruby/1.9.1/psych/visitors/emitter.rb:10:in `visit_Psych_Nodes_Stream'
    from /opt/ruby19/lib/ruby/1.9.1/psych/visitors/visitor.rb:11:in `accept'
    from /opt/ruby19/lib/ruby/1.9.1/psych/nodes/node.rb:36:in `to_yaml'
    from /opt/ruby19/lib/ruby/1.9.1/psych.rb:166:in `dump'
    from /opt/ruby19/lib/ruby/1.9.1/psych/core_ext.rb:13:in `psych_to_yaml'
    from /opt/ruby19/lib/ruby/1.9.1/rubygems/specification.rb:687:in `node_export'
    from /opt/ruby19/lib/ruby/1.9.1/rubygems/specification.rb:687:in `add'
    from /opt/ruby19/lib/ruby/1.9.1/rubygems/specification.rb:687:in `encode_with'
    from /opt/ruby19/lib/ruby/1.9.1/rubygems/specification.rb:708:in `block (2 levels) in to_yaml'
    from /opt/ruby19/lib/ruby/1.9.1/rubygems/specification.rb:707:in `map'
    from /opt/ruby19/lib/ruby/1.9.1/rubygems/specification.rb:707:in `block in to_yaml'
    from /opt/ruby19/lib/ruby/1.9.1/syck.rb:401:in `call'
    from /opt/ruby19/lib/ruby/1.9.1/syck.rb:401:in `emit'
    from /opt/ruby19/lib/ruby/1.9.1/syck.rb:401:in `quick_emit'
    from /opt/ruby19/lib/ruby/1.9.1/rubygems/specification.rb:706:in `to_yaml'
    from /opt/ruby19/lib/ruby/1.9.1/rubygems/builder.rb:75:in `block (2 levels) in write_package'
    from /opt/ruby19/lib/ruby/1.9.1/rubygems/package/tar_output.rb:73:in `block (3 levels) in add_gem_contents'
    from /opt/ruby19/lib/ruby/1.9.1/rubygems/package/tar_writer.rb:83:in `new'
    from /opt/ruby19/lib/ruby/1.9.1/rubygems/package/tar_output.rb:67:in `block (2 levels) in add_gem_contents'
    from /opt/ruby19/lib/ruby/1.9.1/rubygems/package/tar_output.rb:65:in `wrap'
    from /opt/ruby19/lib/ruby/1.9.1/rubygems/package/tar_output.rb:65:in `block in add_gem_contents'
    from /opt/ruby19/lib/ruby/1.9.1/rubygems/package/tar_writer.rb:113:in `add_file'
    from /opt/ruby19/lib/ruby/1.9.1/rubygems/package/tar_output.rb:63:in `add_gem_contents'
    from /opt/ruby19/lib/ruby/1.9.1/rubygems/package/tar_output.rb:31:in `open'
    from /opt/ruby19/lib/ruby/1.9.1/rubygems/package.rb:58:in `open'
    from /opt/ruby19/lib/ruby/1.9.1/rubygems/builder.rb:74:in `block in write_package'
    from /opt/ruby19/lib/ruby/1.9.1/open-uri.rb:35:in `open'
    from /opt/ruby19/lib/ruby/1.9.1/open-uri.rb:35:in `open'
    from /opt/ruby19/lib/ruby/1.9.1/rubygems/builder.rb:73:in `write_package'
    from /opt/ruby19/lib/ruby/1.9.1/rubygems/builder.rb:38:in `build'
    from /opt/ruby19/lib/ruby/gems/1.9.1/gems/bundler-1.1.pre.5/lib/bundler/source.rb:433:in `block in generate_bin'
    from /opt/ruby19/lib/ruby/gems/1.9.1/gems/bundler-1.1.pre.5/lib/bundler/source.rb:433:in `chdir'
    from /opt/ruby19/lib/ruby/gems/1.9.1/gems/bundler-1.1.pre.5/lib/bundler/source.rb:433:in `generate_bin'
    from /opt/ruby19/lib/ruby/gems/1.9.1/gems/bundler-1.1.pre.5/lib/bundler/source.rb:542:in `install'
    from /opt/ruby19/lib/ruby/gems/1.9.1/gems/bundler-1.1.pre.5/lib/bundler/installer.rb:63:in `block (2 levels) in run'
    from /opt/ruby19/lib/ruby/gems/1.9.1/gems/bundler-1.1.pre.5/lib/bundler/rubygems_integration.rb:93:in `with_build_args'
    from /opt/ruby19/lib/ruby/gems/1.9.1/gems/bundler-1.1.pre.5/lib/bundler/installer.rb:62:in `block in run'
    from /opt/ruby19/lib/ruby/gems/1.9.1/gems/bundler-1.1.pre.5/lib/bundler/spec_set.rb:12:in `block in each'
    from /opt/ruby19/lib/ruby/gems/1.9.1/gems/bundler-1.1.pre.5/lib/bundler/spec_set.rb:12:in `each'
    from /opt/ruby19/lib/ruby/gems/1.9.1/gems/bundler-1.1.pre.5/lib/bundler/spec_set.rb:12:in `each'
    from /opt/ruby19/lib/ruby/gems/1.9.1/gems/bundler-1.1.pre.5/lib/bundler/installer.rb:54:in `run'
    from /opt/ruby19/lib/ruby/gems/1.9.1/gems/bundler-1.1.pre.5/lib/bundler/installer.rb:12:in `install'
    from /opt/ruby19/lib/ruby/gems/1.9.1/gems/bundler-1.1.pre.5/lib/bundler/cli.rb:213:in `install'
    from /opt/ruby19/lib/ruby/gems/1.9.1/gems/bundler-1.1.pre.5/lib/bundler/vendor/thor/task.rb:22:in `run'
    from /opt/ruby19/lib/ruby/gems/1.9.1/gems/bundler-1.1.pre.5/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
    from /opt/ruby19/lib/ruby/gems/1.9.1/gems/bundler-1.1.pre.5/lib/bundler/vendor/thor.rb:246:in `dispatch'
    from /opt/ruby19/lib/ruby/gems/1.9.1/gems/bundler-1.1.pre.5/lib/bundler/vendor/thor/base.rb:389:in `start'
    from /opt/ruby19/lib/ruby/gems/1.9.1/gems/bundler-1.1.pre.5/bin/bundle:13:in `'
    from /opt/ruby19/bin/bundle:19:in `load'
    from /opt/ruby19/bin/bundle:19:in `'
rake aborted!
Command failed with status (1): [cd sites/bellechic && bundle install --bin...]
/opt/ruby19/lib/ruby/1.9.1/rake.rb:993:in `block in sh'
/opt/ruby19/lib/ruby/1.9.1/rake.rb:1008:in `call'
/opt/ruby19/lib/ruby/1.9.1/rake.rb:1008:in `sh'
/opt/ruby19/lib/ruby/1.9.1/rake.rb:1092:in `sh'
/var/lib/jenkins/jobs/Tanga_Master/workspace/Rakefile:26:in `block (2 levels) in '
/var/lib/jenkins/jobs/Tanga_Master/workspace/Rakefile:25:in `each'
/var/lib/jenkins/jobs/Tanga_Master/workspace/Rakefile:25:in `block in '
/opt/ruby19/lib/ruby/1.9.1/rake.rb:634:in `call'
/opt/ruby19/lib/ruby/1.9.1/rake.rb:634:in `block in execute'
/opt/ruby19/lib/ruby/1.9.1/rake.rb:629:in `each'
/opt/ruby19/lib/ruby/1.9.1/rake.rb:629:in `execute'
/opt/ruby19/lib/ruby/1.9.1/rake.rb:595:in `block in invoke_with_call_chain'
/opt/ruby19/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/opt/ruby19/lib/ruby/1.9.1/rake.rb:588:in `invoke_with_call_chain'
/opt/ruby19/lib/ruby/1.9.1/rake.rb:581:in `invoke'
/var/lib/jenkins/jobs/Tanga_Master/workspace/Rakefile:53:in `block (2 levels) in '
/opt/ruby19/lib/ruby/1.9.1/rake.rb:634:in `call'
/opt/ruby19/lib/ruby/1.9.1/rake.rb:634:in `block in execute'
/opt/ruby19/lib/ruby/1.9.1/rake.rb:629:in `each'
/opt/ruby19/lib/ruby/1.9.1/rake.rb:629:in `execute'
/opt/ruby19/lib/ruby/1.9.1/rake.rb:595:in `block in invoke_with_call_chain'
/opt/ruby19/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/opt/ruby19/lib/ruby/1.9.1/rake.rb:588:in `invoke_with_call_chain'
/opt/ruby19/lib/ruby/1.9.1/rake.rb:581:in `invoke'
/opt/ruby19/lib/ruby/1.9.1/rake.rb:2041:in `invoke_task'
/opt/ruby19/lib/ruby/1.9.1/rake.rb:2019:in `block (2 levels) in top_level'
/opt/ruby19/lib/ruby/1.9.1/rake.rb:2019:in `each'
/opt/ruby19/lib/ruby/1.9.1/rake.rb:2019:in `block in top_level'
/opt/ruby19/lib/ruby/1.9.1/rake.rb:2058:in `standard_exception_handling'
/opt/ruby19/lib/ruby/1.9.1/rake.rb:2013:in `top_level'
/opt/ruby19/lib/ruby/1.9.1/rake.rb:1992:in `run'
/opt/ruby19/bin/rake:31:in `'

@moro

I got similer issue on Ruby 1.9.2p290 with bundler 1.0.15.

with Gemfile below.

source :rubygems
gem 'tapp', git: 'git://github.com/esminc/tapp.git'

and run bundle --path .bundle/gems fails with

Using tapp (1.1.0) from git://github.com/esminc/tapp.git (at master) /Users/moro/opt/ruby192/lib/ruby/1.9.1/psych/visitors/emitter.rb:17:in `end_document': undefined method `write' for #<Syck::Emitter:0x00000100dad4b8> (NoMethodError)
    from /Users/moro/opt/ruby192/lib/ruby/1.9.1/psych/visitors/emitter.rb:17:in `visit_Psych_Nodes_Document'
    from /Users/moro/opt/ruby192/lib/ruby/1.9.1/psych/visitors/visitor.rb:10:in `accept'
    from /Users/moro/opt/ruby192/lib/ruby/1.9.1/psych/visitors/emitter.rb:10:in `block in visit_Psych_Nodes_Stream'
    from /Users/moro/opt/ruby192/lib/ruby/1.9.1/psych/visitors/emitter.rb:10:in `each'
(snip)

but with RUBYOPT env, e.g. RUBYOPT='-rpsych' bundle --path .bundle/gems works well.

@joliss

Thanks Moro -- just wanted to confirm that setting RUBYOPT='-rpsych' solves the problem for my app as well!

*gently nags @carlhuda about this bug, just in case it got lost* ;-)

@docunext

RUBYOPT='-rpsych' breaks the install of memcached.

@indirect
Owner

I honestly can't reproduce this, even without Psych required. Can anyone give me a hand with some exact repro steps?


$ ruby -v
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin11.0.0]

$ gem -v
1.6.2

$ bundle -v
Bundler version 1.0.19.rc

$ cat Gemfile
gem "tapp", :git => "https://github.com/esminc/tapp.git"

$ bundle install
Using tapp (1.1.0) from https://github.com/esminc/tapp.git (at master) 
Using bundler (1.0.19.rc) 
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.

$ echo $RUBYOPT

$ irb
ruby-1.9.2-p290 :001 > Psych
NameError: uninitialized constant Object::Psych
        from (irb):1
        from /Users/andre/.rvm/rubies/ruby-1.9.2-p290/bin/irb:16:in `<main>'
ruby-1.9.2-p290 :002 > require 'psych'
 => true 
ruby-1.9.2-p290 :003 > Psych
 => Psych 
@yob

I'm running rubygems 1.3.7, the version bundled with 1.9.2p290, does that make a difference?

@indirect
Owner

Unfortunately, it works perfectly for me with Rubygems 1.3.7 as well:


$ rvm rubygems remove
Removing old Rubygems files...
Installing rubygems dedicated to ruby-1.9.2-p290...

$ gem -v
1.3.7

$ bundle -v
Bundler version 1.0.19.rc

$ bundle
Using tapp (1.1.0) from https://github.com/esminc/tapp.git (at master) 
Using bundler (1.0.19.rc) 
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
@yob

I've setup a clean VM to try and nail some simple reproduction steps.

it's a 64bit debian VM, but I installed ruby 1.9.2p290 from source with:

./configure --prefix=/usr/local && make && make install

libyaml was available on the system, so psych support was compiled in. I didn't use rvm.

From that start, the following steps reproduce it for me:

gem install bundler
> successfully installed bundler-1.0.18

ruby -v
> ruby 1.9.2p290

gem -v
> 1.3.7

bundle -v
> Bundler version 1.0.18

cat Gemfile
> gem "tapp", :git => "https://github.com/esminc/tapp.git"

RubyGems Environment:
  - RUBYGEMS VERSION: 1.3.7
  - RUBY VERSION: 1.9.2 (2011-07-09 patchlevel 290) [x86_64-linux]
  - INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/1.9.1
  - RUBY EXECUTABLE: /usr/local/bin/ruby
  - EXECUTABLE DIRECTORY: /usr/local/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-linux
  - GEM PATHS:
     - /usr/local/lib/ruby/gems/1.9.1
     - /root/.gem/ruby/1.9.1
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
     - "gem" => "--no-ri --no-rdoc"
  - REMOTE SOURCES:
     - http://rubygems.org/

export | grep RUBY
>

irb
irb(main):001:0> require 'yaml'
false
irb(main):002:0> YAML
Syck

bundle install
Using tapp (1.1.0) from https://github.com/esminc/tapp.git (at master) /usr/local/lib/ruby/1.9.1/psych/visitors   /emitter.rb:17:in `end_document': undefined method `write' for #<Syck::Emitter:0x00000001db4268> (NoMethodError)
    from /usr/local/lib/ruby/1.9.1/psych/visitors/emitter.rb:17:in `visit_Psych_Nodes_Document'
    from /usr/local/lib/ruby/1.9.1/psych/visitors/visitor.rb:10:in `accept'
    from /usr/local/lib/ruby/1.9.1/psych/visitors/emitter.rb:10:in `block in visit_Psych_Nodes_Stream'
    from /usr/local/lib/ruby/1.9.1/psych/visitors/emitter.rb:10:in `each'
    from /usr/local/lib/ruby/1.9.1/psych/visitors/emitter.rb:10:in `visit_Psych_Nodes_Stream'
    from /usr/local/lib/ruby/1.9.1/psych/visitors/visitor.rb:11:in `accept'
    from /usr/local/lib/ruby/1.9.1/psych/nodes/node.rb:36:in `to_yaml'
    from /usr/local/lib/ruby/1.9.1/psych.rb:166:in `dump'
    from /usr/local/lib/ruby/1.9.1/psych/core_ext.rb:13:in `psych_to_yaml'
    from /usr/local/lib/ruby/1.9.1/rubygems/specification.rb:687:in `node_export'
    from /usr/local/lib/ruby/1.9.1/rubygems/specification.rb:687:in `add'
    from /usr/local/lib/ruby/1.9.1/rubygems/specification.rb:687:in `encode_with'
    from /usr/local/lib/ruby/1.9.1/rubygems/specification.rb:708:in `block (2 levels) in to_yaml'
    from /usr/local/lib/ruby/1.9.1/rubygems/specification.rb:707:in `map'
    from /usr/local/lib/ruby/1.9.1/rubygems/specification.rb:707:in `block in to_yaml'
    from /usr/local/lib/ruby/1.9.1/syck.rb:401:in `call'
    from /usr/local/lib/ruby/1.9.1/syck.rb:401:in `emit'
    from /usr/local/lib/ruby/1.9.1/syck.rb:401:in `quick_emit'
    from /usr/local/lib/ruby/1.9.1/rubygems/specification.rb:706:in `to_yaml'
    from /usr/local/lib/ruby/1.9.1/rubygems/builder.rb:75:in `block (2 levels) in write_package'
    from /usr/local/lib/ruby/1.9.1/rubygems/package/tar_output.rb:73:in `block (3 levels) in add_gem_contents'
    from /usr/local/lib/ruby/1.9.1/rubygems/package/tar_writer.rb:83:in `new'
    from /usr/local/lib/ruby/1.9.1/rubygems/package/tar_output.rb:67:in `block (2 levels) in add_gem_contents'
    from /usr/local/lib/ruby/1.9.1/rubygems/package/tar_output.rb:65:in `wrap'
    from /usr/local/lib/ruby/1.9.1/rubygems/package/tar_output.rb:65:in `block in add_gem_contents'
    from /usr/local/lib/ruby/1.9.1/rubygems/package/tar_writer.rb:113:in `add_file'
    from /usr/local/lib/ruby/1.9.1/rubygems/package/tar_output.rb:63:in `add_gem_contents'
    from /usr/local/lib/ruby/1.9.1/rubygems/package/tar_output.rb:31:in `open'
    from /usr/local/lib/ruby/1.9.1/rubygems/package.rb:58:in `open'
    from /usr/local/lib/ruby/1.9.1/rubygems/builder.rb:74:in `block in write_package'
    from /usr/local/lib/ruby/1.9.1/open-uri.rb:35:in `open'
    from /usr/local/lib/ruby/1.9.1/open-uri.rb:35:in `open'
    from /usr/local/lib/ruby/1.9.1/rubygems/builder.rb:73:in `write_package'
    from /usr/local/lib/ruby/1.9.1/rubygems/builder.rb:38:in `build'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler/source.rb:456:in `block in generate_bin'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler/source.rb:456:in `chdir'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler/source.rb:456:in `generate_bin'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler/source.rb:565:in `install'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler/installer.rb:58:in `block (2 levels) in run'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler/rubygems_integration.rb:93:in `with_build_args'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler/installer.rb:57:in `block in run'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler/installer.rb:49:in `run'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler/installer.rb:8:in `install'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler/cli.rb:220:in `install'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler/vendor/thor/task.rb:22:in `run'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler/vendor/thor.rb:263:in `dispatch'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler/vendor/thor/base.rb:386:in `start'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/bin/bundle:13:in `<top (required)>'
    from /usr/local/bin/bundle:19:in `load'
    from /usr/local/bin/bundle:19:in `<main>'
@indirect
Owner

I got some expert help from tenderlove on this, and he pointed out that your require 'yaml' line returns false. That means that something else in your ruby had already required 'yaml', perhaps because you have RUBYOPT set? You must require 'psych' before you require 'yaml' for things to work, so making sure that Bundler is able to load psych and yaml itself is the solution to this issue.

@indirect indirect closed this
@yob
@indirect
Owner

Right now, something in your ruby stack is loading 'yaml' before Bundler (or IRB) loads. Please figure out what is requiring 'yaml' and remove it so that Bundler can load Psych and YAML successfully. Thanks!

@yob

When I run irb, yaml is required by line 207 of /usr/local/lib/ruby/1.9.1/rubygems/config_file.rb

Here's the backtrace to that point:

/usr/local/lib/ruby/1.9.1/rubygems/config_file.rb:207:in `load_file'
/usr/local/lib/ruby/1.9.1/rubygems/config_file.rb:155:in `initialize'
/usr/local/lib/ruby/1.9.1/rubygems.rb:390:in `new'
/usr/local/lib/ruby/1.9.1/rubygems.rb:390:in `configuration'
/usr/local/lib/ruby/1.9.1/rubygems.rb:618:in `path'
/usr/local/lib/ruby/1.9.1/rubygems/source_index.rb:68:in `installed_spec_directories'
/usr/local/lib/ruby/1.9.1/rubygems/source_index.rb:58:in `from_installed_gems'
/usr/local/lib/ruby/1.9.1/rubygems.rb:866:in `source_index'
/usr/local/lib/ruby/1.9.1/rubygems/gem_path_searcher.rb:81:in `init_gemspecs'
/usr/local/lib/ruby/1.9.1/rubygems/gem_path_searcher.rb:13:in `initialize'
/usr/local/lib/ruby/1.9.1/rubygems.rb:824:in `new'
/usr/local/lib/ruby/1.9.1/rubygems.rb:824:in `block in searcher'
<internal:prelude>:10:in `synchronize'
/usr/local/lib/ruby/1.9.1/rubygems.rb:823:in `searcher'
/usr/local/lib/ruby/1.9.1/rubygems.rb:484:in `find_files'
/usr/local/lib/ruby/1.9.1/rubygems.rb:966:in `load_plugins'
/usr/local/lib/ruby/1.9.1/rubygems.rb:1136:in `<top (required)>'
<internal:lib/rubygems/custom_require>:29:in `require'
<internal:lib/rubygems/custom_require>:29:in `require'
/usr/local/bin/irb:11:in `require'
<internal:gem_prelude>:167:in `load_full_rubygems_library'
<internal:gem_prelude>:217:in `try_activate'
/usr/local/lib/ruby/1.9.1/irb/locale.rb:150:in `block in search_file'
/usr/local/lib/ruby/1.9.1/irb/locale.rb:158:in `block in each_localized_path'
/usr/local/lib/ruby/1.9.1/irb/locale.rb:167:in `each_sublocale'
/usr/local/lib/ruby/1.9.1/irb/locale.rb:157:in `each_localized_path'
/usr/local/lib/ruby/1.9.1/irb/locale.rb:145:in `search_file'
/usr/local/lib/ruby/1.9.1/irb/locale.rb:124:in `find'
/usr/local/lib/ruby/1.9.1/irb/locale.rb:108:in `load'
/usr/local/lib/ruby/1.9.1/irb/locale.rb:32:in `initialize'
/usr/local/lib/ruby/1.9.1/irb/init.rb:114:in `new'
/usr/local/lib/ruby/1.9.1/irb/init.rb:114:in `init_config'
/usr/local/lib/ruby/1.9.1/irb/init.rb:16:in `setup'
/usr/local/lib/ruby/1.9.1/irb.rb:53:in `start'
/usr/local/bin/irb:17:in `<main>'

On the same system:

ruby -e "puts YAML"
> -e:1:in `<main>': uninitialized constant Object::YAML (NameError)

Which suggests it's not something in my stack that's loading yaml right?

@indirect
Owner

I believe that only older versions of Rubygems load YAML. Can you upgrade your Rubygems and try again?

@joevandyk

Bundler won't work with the version of rubygems that comes with 1.9?

@indirect
Owner

As I showed above, it works perfectly for me with Ruby 1.9.2-p290 and Rubygems 1.3.7. I'm trying to offer a workaround, since this is apparently an exceptional situation for some subset of 1.9 users.

@yob

I'd rather not upgrade rubygems if I can help it, I don't like upgrading anything in the standard library outside the ruby release cycle.

Surely bundler should work with the rubygems bundled in the current stable release of ruby?

@indirect
Owner

As I demonstrated in my paste above, it works for me with Ruby 1.9.2-p290 and Rubygems 1.3.6. Perhaps you can debug your particular machine to figure out what is different in your case?

@yob

It's difficult to track down the difference between my system and yours when I don't have access to how yours is setup. Mine is just a straight install from source on a clean system with no gems installed besides bundler.

This is a frustrating situation, but I appreciate your work on trying to track it down. Ultimately it's all down to the complete balls up of YAML in 1.9.2, not bundler.

@indirect
Owner

I talked about this with tenderlove some more, and I'm going to implement a patch that checks for YAML, and doesn't require Psych if YAML is already loaded. I think that will fix your issue without hurting anything else. :)

@indirect indirect reopened this
@indirect indirect was assigned
@yob

<3 <3

@indirect indirect closed this in 73b04ed
@dbackeus

I'm getting this error now for the first time after updating Bundler from 1.0.18 to 1.0.20.

bundle -v
Bundler version 1.0.20

ruby -v
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin10.8.0]

gem -v
1.8.6

rvm -v
rvm 1.6.32 by Wayne E. Seguin

Error when running bundle or bundle update etc:

Using logparser (0.3.0) from git@github.com:streamio/logparser.git (at master) 
NoMethodError: undefined method `write' for #<Syck::Emitter:0x000001012a7478>
An error occured while installing logparser (0.3.0), and Bundler cannot continue.
Make sure that `gem install logparser -v '0.3.0'` succeeds before bundling.

Gist with Gemfile, Gemfile.lock and complete console output:
https://gist.github.com/1250373

Uninstalling 1.0.20 and thus using 1.0.18 again fixes the problem for me for the time being.

@stefankroes

Same here, bundle command breaks on 1.0.20 but not on 1.0.18.

Using a clean install of ruby 1.9.2-p290 from rvm

@madsheep

eh. Same here, 1.0.20

@rmontgomery429

We're having this same issue on 1.0.20. (no problems rolling back to 1.0.18)

Stackoverflow has a suggested workaround that we have not personally confirmed, but I thought I'd share it here.

http://stackoverflow.com/questions/4932881/gemcutter-rake-build-now-throws-undefined-method-write-for-syckemitter

@acurley

I was having this message trying to install activeadmin from git. I reverted back to 1.0.18 on Ruby 1.9.2-p290 and everything worked fine.

@marcweil

I have this exact issue with 1.0.20 as well, running on a brand new RVM installation of 1.9.2-p290 on Ubuntu. Rest of my environment is pretty much exactly the same as everyone else's. I don't explicitly use Psych or Syck anywhere, and I'd rather not have to spend the hours digging through my transitive dependencies trying to find out where the load order is wrong.

Feels like debugging extension crashes back in the days of pre-OSX.

@indirect
Owner

Please try Bundler 1.0.21.rc by running gem install bundler -v1.0.21.rc. It fixed the problem in my tests. Thanks!

@be9

Also had this problem with 1.0.20, rolled back to 1.0.18

@scomma

I had this problem with Bundler 1.0.20 and upgrading to 1.0.21.rc solves it for me. Thanks @indirect.

@forforf

1.0.21.rc also solved this problem for me.

@tatemae

I had this same problem. Upgrading to 1.0.21.rc fixed it for me as well. Thanks!

@lucapette

Same problem, same solution here. Thanks for working on it!

@ollie

Upgrading to 1.0.21.rc worked for me too, thanks! (Worked fine before)

@joliss

Upgrading to 1.0.21 isn't quite working for me:

Updating git://github.com/joliss/capybara.git
Fetching source index for http://rubygems.org/
/usr/lib/ruby/1.9.1/rubygems/specification.rb:289:in `load': uninitialized constant Syck::Syck (NameError)
    from /usr/lib/ruby/1.9.1/rubygems/specification.rb:289:in `_load'
    from /usr/lib/ruby/1.9.1/rubygems/spec_fetcher.rb:119:in `load'
    from /usr/lib/ruby/1.9.1/rubygems/spec_fetcher.rb:119:in `fetch_spec'
    from /var/lib/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/remote_specification.rb:47:in `_remote_specification'
    from /var/lib/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/remote_specification.rb:53:in `method_missing'
    from /var/lib/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/resolver.rb:101:in `block in __dependencies'
    from /var/lib/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/resolver.rb:98:in `each'
    from /var/lib/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/resolver.rb:98:in `__dependencies'
    ...
    from /var/lib/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/definition.rb:90:in `specs'
    from /var/lib/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/definition.rb:85:in `resolve_remotely!'
    from /var/lib/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/installer.rb:43:in `run'
    from /var/lib/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/installer.rb:8:in `install'
    from /var/lib/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/cli.rb:268:in `update'
    from /var/lib/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/vendor/thor/task.rb:22:in `run'
    from /var/lib/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
    from /var/lib/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/vendor/thor.rb:263:in `dispatch'
    from /var/lib/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/vendor/thor/base.rb:386:in `start'
    from /var/lib/gems/1.9.1/gems/bundler-1.0.21/bin/bundle:13:in `<top (required)>'
    from /var/lib/gems/1.9.1/bin/bundle:19:in `load'
    from /var/lib/gems/1.9.1/bin/bundle:19:in `<main>'

(Adding RUBYOPT=-rpsych only changes the error message to uninitialized constant Psych::Syck (NameError).)

However, upgrading to bundler 1.1.rc (gem install bundler --pre) fixed all problems for me.

@docunext

I had a related problem with this today:

http://www.ruby.code-experiments.com/blog/2011/10/bundler-rubygems-and-git-source-problems.html

NoMethodError: undefined method `yaml' for #<Psych::Nodes::Stream:0x9d78120

On Debian, Ruby 1.9.3-rc1, bundler 1.0.21 and 1.1.rc. Fixed it by uninstalling psych (1.2.2). If I install psych again, the problem happens again. I installed psych 1.2.1 and do not experience any issues.

@tadman

I'm getting this with bundler 1.0.21 and Psych 1.2.2.

Psych 1.2.1 produces an even more peculiar result:

ArgumentError: wrong number of arguments (2 for 1)
@indirect
Owner

@tadman so have you tried installing uninstalling 1.2.2 and installing 1.2.1 as the previous commenter suggests?

@hone
Owner

@joliss a newer version of rubygems >= 1.8.6 should fix that. It seems to be an issue with broken gemspecs from rubygems.

@elfassy

rubygems >= 1.8.6

  • bundler >= 1.1.rc3 fixes the problem
@simianarmy

Between
NoMethodError undefined method `write' for #<Syck::Emitter....
and
ArgumentError wrong number of arguments(1 for 0)

I have never been able to get either syck or psych to work without generating these errors periodically.
Incredibly lame.

My latest workaround? putting this in my preinitializer.rb after requiring bundler but before Bundler.setup:

require 'syck'
require 'yaml'
YAML::ENGINE.yamler = "syck" if RUBY_VERSION >= "1.9.2"

@eyberg

this is occuring again for me -- choking on the git options, I started commenting them out and it looks like it was also choking on colons for require options as well...

[vagrant@localhost ~]$ gem -v
1.8.11

[vagrant@localhost ~]$ ruby -v
ruby 1.9.3p125 (2012-02-16) [x86_64-linux]

[vagrant@localhost ~]$ bundle -v
Bundler version 1.1.3

[vagrant@localhost enliven]$ uname -a
Linux localhost.localdomain 2.6.32-71.el6.x86_64 #1 SMP Fri May 20 03:51:51 BST 2011 x86_64 x86_64 x86_64 GNU/Linux

[vagrant@localhost enliven]$ irb
irb(main):001:0> require 'psych'
=> true
irb(main):002:0> require 'yaml'
=> true
irb(main):003:0>

[vagrant@localhost enliven]$ irb
irb(main):001:0> require 'yaml'
=> true
irb(main):002:0>

one thing I noticed in these other tkts is that other people were on 64 arch -- not sure that matters but the reason I mention this is cause I have another vanilla box that was 32 and was perfectly fine w/the same versions of {ruby, gems, bundler} (both using psych as well)

@eyberg

just found the solution to my problem

this particular Gemfile I was working with had syntax like:

"gem 'blah', git: 'blah.com' on the 32bit system

when I changed it to the new syntax of

"gem 'blah', :git => 'blah.com' on the 64 bit system

it worked...

turns out I did have different libyaml versions..

vagrant@lucid32:/usr/lib$ ls -lh /usr/lib/libyaml-0.so.2.0.1
-rw-r--r-- 1 root root 114K 2009-12-14 13:47 /usr/lib/libyaml-0.so.2.0.1

[vagrant@localhost include]$ ls -lh /usr/lib64/libyaml-0.so.2.0.2
-rwxr-xr-x 1 root root 355K Jan 26 02:09 /usr/lib64/libyaml-0.so.2.0.2

so the newer version requires the newer syntax

@tadman

Changing the syntax from 1.9 style git: 'blah.com' to 1.8 style :git => 'blah.com' shouldn't fix anything. If it does, something peculiar is going on.

@indirect
Owner

If it does, you're secretly running Ruby 1.8, and you have much bigger problems than Bundler. :)

@eyberg

yeh I took a look at it and it was def a path issue loading 1.8 - my bad

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.