From d261ec104873298f3f9004d0a62209a80f04ed2b Mon Sep 17 00:00:00 2001 From: Alexander Pupeikis Date: Sat, 25 Dec 2010 06:39:57 -0500 Subject: [PATCH] added support for local gems use in config/environment.rb. Helpful in production server without root access --- config/environment.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/config/environment.rb b/config/environment.rb index 043cce5..56ba517 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -6,6 +6,13 @@ # Bootstrap the Rails environment, frameworks, and default configuration require File.join(File.dirname(__FILE__), 'boot') +# Required to use local gems inside the users home directory. Maybe helpful in production server +# without root access. However, for RAILS_GEM_VERSION = '2.3.8' these should to be located before the +# "require File.join(File.dirname(__FILE__), 'boot')" line +if ENV['RAILS_ENV'] == 'production' # don't bother on dev + ENV['GEM_PATH'] = File.expand_path('~/.gems') + ':/usr/lib/ruby/gems/1.8' +end + Rails::Initializer.run do |config| # config.gem "aws-s3", :lib => "aws/s3" # config.gem 'grit'