On Mon, Oct 26, 2009 at 2:29 AM, nic <nick.col...@gmail.com> wrote:

>
> I'm trying to use a rails app that uses a newer version of RubyGems
> than my host provides. Since I don't have root access, I decided to
> try to install my own version of gems in my home directory. I did so
> by downloading the package and running the install using "ruby
> setup.rb --prefix=$HOME/gem". Then I added "$HOME/gem/bin" to my $PATH
> and "$HOME/gem/lib" (the location of my new rubygems.rb) to $RUBYLIB.
>
> Now, this works fine when I test it with the webrick server (using
> script/server), but I get an error when trying to run it proper
> through Passenger. Passenger still detects the old (system-wide)
> version of RubyGems instead of my newly added version in my home
> directory.
>
> Next, I tried adding "$LOAD_PATH.unshift '$HOME/gem/lib'" to
> environment.rb without any luck.
>
> Does anyone have any ideas?
>
> Thanks,
> nic.
>
>
Nic, you can do one of the following:

Option 1:

1)  ask the host to install the gems that your application requires

Option 2:  get a better host account that allows better access

Option 3:

1)  use rake locally to unpack the gems into vendor/gems

    rake gems:unpack

    Note:  This requires that the dependent gems are listed in the
environment.rb
              and you can read that file to see how it's done or watch any
railscasts.com
              screencast.

2)  upload the vendor/gems to the remote server

     Note:  This may not work if your application requires native gems
because the local
               OS may be different from the remote OS.

Option 4:   use the bundler gem

1)  install the gemcutter gem (locally)

2)  install the bundler gem (locally)

    Note:  You can find more information about the usage at the following
site:

              http://github.com/wycats/bundler

Finally, you usually can add gems to the load path by doing the following
within your
environment.rb:

Option 1:  add gems using less ruby code within the environment.rb file

  # Add additional load paths for your own custom dirs
  config.load_paths += %W( #{RAILS_ROOT}/extras )

Option 2:   add gems using more ruby code within the environment.rb file

  Dir.glob( File.expand_path( "#{RAILS_ROOT}/vendor/gems/*", __FILE__)
).each do | gem |
    $:.unshift File.join( gem, 'lib' )
  end

Option 3:  using a combination of Option (1) and (2).

Good luck,

-Conrad


> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to