Matt
Matt

Reputation: 5398

Where to set Ruby and gems path in Rails 3

I'm on a shared host and need to use my own version of Ruby and keep the gems installed in my home directory as well.

In my Rails 2 app I had this in environment.rb to use my own gems:

if ENV['RAILS_ENV'] == 'production'
  ENV['HOME'] = "/home/matt"
  ENV['GEM_HOME'] = "/home/matt/.gems"
  ENV['GEM_PATH'] = "/home/matt/.gems"
end

Is it a good idea to do the same in Rails 3? Or is there any better way?

Is it possible to configure the application to use my local version of Ruby when it's running on Apache/Passenger?

Upvotes: 1

Views: 2931

Answers (2)

Matt
Matt

Reputation: 5398

I solved it by putting these setting at the top of config.ru and it works fine.

Upvotes: 0

Nicolas Blanco
Nicolas Blanco

Reputation: 11299

If you can use RVM and Bundler on your shared host, you'll be saved (really) :).

Upvotes: 2

Related Questions