Bugs item #27587, was opened at 2009-12-17 17:09
You can respond by visiting:
http://rubyforge.org/tracker/?func=detail&atid=575&aid=27587&group_id=126
Category: #gem and #require methods
Group: v1.3.x
Status: Open
Resolution: None
Priority: 3
Submitted By: Riley Lynch (rlynch)
Assigned to: Nobody (None)
Summary: #gem fatals on getpwuid for daemons
Initial Comment:
After upgrading from RubyGems 0.9.2 to 1.3.1, a monit script which runs mongrel
processes was failing to exec. I captured the stderr, and found this trace:
/usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:723:in `getpwuid': can't find
user for 1000 (ArgumentError)
from /usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:723:in `set_paths'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:719:in `each'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:719:in `set_paths'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:526:in `path'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:66:in
`installed_spec_directories'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:56:in
`from_installed_gems'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:736:in `source_index'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:140:in `activate'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:49:in `gem'
from /usr/local/bin/mongrel_rails:15
I found reports of similar problems when running daemons via Cruise Control or
Capistrano but did not see a solution posted.
http://old.nabble.com/Etc.getpwuid-error-in-rake-gems-td22130762.html
http://groups.google.com/group/capistrano/browse_thread/thread/b62989776d395c0a?pli=1
I was able to resolve the problem by adding a line for the daemon user to
/etc/passwd via vipw. However, it seems to me that RubyGems ought not to fail
under this condition. May I suggest wrapping the call to getpwuid in a block
which rescues in the case that getpwuid raises ArgumentError ?
----------------------------------------------------------------------
You can respond by visiting:
http://rubyforge.org/tracker/?func=detail&atid=575&aid=27587&group_id=126
_______________________________________________
Rubygems-developers mailing list
http://rubyforge.org/projects/rubygems
[email protected]
http://rubyforge.org/mailman/listinfo/rubygems-developers