From: Gordon Pedersen Date: 2008-02-02T07:37:39+09:00 Subject: Cannot run any gem as non-root user - freebsd 6.2 On my freeBSD 6.2 laptop I recently installed ruby 1.8.6 and ruby gems from ports. Then (as root) used 'gem' to update itself and to install rails. All of this proceeded without error - although it took so long I'd hate to have to repeat it. # cd /usr/ports/lang/ruby18 # make install # cd /usr/ports/devel/ruby-gems # make install # gem update --system # gem install cheat # gem install rails (full list of installed gems near bottom) Now _as root_ I can run any gem I please simply by issuing # cheat # to run the 'cheat' gem 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) from /usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:350:in `activate' from /usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:65:in `active_gem_with_options' from /usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:50:in `gem' from /usr/local/bin/cheat:18 The same basic pattern holds true for any gem. It happens when I run 'rails'. It happens when in a rails project I try to run something like 'rake db:migrate' even though every single file in my project is owned by that user. Any ideas? I scoured the web and ended up empty-handed. I'm too new to ruby for you to trust my speculations, but I wonder if it is a permissions or some other installation issue relating to the 'gem' app itself. Just would not know where to look. Here are a couple of gem admin commands issued by ordinary user:
/tmp $ gem check # no output so I assume okay /tmp $ gem environment ERROR: While executing gem ... (TypeError) no implicit conversion from nil to integer /tmp $ gem list -l *** LOCAL GEMS *** actionmailer (2.0.2) actionpack (2.0.2) activerecord (2.0.2) activeresource (2.0.2) activesupport (2.0.2) cheat (1.2.1) rails (2.0.2) rake (0.8.1) ruby-debug (0.10.0) ruby-debug-base (0.10.0) rubygems-update (1.0.1) sources (0.0.2) sqlite3-ruby (1.2.1) /tmp $ gem which cheat (checking gem cheat-1.2.1 for cheat) /usr/local/lib/ruby/gems/1.8/gems/cheat-1.2.1/lib/cheat.rb
-- Posted via http://www.ruby-forum.com/.