I''m hosting my site with Dreamhost, and I need to install some rubygems, but I have to install them locally rather than globally. If I install the gems into ~/.gems, how do I get Ruby to find them there? Do I need to install my own Ruby, or is it just a matter of setting an environment variable? Thanks, Bryce
Bryce- You ought to be able to just define it by doing something like this: $: << "#{ENV[''HOME'']}/.gems" in your config/environment.rb. You could, also, just save yourself the trouble and drop them in the vendor/ directory under your Rails application -- that''s what it''s intended for. Cheers, Ben On 7/27/05, bryce benton <brycebenton-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I''m hosting my site with Dreamhost, and I need to install some > rubygems, but I have to install them locally rather than globally. > > If I install the gems into ~/.gems, how do I get Ruby to find them > there? Do I need to install my own Ruby, or is it just a matter of > setting an environment variable? > > Thanks, > Bryce > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Both Ben and my webhost said that using gems installed in my home dir is simply a matter of installing them, and adding a line to the environment.rb file. I''ve tried setting the line in the environment.rb file (along with expanding out the variable to hard code the home dir), and I''ve tried installing the gem into the venodr dir with the command: gem install shipping -i vendor and I''ve tried installing the gem into my_webhost_home_dir/.gems as well as my_application_home_dir/.gems ...but I still can not get rails to find my gem. Each time, the gem was successfully installed, but how do I get rails to find it? It *does* work in my dev environment on my powerbook, but it does not work in my webhost environment. The gems dir permissions are rwxrwxr-x . I tried changing the controller line to require ''~/.gems/shipping'' but this gives this error: couldn''t find HOME environment -- expanding `~/.gems/shipping'' What am I missing here? --bryce p.s. I''m trying to do this on Dreamhost. Anybody here had any success with locally installed gems? On 7/27/05, Ben Schumacher <benschumacher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Bryce- > > You ought to be able to just define it by doing something like this: > > $: << "#{ENV[''HOME'']}/.gems" > > in your config/environment.rb. > > You could, also, just save yourself the trouble and drop them in the > vendor/ directory under your Rails application -- that''s what it''s > intended for. > > Cheers, > > Ben > > On 7/27/05, bryce benton <brycebenton-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > I''m hosting my site with Dreamhost, and I need to install some > > rubygems, but I have to install them locally rather than globally. > > > > If I install the gems into ~/.gems, how do I get Ruby to find them > > there? Do I need to install my own Ruby, or is it just a matter of > > setting an environment variable? > > > > Thanks, > > Bryce > > _______________________________________________ > > Rails mailing list > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > >
As a vaguely-related aside, is it possible to use Gems to install in a two-step process, i.e. download the Gem file in one step and install it in another? I''m working on an automated build environment, and I''d like to get the files to a local dir, then install them in a separate step. Is this possible? Cheers, Colin On 31/07/05, bryce benton <brycebenton-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Both Ben and my webhost said that using gems installed in my home dir > is simply a matter of installing them, and adding a line to the > environment.rb file. > > I''ve tried setting the line in the environment.rb file (along with > expanding out the variable to hard code the home dir), and I''ve tried > installing the gem into the venodr dir with the command: > > gem install shipping -i vendor > > and I''ve tried installing the gem into > my_webhost_home_dir/.gems > > as well as > my_application_home_dir/.gems > > ...but I still can not get rails to find my gem. Each time, the gem > was successfully installed, but how do I get rails to find it? > > It *does* work in my dev environment on my powerbook, but it does not > work in my webhost environment. The gems dir permissions are rwxrwxr-x > . > > I tried changing the controller line to > require ''~/.gems/shipping'' > > but this gives this error: > couldn''t find HOME environment -- expanding `~/.gems/shipping'' > > What am I missing here? > > --bryce > > p.s. I''m trying to do this on Dreamhost. Anybody here had any success > with locally installed gems? > > > On 7/27/05, Ben Schumacher <benschumacher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Bryce- > > > > You ought to be able to just define it by doing something like this: > > > > $: << "#{ENV[''HOME'']}/.gems" > > > > in your config/environment.rb. > > > > You could, also, just save yourself the trouble and drop them in the > > vendor/ directory under your Rails application -- that''s what it''s > > intended for. > > > > Cheers, > > > > Ben > > > > On 7/27/05, bryce benton <brycebenton-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > I''m hosting my site with Dreamhost, and I need to install some > > > rubygems, but I have to install them locally rather than globally. > > > > > > If I install the gems into ~/.gems, how do I get Ruby to find them > > > there? Do I need to install my own Ruby, or is it just a matter of > > > setting an environment variable? > > > > > > Thanks, > > > Bryce > > > _______________________________________________ > > > Rails mailing list > > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
bryce benton
2005-Aug-01 18:09 UTC
solution: private-ruby. was: custom rubygems directory ?
>Do I need to install my own Ruby...Ultimately, this proved to be the method that worked. Fortunately, Tobias made a script that made installing ruby, rails, rubygems, etc. a breeze. Here''s the command: curl http://home.leetsoft.com/dropbox/private-ruby/install | sh All dreamhost-hosted Rails people should run not walk to this script. Thanks, Tobias! --bryce