bundler 1.3.3 crashes on install with YAML with "undefined method `dump' for YAML:Module" #2394
Comments
Looks like someone beat me to it while I was typing all this crap in: #2393 |
I only have this issue when doing bundle install with the "--deployment" argument. the standard bundle install method still works. Will revert to 1.3.2 until it is fixed. |
Got a similar after upgraded bundler to 1.3.3: $ bundle config build.pg --with-pg-config=
|
Ditto, same issue here with 1.3.3 (and only with --deployment). |
The problem was introduced in 405edfe and is due to bundler checking whether the YAML constant is defined, before requiring it. Older versions of rubygems (1.8.11 in my case, which is the Ubuntu 12.04 system default) define this class on load for compatibility reasons (see https://github.com/rubygems/rubygems/blob/11ba6639d4b30d805a08af26c01a61dbaf380b73/lib/rubygems/requirement.rb). This has been changed later, as visible in the commit history: https://github.com/rubygems/rubygems/commits/master/lib/rubygems/requirement.rb The solution would be as simple as to remove the safeguard from bundler's psyched.yaml.rb: https://github.com/carlhuda/bundler/blob/master/lib/bundler/psyched_yaml.rb#L16 |
@pehlert the check was added because of problems that I don't totally remember right now, but I believe it had something to do with a double load that caused exceptions. Could you guys try this patch and see if it fixes things? If it does, I'll get 1.3.4 out today. diff --git a/lib/bundler/psyched_yaml.rb b/lib/bundler/psyched_yaml.rb
index 9c878f1..7ce3bb9 100644
--- a/lib/bundler/psyched_yaml.rb
+++ b/lib/bundler/psyched_yaml.rb
@@ -13,7 +13,7 @@ rescue LoadError
end
# At least load the YAML stdlib, whatever that may be
-require 'yaml' unless defined?(YAML)
+require 'yaml' unless defined?(YAML.dump)
module Bundler
# On encountering invalid YAML, |
Closing this as a dupe of #2393, but I'll keep an eye out for success reports. |
@indirect Confirmed, this fixes the issue for me. In lack of better ideas (rubygems version checking would hardly be more reliable), I'd go with this as well. Many thanks for the quick response! |
@indirect Confirmed fix here as well. Thanks! |
Command:
Stack trace:
The command works just fine in bundler 1.3.2.
The directory "/home/vagrant/deploy-gems" does not exist, but creating it makes no difference.
I followed the troubleshooting steps in ISSUES.md, but they didn't help.
This is on Ubuntu 12.04, using the distro's ruby1.9.1-full package, version 1.9.3.0-1ubuntu2.5.
Output of
bundle env
:The text was updated successfully, but these errors were encountered: