Commit a8129f4a

mo k <mo@mokhan.ca>
2012-10-04 12:44:55
fix load paths thing for the new passenger.
1 parent 00a64ae
Changed files (1)
config/setup_load_paths.rb
@@ -1,28 +1,14 @@
 if ENV['MY_RUBY_HOME'] && ENV['MY_RUBY_HOME'].include?('rvm')
   begin
-    rvm_path     = File.dirname(File.dirname(ENV['MY_RUBY_HOME']))
-    rvm_lib_path = File.join(rvm_path, 'lib')
-    $LOAD_PATH.unshift rvm_lib_path
+    gems_path = ENV['MY_RUBY_HOME'].split(/@/)[0].sub(/rubies/,'gems')
+    ENV['GEM_PATH'] = "#{gems_path}:#{gems_path}@global"
     require 'rvm'
     RVM.use_from_path! File.dirname(File.dirname(__FILE__))
   rescue LoadError
-    # RVM is unavailable at this point.
-    raise "RVM ruby lib is currently unavailable."
+    raise "RVM gem is currently unavailable."
   end
 end
 
-# Select the correct item for which you use below.
-# If you're not using bundler, remove it completely.
-
-# If we're using a Bundler 1.0 beta
+# If you're not using Bundler at all, remove lines bellow
 ENV['BUNDLE_GEMFILE'] = File.expand_path('../Gemfile', File.dirname(__FILE__))
 require 'bundler/setup'
-
-# Or Bundler 0.9...
-if File.exist?(".bundle/environment.rb")
-  require '.bundle/environment'
-else
-  require 'rubygems'
-  require 'bundler'
-  Bundler.setup
-end
\ No newline at end of file