Any other way to circumvent the Illformed requirement YAML::Syck::DefaultKey errors then to upgrade RubyGems?

StackOverflow https://stackoverflow.com/questions/9295566

  •  29-04-2021
  •  | 
  •  

Question

I am getting Invalid gemspec in [path/to/vendor/bundle/spree_api-1.0.0.gemspec]: Illformed requirement ["#<YAML::Syck::DefaultKey:0x2ac381f81938> 1.0.0"] for several gems (all Spree, and its spree_* requirements). I have reported the issue with both spree (whom, I suspect, changed their build-line; and with the hoster, site5, who has an outdated version of RubyGems, 1.6.2)

Several questions on stackoverflow have solutions for this, but none are applicable to me.

  1. I cannot use RVM to upgrade to other versions of Ruby, because the (v)host has passenger installed, which AFAIK only allows running one Ruby version. I have no access to the Passenger Setup, other then trough a .htaccess in my public folder.
  2. I cannot do gem update --system, because that requires sudo, which I don't have.

I am curious why this error occurs: Is it something that can be solved by building the gem myself (e.g. from git), rather then fetching it from rubygems.org.

Is it maybe something that can be solved by packaging the gems on my development machine? I don't encounter the problem there, and other then the RubyGems version,my dev machine has the exact same Ruby version installed (there I can use rvm just fine).

Was it helpful?

Solution

You probably found a way around this by now, but here's a hacky way to fix it if you have permissions to write the changes.

cd /path/to/vendor/bundle/ and open spree_api-1.0.0.gemspec in a text editor.

Delete anywhere it says #<YAML::Syck::DefaultKey:...> and replace it with >=.

Save it, go back to your Rails app directory and run bundle install

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top