From: Gordon Pedersen Date: 2008-02-02T09:13:18+09:00 Subject: Re: Cannot run any gem as non-root user - freebsd 6.2 Good hunch - it was incorrect values in the setting of "prefix" value in rbconfig.rb - details below. Now things work!! Thanks. Rick Denatale wrote: > On Feb 1, 2008 5:37 PM, Gordon Pedersen wrote: >> # gem update --system >> >> But _as ordinary user_ I cannot run any gem at all. Here is what I see >> when I try to run the above 'cheat' gem (exact same thing happens if I >> run 'rake'): >> >> >> $ cheat >> /usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:350:in `insert': no >> implicit conversion from nil to integer (TypeError) > > Looking at the code in rubygems.rb it looks like sitelibdir is nil. > > Just above that it got set > > sitelibdir = ConfigMap[:sitelibdir] > Smells like that's on the right track. sitelibdir (and others from ConfigMap) appear to have nonsensical values; viz, the string "/i/client/ubh/proj/work" probably ought to be "/usr/local". Ah, now I see. For unknown reason, in distant past, I was setting PREFIX to the "/i/client/ubh/proj/work" value in my .profile file. This got used by rbconfig.rb instead of the default value of "/usr/local". Once I unset this, the errant directory paths below became "/usr/local". And now 'rake' and 'cheat' work perfectly fine! Display of ConfigMap from rubygems.rb line 350: :RUBY_SO_NAME : ruby18 :sitedir : /i/client/ubh/proj/work/lib/ruby/site_ruby :arch : i386-freebsd6 :sitelibdir : /i/client/ubh/proj/work/lib/ruby/site_ruby/1.8 :BASERUBY : :bindir : /i/client/ubh/proj/work/bin :libdir : /i/client/ubh/proj/work/lib :EXEEXT : :ruby_install_name : ruby18 :RUBY_INSTALL_NAME : ruby18 :ruby_version : 1.8 > My guess is that, since you do seem to be able to run this as root > that the permisions are screwed up on rbconfig.rb Seems not to be the case: -rw-r--r-- 1 root wheel 7063 Jan 25 09:22 /usr/local/lib/ruby/1.8/i386-freebsd6/rbconfig.rb -- Posted via http://www.ruby-forum.com/.