Created
November 5, 2011 22:11
-
-
Save MeanderingCode/1342098 to your computer and use it in GitHub Desktop.
Diff for TracksApp/tracks to get it working on Dreamhost shared hosting
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/config/environment.rb b/config/environment.rb | |
index 1fc8f03..246951b 100644 | |
--- a/config/environment.rb | |
+++ b/config/environment.rb | |
@@ -2,11 +2,26 @@ | |
# Uncomment below to force Rails into production mode | |
# (Use only when you can't set environment variables through your web/app server) | |
-# ENV['RAILS_ENV'] = 'production' | |
+ ENV['RAILS_ENV'] = 'production' | |
+ | |
+if ENV['RAILS_ENV'] == 'production' | |
+ ENV['GEM_HOME'] = '/home/user/.rvm/gems/ruby-1.8.7-p352' | |
+ ENV['GEM_PATH'] = '/home/user/.rvm/gems/ruby-1.8.7-p352:/home/user/.rvm/gems/ruby-1.8.7-p352@global' + ':/usr/lib/ruby/gems/1.8' | |
+ ENV['BUNDLE_PATH'] = '/home/user/.rvm/gems/ruby-1.8.7-p352' | |
+end | |
# Bootstrap the Rails environment, frameworks, and default configuration | |
require File.join(File.dirname(__FILE__), 'boot') | |
+if ENV['RAILS_ENV'] == 'production' | |
+ ENV['GEM_HOME'] = '/home/user/.rvm/gems/ruby-1.8.7-p352' | |
+ ENV['GEM_PATH'] = '/home/user/.rvm/gems/ruby-1.8.7-p352:/home/user/.rvm/gems/ruby-1.8.7-p352@global' + ':/usr/lib/ruby/gems/1.8' | |
+ ENV['BUNDLE_PATH'] = '/home/user/.rvm/gems/ruby-1.8.7-p352' | |
+end | |
+ | |
+require 'rubygems' | |
+Gem.clear_paths | |
+ | |
require 'yaml' | |
SITE_CONFIG = YAML.load_file(File.join(File.dirname(__FILE__), 'site.yml')) | |
@@ -74,6 +89,8 @@ end | |
# Include your application configuration below | |
+require 'bundler' | |
+Bundler.require | |
require 'name_part_finder' | |
require 'tracks/todo_list' | |
diff --git a/config/initializers/mongrel_workaround.rb b/config/initializers/mongrel_workaround.rb | |
index dcad693..bc32e4e 100644 | |
--- a/config/initializers/mongrel_workaround.rb | |
+++ b/config/initializers/mongrel_workaround.rb | |
@@ -13,7 +13,8 @@ begin | |
end | |
end | |
-mongrel115 = check_mongrel_around_115 | |
+#mongrel115 = check_mongrel_around_115 | |
+mongrel115 = false | |
if Rails.version == '2.3.14' && mongrel115 && self.class.const_defined?(:Mongrel) | |
diff --git a/config/preinitializer.rb b/config/preinitializer.rb | |
index a6b4d1e..6fc36c4 100644 | |
--- a/config/preinitializer.rb | |
+++ b/config/preinitializer.rb | |
@@ -13,6 +13,7 @@ end | |
begin | |
# Set up load paths for all bundled gems | |
ENV["BUNDLE_GEMFILE"] = File.expand_path("../../Gemfile", __FILE__) | |
+ Gem.clear_paths | |
Bundler.setup | |
rescue Bundler::GemNotFound | |
raise RuntimeError, "Bundler couldn't find some gems." + |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is, as stated in the description, a diff of what I had to change in the config/ directory in order to get things running on Dreamhost shared hosting under Passenger with rvm.
IMPORTANT: This is not a patch. Note the environment vars and paths
IMPORTANT: I had to run a
bundle pack
andbundle install --path vendor/cache
Notable:
Bundler.require
Gem.clear_paths
is important, but I don't know if inclusion in both preinitializer.rb && evironment.rb are neccessary or if only one would do