Bug 979133 - Ruby does not come with psych built in
Ruby does not come with psych built in
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: ruby (Show other bugs)
19
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Vít Ondruch
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-06-27 13:28 EDT by cpg
Modified: 2013-07-30 08:06 EDT (History)
19 users (show)

See Also:
Fixed In Version: ruby-2.0.0.247-14.fc19
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-07-15 21:35:16 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description cpg 2013-06-27 13:28:59 EDT
Description of problem:

In Fedora 19 RC2, ruby does not come with psyc bult in. In previous releases it comes with it. e.g. in Fedora 18:

$ irb
irb(main):001:0> require 'psych'
=> true
irb(main):002:0>
$ rpm -qa | grep psych
$


because psych is a YAML parser and YAML is used very often in ruby and ruby-on-rails apps, this severy limits the use of ruby in F19.

Apparently, having it as a gem (which in F19 is rubygem-psych) is not enough and requires recompiling ruby with it installed.

Any app that require it will get 

/usr/lib/ruby/.../yaml.rb:56:in `<top (required)>':
It seems your ruby installation is missing psych (for YAML output).
To eliminate this warning, please install libyaml and reinstall your ruby.
Latest version currently installed. Aborting.

Version-Release number of selected component (if applicable):


How reproducible:

100%

Steps to Reproduce:
1. install ruby and rubygem-psych
2. run irb
3. at the irb prompt type require 'psych' 

Actual results:

exception is raised

Expected results:

require 'psych' returns true

Additional info:
Comment 1 cpg 2013-06-27 14:04:20 EDT
Apologies, my f19 machine is temporarily down with a bug ...

It appears the IRB command is _not_ enough to see this issue in F19.

I will post a log here with a small that reproduces the issue of ruby not recognizing psych.
Comment 2 cpg 2013-06-27 16:48:34 EDT
Included here is a proper way to reproduce this bug on F19 RC2. Even a very simple Rails app (most will includ therubyracer) will cause this issue.

Steps to Reproduce:

yum -y install ruby rubygem-bundler rubygem-psych rubygem-rails 
rails new psych-bug --skip-bundle
cd psych-bug
echo "gem 'therubyracer'" >> Gemfile
bundle

(you may have to install some other devel-type packages befor hitting this issue, like gcc or gcc-c++, I have them installed already)


Actual results:

...
Using sass (3.2.9)
Using sass-rails (3.2.6)
Using sqlite3 (1.3.7)
Installing therubyracer (0.11.4)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

    /usr/bin/ruby extconf.rb
checking for main() in -lpthread... yes
/usr/share/ruby/yaml.rb:6:in `<top (required)>':
It seems your ruby installation is missing psych (for YAML output).
To eliminate this warning, please install libyaml and reinstall your ruby.
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
	--with-opt-dir
	--without-opt-dir
	--with-opt-include
	--without-opt-include=${opt-dir}/include
	--with-opt-lib
	--without-opt-lib=${opt-dir}/lib64
	--with-make-prog
	--without-make-prog
	--srcdir=.
	--curdir
	--ruby=/usr/bin/ruby
	--with-pthreadlib
	--without-pthreadlib
	--enable-debug
	--disable-debug
/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:45:in `require': cannot load such file -- psych.so (LoadError)
	from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:45:in `require'
	from /usr/share/gems/gems/psych-2.0.0/lib/psych.rb:1:in `<top (required)>'
	from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:110:in `require'
	from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:110:in `rescue in require'
	from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:35:in `require'
	from /usr/share/ruby/yaml.rb:7:in `<top (required)>'
	from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:45:in `require'
	from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:45:in `require'
	from /home/cpg/.gem/ruby/gems/libv8-3.11.8.17-x86_64-linux/ext/libv8/location.rb:1:in `<top (required)>'
	from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:45:in `require'
	from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:45:in `require'
	from /home/cpg/.gem/ruby/gems/libv8-3.11.8.17-x86_64-linux/lib/libv8.rb:2:in `<top (required)>'
	from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:45:in `require'
	from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:45:in `require'
	from extconf.rb:29:in `<main>'
Comment 3 Vít Ondruch 2013-06-28 04:39:51 EDT
The backtrace suggest that you are not using Fedora's Bundler, but some upstream version of Bundler. Could you please provide output of "$ gem list" and "rpm -q rubygem-bundler" commands? Thanks.
Comment 4 cpg 2013-06-28 04:57:52 EDT
Not sure how you can conclude that from the output above.
Perhaps references to /home/cpg/.gem/... ? -- that is normal when bundling as a user.

All the references I have seen about this message indicate that recompiling ruby is needed for getting the psych YAML parser support.

Are you suggesting that all gems ought to be installed as rpms? That's certainly nearly 100% not feasible for other than toy apps in Rails.

In any case, here is the output you request:

[01:51:22](1)f19:psych-bug$ type -a bundle
bundle is /usr/bin/bundle
[01:51:24](1)f19:psych-bug$ rpm -q rubygem-bundler
rubygem-bundler-1.3.1-1.fc19.noarch
[01:51:32](1)f19:psych-bug$ gem list

*** LOCAL GEMS ***

actionmailer (3.2.13)
actionpack (3.2.13)
activemodel (3.2.13)
activerecord (3.2.13)
activeresource (3.2.13)
activesupport (3.2.13)
arel (3.0.2)
authlogic (3.3.0)
bcrypt-ruby (3.0.1)
bigdecimal (1.2.0)
builder (3.1.4, 3.0.4)
bundler (1.3.1)
capybara (2.1.0)
capybara-screenshot (0.3.6)
coffee-rails (3.2.2)
coffee-script (2.2.0)
coffee-script-source (1.6.2)
daemons (1.1.9)
diff-lcs (1.2.4)
erubis (2.7.0)
eventmachine (1.0.3)
execjs (1.4.0)
factory_girl (4.2.0)
factory_girl_rails (4.2.1)
faye-websocket (0.4.7)
hike (1.2.3, 1.2.2, 1.2.1)
http_parser.rb (0.5.3)
i18n (0.6.1)
io-console (0.4.2)
jbuilder (1.4.1)
journey (1.0.4)
jquery-rails (3.0.1, 2.2.1)
jquery-ui-rails (4.0.2)
json (1.8.0, 1.7.7)
kgio (2.8.0)
libv8 (3.11.8.17 x86_64-linux)
mail (2.5.4, 2.5.3)
mime-types (1.23, 1.19)
minitest (5.0.1)
multi_json (1.7.7, 1.7.3, 1.7.1)
mysql2 (0.3.11)
net-http-persistent (2.8)
nokogiri (1.5.9)
poltergeist (1.3.0)
polyglot (0.3.3)
psych (2.0.0)
quiet_assets (1.0.2)
rack (1.4.5)
rack-cache (1.2)
rack-ssl (1.3.3, 1.3.2)
rack-test (0.6.2)
rails (3.2.13)
railties (3.2.13)
raindrops (0.11.0)
rake (10.1.0, 10.0.4)
rb-readline (0.5.0)
rdoc (4.0.1, 3.12.2)
ref (1.0.5, 1.0.4)
rspec-core (2.13.1)
rspec-expectations (2.13.0)
rspec-mocks (2.13.1)
rspec-rails (2.13.1)
sass (3.2.9)
sass-rails (3.2.6)
slim (1.3.8)
sprockets (2.8.2, 2.2.2)
sqlite3 (1.3.7)
temple (0.6.4)
themes_for_rails (0.5.1)
thor (0.18.1, 0.17.0)
tilt (1.4.1, 1.3.7)
treetop (1.4.14, 1.4.12)
tzinfo (0.3.37, 0.3.35)
uglifier (2.1.1)
xpath (2.0.0)
[01:51:35](1)f19:psych-bug$
Comment 5 Vít Ondruch 2013-06-28 05:41:29 EDT
(In reply to cpg from comment #4)
> Not sure how you can conclude that from the output above.
> Perhaps references to /home/cpg/.gem/... ? -- that is normal when bundling
> as a user.

It is common symptom, that Upstream Bundler cannot pickup binary extensions of gems, since Bundler does not use standar RubyGems require, but their own version.

> All the references I have seen about this message indicate that recompiling
> ruby is needed for getting the psych YAML parser support.

No, "rpm -ql rubygem-psych" will unveil to you, that there is the .so file. You can try 'Psych.load("--- foo")' for example to see, that Psych works.

> Are you suggesting that all gems ought to be installed as rpms? That's
> certainly nearly 100% not feasible for other than toy apps in Rails.

No, definitely not. Only Bundler.
 
> In any case, here is the output you request:

Thanks, it does not confirm my suspicion. So I'll need to dive into Bundler :/
Comment 6 cpg 2013-07-01 04:33:56 EDT
To test out if this was an rpm packaging issue with bundler, I did the following:

- uninstalled rubygem-bundler
- installed bundler with gem as root
- tried to bundle the simple failing app

this failed to bundle with the same error in therubyracer (your ruby installation is missing psych).

Then I tried doing this:

I uninstalled the bundler gem as root and then installed it as a regular user. Same results.

In all cases bundler installed at version 3.1.5.

Does this rule out rubygem-bundler vs. upstream bundler?

I also tried to force uninstall ruby and then re-install it, in the hopes psych would be picked up somehow (as some suggested on various places) but that did not help.

An attempt to recompile the ruby rpm to see if that would help things failed. It does not seem to be possible to compile with a clean f19 rc3 install, unless the spec is missing something needed to make these pass (unlikely from the looks of it -- seems internal test with a gem called "default" which does not really exist publicly). Filed #979761.

Both spec files for ruby and rubygem-bundler require rubygem(psych), so presumably it should have been picked up by ruby (unless some other mechanisms are in place).
Comment 7 Renich Bon Ciric 2013-07-03 01:06:28 EDT
Same error here on Fedora 19 release.

## list of gems installed with dnf
[root@introdesk ~]# dnf list installed rubygem*
Installed Packages
rubygem-bigdecimal.x86_64                     1.2.0-8.fc19               @System
rubygem-bundler.noarch                        1.3.1-1.fc19               @System
rubygem-io-console.x86_64                     0.4.2-8.fc19               @System
rubygem-json.x86_64                           1.7.7-100.fc19             @System
rubygem-net-http-persistent.noarch            2.8-4.fc19                 @System
rubygem-psych.x86_64                          2.0.0-8.fc19               @System
rubygem-rdoc.noarch                           4.0.1-1.fc19               @System
rubygem-thor.noarch                           0.17.0-1.fc19              @System
rubygems.noarch                               2.0.3-1.fc19               @System


## list of gems
[renich@introdesk ~]$ gem list

*** LOCAL GEMS ***

bigdecimal (1.2.0)
builder (3.2.2)
bundler (1.3.1)
chunky_png (1.2.8)
daemons (1.1.9)
eventmachine (1.0.3)
faraday (0.8.7)
haml (4.0.3)
io-console (0.4.2)
json (1.8.0, 1.7.7)
mail (2.5.4)
mime-types (1.23)
mini_portile (0.5.0)
multipart-post (1.2.0)
net-http-persistent (2.8)
polyglot (0.3.3)
psych (2.0.0)
rdoc (4.0.1)
thor (0.17.0)
tilt (1.4.1)
treetop (1.4.14)


## trying to install nokogiri
[renich@introdesk ~]$ gem install nokogiri
Building native extensions.  This could take a while...
ERROR:  Error installing nokogiri:
	ERROR: Failed to build gem native extension.

    /usr/bin/ruby extconf.rb
/usr/share/ruby/yaml.rb:6:in `<top (required)>':
It seems your ruby installation is missing psych (for YAML output).
To eliminate this warning, please install libyaml and reinstall your ruby.
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
	--with-opt-dir
	--without-opt-dir
	--with-opt-include
	--without-opt-include=${opt-dir}/include
	--with-opt-lib
	--without-opt-lib=${opt-dir}/lib64
	--with-make-prog
	--without-make-prog
	--srcdir=.
	--curdir
	--ruby=/usr/bin/ruby
/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:45:in `require': cannot load such file -- psych.so (LoadError)
	from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:45:in `require'
	from /usr/share/gems/gems/psych-2.0.0/lib/psych.rb:1:in `<top (required)>'
	from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:110:in `require'
	from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:110:in `rescue in require'
	from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:35:in `require'
	from /usr/share/ruby/yaml.rb:7:in `<top (required)>'
	from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:45:in `require'
	from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:45:in `require'
	from extconf.rb:93:in `<main>'


Gem files will remain installed in /home/renich/.gem/gems/nokogiri-1.6.0 for inspection.
Results logged to /home/renich/.gem/gems/nokogiri-1.6.0/ext/nokogiri/gem_make.out
Comment 8 Javier Alejandro Castro 2013-07-03 10:39:48 EDT
Just upgraded F18 to F19, and now my gitlab install is not working (this error too).

Any news on fixing it? Or a workaround ?
Comment 9 Javier Alejandro Castro 2013-07-03 12:12:28 EDT
Some how my rubygem-psych rpm was installed (rpm -q rubygem-psych reports it as installed) but looking at the directory, files where not there)

I did:

 rpm -e --nodeps rubygem-psych && yum install rubygem-psych -y

Later on my rails app, i've edited its Gemfile to add:

gem "psych"

Not all is working again.
Comment 10 Johnny Robeson 2013-07-04 02:14:36 EDT
i saw this when i tried the instructions on
Comment 11 Vít Ondruch 2013-07-04 05:55:57 EDT
Ok, so this is RubyGems issue. Following lines are the root cause:

http://pkgs.fedoraproject.org/cgit/ruby.git/tree/operating_system.rb#n31
https://github.com/rubygems/rubygems/blob/master/lib/rubygems/ext/ext_conf_builder.rb#L18-L26

I.e. RubyGems during configuration of extension build redefines sitelibdir and sitearchdir, which later causes, that the path to the gem is not evaluated correctly and therefore the psych.so is not found and Psych gem is not loaded.

Need to think about suitable solution. This line is there for JRuby support if I am not mistaken, so may be we should detect JRuby differently.
Comment 12 Renich Bon Ciric 2013-07-04 06:31:34 EDT
Just obsolete JRuby and remove the line; who needs it anyway? It's Java, right? ;)
Comment 13 cpg 2013-07-04 17:44:24 EDT
A workaround for this is to do this:

export RUBYOPT="-I/usr/lib64/gems/ruby/psych-2.0.0/lib -I/usr/share/gems/gems/psych-2.0.0/lib"

before starting ruby.

Not sure yet where is the right place to add to the LOAD_PATH in a Rails app. If you know, we will all appreciate the tip.
Comment 14 cpg 2013-07-05 00:15:45 EDT
adding this at the top of config/application.rb seems to make things work:

$LOAD_PATH << '/usr/lib64/gems/ruby/psych-2.0.0/lib' << '/usr/share/gems/gems/psych-2.0.0/lib'
Comment 15 Vít Ondruch 2013-07-05 13:39:11 EDT
You might want to try this build: http://koji.fedoraproject.org/koji/buildinfo?buildID=431455

The rubygems package should be enough.
Comment 16 Renich Bon Ciric 2013-07-06 05:04:33 EDT
(In reply to Vít Ondruch from comment #15)
> You might want to try this build:
> http://koji.fedoraproject.org/koji/buildinfo?buildID=431455
> 
> The rubygems package should be enough.

After a:

    yum localinstall http://kojipkgs.fedoraproject.org//packages/ruby/2.0.0.247/12.fc19/noarch/rubygems-2.0.3-12.fc19.noarch.rpm

I did a:

    bundle install

And it worked; it built everything without problems. Tried using thin but it seems not to be in the path. On Fedora 18, it got installed in ~/bin.
Comment 17 Renich Bon Ciric 2013-07-06 05:06:42 EDT
(In reply to Renich Bon Ciric from comment #16)
> Tried using thin but it
> seems not to be in the path. On Fedora 18, it got installed in ~/bin.

Ah, found it; it's under ~/.gem/bin

Still, not in $PATH...
Comment 18 cpg 2013-07-07 15:51:34 EDT
This does _not_ appear to work for me in general.

Case 1) running bundle on the app (in the development environment) works ok, so at least that part was fixed.

Case 2) an app already in place and failing does not become operational after the update to this app and restarting the app (which is running with apache and passenger). Also, restarting the whole machine does not help.

Case 3) running bundle install --without test --path vendor/bundle --binstubs bin/ --deployment does not appear to work with this fix in place.

I do wonder what could be causing this update to not work in case 2. Perhaps something like mod_passenger needs recompiling with a fixed rubygems installed, because it (or them) somehow had acquired the load paths at compilation time?
Comment 19 Renich Bon Ciric 2013-07-07 16:29:36 EDT
(In reply to cpg from comment #18)
> This does _not_ appear to work for me in general.
> 
> Case 1) running bundle on the app (in the development environment) works ok,
> so at least that part was fixed.
> 
> Case 2) an app already in place and failing does not become operational
> after the update to this app and restarting the app (which is running with
> apache and passenger). Also, restarting the whole machine does not help.
> 
> Case 3) running bundle install --without test --path vendor/bundle
> --binstubs bin/ --deployment does not appear to work with this fix in place.

In this case, it works if you include psych in the Gemfile
Comment 20 cpg 2013-07-07 18:28:51 EDT
@Renich Great tip! This provides a good workaround for an app that we have in production. It still should not be necessary, but it's easier than having to do other more obscure things!
Comment 21 Vít Ondruch 2013-07-08 03:00:03 EDT
(In reply to Renich Bon Ciric from comment #16)
> And it worked; it built everything without problems.

Glad it helps.

> Tried using thin but it seems not to be in the path. On Fedora 18,
> it got installed in ~/bin.

Please do not mix several issues into one. Open new ticket if you have some different problems. Thanks.
Comment 22 Renich Bon Ciric 2013-07-08 04:34:28 EDT
(In reply to Vít Ondruch from comment #21)
> (In reply to Renich Bon Ciric from comment #16)
> > And it worked; it built everything without problems.
> 
> Glad it helps.

Actually, it partially works. A new padrino app would work only after adding 'psych' to the gemfile.

But, when trying to generate a controller:

[renich@introdesk default]$ padrino g controller about
/usr/share/gems/gems/psych-2.0.0/lib/psych.rb:299:in `initialize': No such file or directory - /srv/www/padrino/evalinux.com/default/.components (Errno::ENOENT)
	from /usr/share/gems/gems/psych-2.0.0/lib/psych.rb:299:in `open'
	from /usr/share/gems/gems/psych-2.0.0/lib/psych.rb:299:in `load_file'
	from /home/renich/.gem/ruby/gems/padrino-gen-0.11.2/lib/padrino-gen/generators/actions.rb:120:in `retrieve_component_config'
	from /home/renich/.gem/ruby/gems/padrino-gen-0.11.2/lib/padrino-gen/generators/actions.rb:83:in `fetch_component_choice'
	from /home/renich/.gem/ruby/gems/padrino-gen-0.11.2/lib/padrino-gen/generators/actions.rb:243:in `fetch_project_name'
	from /home/renich/.gem/ruby/gems/padrino-gen-0.11.2/lib/padrino-gen/generators/controller.rb:45:in `create_controller'
	from /usr/share/gems/gems/thor-0.17.0/lib/thor/task.rb:27:in `run'
	from /usr/share/gems/gems/thor-0.17.0/lib/thor/invocation.rb:120:in `invoke_task'
	from /usr/share/gems/gems/thor-0.17.0/lib/thor/invocation.rb:126:in `block in invoke_all'
	from /usr/share/gems/gems/thor-0.17.0/lib/thor/invocation.rb:126:in `each'
	from /usr/share/gems/gems/thor-0.17.0/lib/thor/invocation.rb:126:in `map'
	from /usr/share/gems/gems/thor-0.17.0/lib/thor/invocation.rb:126:in `invoke_all'
	from /usr/share/gems/gems/thor-0.17.0/lib/thor/group.rb:238:in `dispatch'
	from /usr/share/gems/gems/thor-0.17.0/lib/thor/base.rb:434:in `start'
	from /home/renich/.gem/ruby/gems/padrino-gen-0.11.2/lib/padrino-gen/generators/cli.rb:51:in `setup'
	from /usr/share/gems/gems/thor-0.17.0/lib/thor/task.rb:27:in `run'
	from /usr/share/gems/gems/thor-0.17.0/lib/thor/invocation.rb:120:in `invoke_task'
	from /usr/share/gems/gems/thor-0.17.0/lib/thor/invocation.rb:126:in `block in invoke_all'
	from /usr/share/gems/gems/thor-0.17.0/lib/thor/invocation.rb:126:in `each'
	from /usr/share/gems/gems/thor-0.17.0/lib/thor/invocation.rb:126:in `map'
	from /usr/share/gems/gems/thor-0.17.0/lib/thor/invocation.rb:126:in `invoke_all'
	from /usr/share/gems/gems/thor-0.17.0/lib/thor/group.rb:238:in `dispatch'
	from /usr/share/gems/gems/thor-0.17.0/lib/thor/base.rb:434:in `start'
	from /home/renich/.gem/ruby/gems/padrino-gen-0.11.2/bin/padrino-gen:16:in `<main>'


> > Tried using thin but it seems not to be in the path. On Fedora 18,
> > it got installed in ~/bin.
> 
> Please do not mix several issues into one. Open new ticket if you have some
> different problems. Thanks.

Yes; I thought this was related to the change you made in rubygem. Before, gems where installed in ~/bin not in ~/.gem/bin/
Comment 23 Vít Ondruch 2013-07-09 06:50:54 EDT
(In reply to Renich Bon Ciric from comment #22)
> But, when trying to generate a controller:
> 
> [renich@introdesk default]$ padrino g controller about
> /usr/share/gems/gems/psych-2.0.0/lib/psych.rb:299:in `initialize': No such
> file or directory - /srv/www/padrino/evalinux.com/default/.components


Sorry, I am not familiar with Padrino neither I can see anything related to this bug. It says "No such file or directory - /srv/www/padrino/evalinux.com/default/.components" so may be you should check that file.

> > > Tried using thin but it seems not to be in the path. On Fedora 18,
> > > it got installed in ~/bin.
> > 
> > Please do not mix several issues into one. Open new ticket if you have some
> > different problems. Thanks.
> 
> Yes; I thought this was related to the change you made in rubygem. Before,
> gems where installed in ~/bin not in ~/.gem/bin/

Could you please specify "before"? Are you referring to older Fedora or different version of RubyGems? Anyway, I can't reproduce:

$ rpm -q rubygems
rubygems-2.0.3-12.fc20.noarch

$ gem install teamocil
Fetching: teamocil-0.4.4.gem (100%)
Successfully installed teamocil-0.4.4
Parsing documentation for teamocil-0.4.4
Installing ri documentation for teamocil-0.4.4
Done installing documentation for teamocil after 0 seconds
1 gem installed

$ ls bin/
teamocil

$ teamocil 
[teamocil] There is no file "/home/vondruch/.teamocil/.yml"

If you believer there is a bug, please open new ticket for that issue.
Comment 24 Fedora Update System 2013-07-09 07:04:00 EDT
ruby-2.0.0.247-12.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/ruby-2.0.0.247-12.fc19
Comment 25 Renich Bon Ciric 2013-07-09 11:28:06 EDT
(In reply to Vít Ondruch from comment #23)
> (In reply to Renich Bon Ciric from comment #22)
> > But, when trying to generate a controller:
> > 
> > [renich@introdesk default]$ padrino g controller about
> > /usr/share/gems/gems/psych-2.0.0/lib/psych.rb:299:in `initialize': No such
> > file or directory - /srv/www/padrino/evalinux.com/default/.components
> 
> 
> Sorry, I am not familiar with Padrino neither I can see anything related to
> this bug. It says "No such file or directory -
> /srv/www/padrino/evalinux.com/default/.components" so may be you should
> check that file.

You're right; my bad...

> > > > Tried using thin but it seems not to be in the path. On Fedora 18,
> > > > it got installed in ~/bin.
> > > 
> > > Please do not mix several issues into one. Open new ticket if you have some
> > > different problems. Thanks.
> > 
> > Yes; I thought this was related to the change you made in rubygem. Before,
> > gems where installed in ~/bin not in ~/.gem/bin/
> 
> Could you please specify "before"? Are you referring to older Fedora or
> different version of RubyGems? Anyway, I can't reproduce:
> 
> $ rpm -q rubygems
> rubygems-2.0.3-12.fc20.noarch
> 
> $ gem install teamocil
> Fetching: teamocil-0.4.4.gem (100%)
> Successfully installed teamocil-0.4.4
> Parsing documentation for teamocil-0.4.4
> Installing ri documentation for teamocil-0.4.4
> Done installing documentation for teamocil after 0 seconds
> 1 gem installed
> 
> $ ls bin/
> teamocil
> 
> $ teamocil 
> [teamocil] There is no file "/home/vondruch/.teamocil/.yml"
> 
> If you believer there is a bug, please open new ticket for that issue.

I meant Fedora 18. This is really strange. I'll delete everything and reinstall.
Comment 26 Fedora Update System 2013-07-09 21:25:09 EDT
Package ruby-2.0.0.247-12.fc19:
* should fix your issue,
* was pushed to the Fedora 19 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing ruby-2.0.0.247-12.fc19'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-12663/ruby-2.0.0.247-12.fc19
then log in and leave karma (feedback).
Comment 27 cpg 2013-07-09 23:34:36 EDT
Good work. However, after updating ruby as described by <updates>, the exception goes away with the described example, but this does not fix the case when an app is packaged for deployment.

So the new test case showing the error is this:

1) rails new psych-bug --skip-bundle
2) cd psych-bug
3) echo "gem 'therubyracer'" >> Gemfile
4) bundle install --without test --path vendor/bundle --binstubs bin/ --deployment

the same exception as in the original description ("your ruby installation is missing psych") is raised.
Comment 28 Mamoru TASAKA 2013-07-12 03:41:50 EDT
So as is done on the case of io-console and bigdecimal, "cp" ing psych into standard directory is perhaps a realistic solution. Current ruby / rubygems spec file contails lots of patches, lots of Fedora specific configuration, and making another Fedora specific patch is not desirable.
Comment 29 Vít Ondruch 2013-07-12 06:10:08 EDT
(In reply to Mamoru TASAKA from comment #28)
> So as is done on the case of io-console and bigdecimal, "cp" ing psych into
> standard directory is perhaps a realistic solution.

You are right. I am considering this option. However, first I'd like to understand the root cause. Seems to be a little fishy.
Comment 30 Vít Ondruch 2013-07-12 12:09:40 EDT
I did -13 build. Please give it some testing. It should fix the remaining issues.

https://admin.fedoraproject.org/updates/FEDORA-2013-12663/
Comment 31 cpg 2013-07-12 17:02:22 EDT
I still see an error.

I updated to the -13 build, though i had to 

    $ sudo rpm -e --nodeps rubygem-json rubygem-rdoc

because I had rubygem-json-1.7.7-100.fc19.x86_64 (i am guessing from the testing repo update from earlier in this bug):

 	package rubygem-json-1.7.7-100.fc19.x86_64 (which is newer than rubygem-json-1.7.7-13.fc19.x86_64) is already installed

then i updated to the -13 packages ... and then tried to build my app in deployment mode, and the following error occurs:

...
bundle install --without test --path vendor/bundle --binstubs bin/ --deployment
Fetching gem metadata from https://rubygems.org/........
Fetching gem metadata from https://rubygems.org/..
      Unfortunately, a fatal error has occurred. Please see the Bundler
      troubleshooting documentation at http://bit.ly/bundler-issues. Thanks!
/usr/share/rubygems/rubygems/config_file.rb:318:in `load_file': private method `load' called for Psych:Module (NoMethodError)
	from /usr/share/rubygems/rubygems/config_file.rb:191:in `initialize'
	from /usr/share/rubygems/rubygems.rb:319:in `new'
	from /usr/share/rubygems/rubygems.rb:319:in `configuration'
Comment 32 Renich Bon Ciric 2013-07-12 20:09:41 EDT
(In reply to Vít Ondruch from comment #30)
> I did -13 build. Please give it some testing. It should fix the remaining
> issues.
> 
> https://admin.fedoraproject.org/updates/FEDORA-2013-12663/

$ gem install padrino
Fetching: tilt-1.3.7.gem (100%)
ERROR:  While executing gem ... (NoMethodError)
    private method `load' called for Psych:Module
Comment 33 Fedora Update System 2013-07-13 23:27:37 EDT
Package ruby-2.0.0.247-13.fc19:
* should fix your issue,
* was pushed to the Fedora 19 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing ruby-2.0.0.247-13.fc19'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-12663/ruby-2.0.0.247-13.fc19
then log in and leave karma (feedback).
Comment 34 Vít Ondruch 2013-07-15 04:52:54 EDT
Sorry guys, I have missed to add one of those links into rubygem-psych subpackage. -14 should fix this issue.
Comment 35 bugs 2013-07-15 05:50:57 EDT
(In reply to Vít Ondruch from comment #34)
> Sorry guys, I have missed to add one of those links into rubygem-psych
> subpackage. -14 should fix this issue.

Thank you. -14 works for me. `bundle install` no longer fails because of psych.
Comment 36 cpg 2013-07-15 07:19:22 EDT
Thanks. Works for me, including in the deployment case.

Note however, the discrepancy in versions in rubygem-json ...

I already had -100 in my systems ... rubygem-json-1.7.7-100.fc19

So this will have to be fixed to be picked up by machines updating, once it reaches the update repos, I imagine?
Comment 37 Vít Ondruch 2013-07-15 08:35:01 EDT
(In reply to cpg from comment #36)
> Note however, the discrepancy in versions in rubygem-json ...
> 
> I already had -100 in my systems ... rubygem-json-1.7.7-100.fc19
> 
> So this will have to be fixed to be picked up by machines updating, once it
> reaches the update repos, I imagine?

That is correct. rubygem-json is independent package [1], which might update the rubygem-json subpackage shipped with Ruby. The same apply to rubygems, rubygem-rdoc, rubygem-rake, etc.


[1] https://admin.fedoraproject.org/pkgdb/acls/name/rubygem-json
Comment 38 Renich Bon Ciric 2013-07-15 16:07:05 EDT
Gem installations went smoothly.

When I started the app, I saw this:

[renich@introdesk default]$ thin start
>> Using rack adapter
/usr/share/gems/gems/psych-2.0.0/lib/psych.rb:98: warning: already initialized constant Psych::VERSION
/usr/share/ruby/psych.rb:98: warning: previous definition of VERSION was here
/usr/share/gems/gems/psych-2.0.0/lib/psych.rb:101: warning: already initialized constant Psych::LIBYAML_VERSION
/usr/share/ruby/psych.rb:101: warning: previous definition of LIBYAML_VERSION was here

But this should be another bug, huh?
Comment 39 Fedora Update System 2013-07-15 21:35:16 EDT
ruby-2.0.0.247-14.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 40 Vít Ondruch 2013-07-16 01:37:00 EDT
(In reply to Renich Bon Ciric from comment #38)
> But this should be another bug, huh?

Definitely and if you can provide some minimal reproducer, it would be even better.
Comment 41 Matt Rose 2013-07-18 13:10:14 EDT
I just hit this bug in fedora 19, using, I think, a very simple case:

Here's what happened:

[mattrose@oscar soap4r-noeticpenguin]$ gem install soap4r-ruby1.9-2.0.5.gem 
/usr/lib64/ruby/psych.so: warning: already initialized constant Psych::Parser::ANY
/usr/lib64/ruby/psych.so: warning: already initialized constant Psych::Parser::UTF8
/usr/lib64/ruby/psych.so: warning: already initialized constant Psych::Parser::UTF16LE
/usr/lib64/ruby/psych.so: warning: already initialized constant Psych::Parser::UTF16BE
/usr/share/ruby/yaml.rb:4:in `<top (required)>':
It seems your ruby installation is missing psych (for YAML output).
To eliminate this warning, please install libyaml and reinstall your ruby.
/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:45:in `require': cannot load such file -- psych/syntax_error (LoadError)
	from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:45:in `require'
	from /usr/share/ruby/psych.rb:1:in `<top (required)>'
	from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:45:in `require'
	from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:45:in `require'
	from /usr/share/ruby/yaml.rb:5:in `<top (required)>'
	from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:45:in `require'
	from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:45:in `require'
	from /usr/share/rubygems/rubygems.rb:595:in `load_yaml'
	from /usr/share/rubygems/rubygems/config_file.rb:313:in `load_file'
	from /usr/share/rubygems/rubygems/config_file.rb:190:in `initialize'
	from /usr/share/rubygems/rubygems/gem_runner.rb:66:in `new'
	from /usr/share/rubygems/rubygems/gem_runner.rb:66:in `do_configuration'
	from /usr/share/rubygems/rubygems/gem_runner.rb:46:in `run'
	from /usr/bin/gem:21:in `<main>'
[mattrose@oscar soap4r-noeticpenguin]$ export RUBYOPT="-I/usr/lib64/gems/ruby/psych-2.0.0/lib -I/usr/share/gems/gems/psych-2.0.0/lib"
[mattrose@oscar soap4r-noeticpenguin]$ gem install soap4r-ruby1.9-2.0.5.gem 
Successfully installed soap4r-ruby1.9-2.0.5
Parsing documentation for soap4r-ruby1.9-2.0.5
Installing ri documentation for soap4r-ruby1.9-2.0.5
Done installing documentation for soap4r-ruby1.9 after 7 seconds
1 gem installed

and this is just using 

[mattrose@oscar soap4r-noeticpenguin]$ which gem
/usr/bin/gem
[mattrose@oscar soap4r-noeticpenguin]$ rpm -qf /usr/bin/gem
rubygems-2.0.3-14.fc19.noarch

So there is definitely still something wrong.

If you want the source for the gem, it's available at:

https://github.com/mattrose/soap4r-noeticpenguin
Comment 42 David Busby 2013-07-21 07:54:56 EDT
-14 build exhibits the same issues namely due to rubygem-psych issues:

---
Error unpacking rpm package rubygem-psych-2.0.0-14.fc19.x86_64
error: unpacking of archive failed on file /usr/share/ruby/psych: cpio: rename
  Installing : rubygem-io-console-0.4.2-14.fc19.x86_64                                                                                            2/9 
error: rubygem-psych-2.0.0-14.fc19.x86_64: install failed

---
Comment 43 Vít Ondruch 2013-07-22 06:09:44 EDT
(In reply to David Busby from comment #42)
David, could you please report your issue separately? It seems it is just remotely related to the original issue.

Also, could you please provide full report, not just snippet? It would be helpful to reproduce your issue. Now I can just wild guessing what was the state of your system prior you got the error.

Thanks.
Comment 44 Alain Thiaville 2013-07-25 13:44:21 EDT
(In reply to David Busby from comment #42)
> -14 build exhibits the same issues namely due to rubygem-psych issues:
> 
> ---
> Error unpacking rpm package rubygem-psych-2.0.0-14.fc19.x86_64
> error: unpacking of archive failed on file /usr/share/ruby/psych: cpio:
> rename
>   Installing : rubygem-io-console-0.4.2-14.fc19.x86_64                      
> 2/9 
> error: rubygem-psych-2.0.0-14.fc19.x86_64: install failed
> 
> ---

hello i got the same error after upgrading from fc18 and opened a bug : https://bugzilla.redhat.com/show_bug.cgi?id=988490. The workaround I found is to
remove all "spurious file" in /usr/share/ruby/psych* . (Don't forget the double
quote to suppress bash interpretation of ";" in file names) and to "rmdir" /usr/share/ruby/psych . After that "sudo yum  install rubygem-psych" should be ok.
Comment 45 Robin Powell 2013-07-29 16:46:21 EDT
Alain's solution worked for me:

sudo rm -rf /usr/share/ruby/psych*
sudo yum install rubygem-psych

and everything is better again.
Comment 46 Robin Powell 2013-07-29 16:47:07 EDT
This was right after an F19 upgrade, so it really *is* a Fedora problem; if there's a different bug opened for this, let me know and I'll post there.
Comment 47 Vít Ondruch 2013-07-30 08:06:56 EDT
(In reply to Robin Powell from comment #46)
> if there's a different bug opened for this, let me know and I'll post there.

Alain created bug 988490

Note You need to log in before you can comment on or make changes to this bug.