Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gem install fails with "Could not find a valid gem 'yaml'"

Tags:

ruby

rubygems

gem

I'm building a gem from a currently working ruby program. It's using jruby 1.7.12 and, among other things, does a "require 'yaml". For the gem, my Gemfile contains:

source 'https://rubygems.org'
gemspec

When I run

gem build program.gemspec 

that works just fine, but when I run

gem install program-0.15.01.gem

it fails with

ERROR:  Could not find a valid gem 'yaml' (>= 0) in any repository 
ERROR:  Possible alternatives: aml, cyaml, haml, maml, raml  

Doesn't make any sense since the yaml module is part of the ruby 1.9.3 standard library.

I've upgraded to the latest rubygems (2.4.5).

What the heck am I missing?

like image 361
JESii Avatar asked Dec 22 '14 15:12

JESii


1 Answers

yaml is part of Ruby. There is no yaml gem (see https://rubygems.org/search?query=yaml).

Therefore remove

s.add_runtime_dependency 'yaml'

from your gemspec and just add require 'yaml' to the file in which you want to use YAML.

like image 166
spickermann Avatar answered Nov 15 '22 00:11

spickermann