From: Kelly Dwight Felkins Date: 2005-12-10T03:03:33+09:00 Subject: Re: home of the gems? ------=_Part_8764_20015043.1134151405678 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Thanks for getting back to me Jim. Please bear with me as I try to understand how this works. If I do "gem env" I get a stack trace: kfelkins@lurch:~/bin$ gem env /usr/local/lib/site_ruby/1.8/rubygems.rb:194:in `report_activate_error': Could not find RubyGem sources (> 0.0.0) (Gem::LoadError) from /usr/local/lib/site_ruby/1.8/rubygems.rb:136:in `activate' from /usr/local/lib/site_ruby/1.8/rubygems.rb:37:in `require_gem_with_options' from /usr/local/lib/site_ruby/1.8/rubygems.rb:31:in `require_gem' from /usr/local/lib/site_ruby/1.8/rubygems/remote_installer.rb:403:in `sources' from /usr/local/lib/site_ruby/1.8/rubygems/gem_commands.rb:897:in `execute' from /usr/local/lib/site_ruby/1.8/rubygems/command.rb:49:in `invoke' from /usr/local/lib/site_ruby/1.8/rubygems/cmd_manager.rb:92:in `process_args' from /usr/local/lib/site_ruby/1.8/rubygems/cmd_manager.rb:65:in `run' from /usr/local/lib/site_ruby/1.8/rubygems/gem_runner.rb:9:in `run' from /home/kfelkins/bin/gem:17 kfelkins@lurch:~/bin$ Still, my rails app will run when I start it with script/server. So clearly there are a set of gems installed somewhere. These were likely installed via the debian package management system. So how are gems found? kfelkins@lurch:~/bin$ echo $GEM_HOME /home/kfelkins/gem-repository kfelkins@lurch:~/bin$ ls -l $GEM_HOME total 16 drwxrwxr-x 2 kfelkins genome 4096 2005-12-08 17:15 cache drwxrwxr-x 2 kfelkins genome 4096 2005-12-08 17:15 doc drwxrwxr-x 2 kfelkins genome 4096 2005-12-08 17:15 gems drwxrwxr-x 2 kfelkins genome 4096 2005-12-08 17:15 specifications kfelkins@lurch:~/bin$ cd $GEM_HOME/gems kfelkins@lurch:~/gem-repository/gems$ ls kfelkins@lurch:~/gem-repository/gems$ echo $GEM_PATH kfelkins@lurch:~/gem-repository/gems$ Thanks again. -Kelly On 12/8/05, Jim Weirich wrote: > > railsinator wrote: > > I'm trying to understand how gems are loaded. Please help. > > > > A little background: > > > > I decided to do some rails development work on a debian system. I didn'= t > > think rails was up to date, so I tried to do a 'gem update rails'. This > > failed because I did not have root access. So I installed the gems > > locally. > > Everthing seemed fine. > > > > I later deleted the local gem directory. Now: > > > > - "gem list" says there are no gems. > > - "gemwhich rails" says "can't find rails. > > - The application runs fine. > > > > By now it is clear to me that there are gems installed in the default > > location. I would like to override this with a local install. I don't > > understand how the load path is determined. > > > > Thanks for your help. > > 'gem env' will give you some information about your gem environment. > You can control the details here via environment variables: > > GEM_HOME -- Path to gem repository where gems are installed by > default. > GEM_PATH -- List of paths of gem repositories to be searched. > > -- Jim Weirich > > > -- > Posted via http://www.ruby-forum.com/. > > ------=_Part_8764_20015043.1134151405678--