Commit 6d5099fcfff9a797608c60b56c13c7ec23af304a
1 parent
92d3e0b3
Exists in
master
and in
28 other branches
ActionItem1178: using Debian-installed Rails
If the user wants to use some Rails version from Rails, it's simple: * remove the symlink in vendor/rails * Uninstall Rails from Debian * install rails through gem
Showing
2 changed files
with
14 additions
and
1 deletions
Show diff stats
config/boot.rb
@@ -105,5 +105,18 @@ module Rails | @@ -105,5 +105,18 @@ module Rails | ||
105 | end | 105 | end |
106 | end | 106 | end |
107 | 107 | ||
108 | +# yeah, I know, I shouldn't change this file. But ... | ||
109 | +def install_debian_rails | ||
110 | + local_rails = File.dirname(__FILE__) + '/../vendor/rails' | ||
111 | + debian_rails = '/usr/share/rails' | ||
112 | + if !File.exist?(local_rails) && File.exists?(debian_rails) | ||
113 | + puts "I: Installing Debian-installed Rails from /usr/share/rails into vendor/rails." | ||
114 | + recommended_rails_version = Rails::GemBoot.gem_version | ||
115 | + puts "I: Please note that the recommended Rails version is #{recommended_rails_version}, and that other versions might not work" | ||
116 | + File.symlink(debian_rails, local_rails) | ||
117 | + end | ||
118 | +end | ||
119 | +install_debian_rails | ||
120 | + | ||
108 | # All that for this: | 121 | # All that for this: |
109 | Rails.boot! | 122 | Rails.boot! |
config/environment.rb
@@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
5 | #ENV['RAILS_ENV'] ||= 'production' | 5 | #ENV['RAILS_ENV'] ||= 'production' |
6 | 6 | ||
7 | # Specifies gem version of Rails to use when vendor/rails is not present | 7 | # Specifies gem version of Rails to use when vendor/rails is not present |
8 | -RAILS_GEM_VERSION = '2.0.2' unless defined? RAILS_GEM_VERSION | 8 | +RAILS_GEM_VERSION = '2.1.0' unless defined? RAILS_GEM_VERSION |
9 | 9 | ||
10 | # Bootstrap the Rails environment, frameworks, and default configuration | 10 | # Bootstrap the Rails environment, frameworks, and default configuration |
11 | require File.join(File.dirname(__FILE__), 'boot') | 11 | require File.join(File.dirname(__FILE__), 'boot') |