Permalink
Browse files

let application load rails, load app first

  • Loading branch information...
1 parent 8f19e25 commit 38165cec9196da372a3655c527b3109f198b7921 @wuputah committed Jun 27, 2011
Showing with 2 additions and 3 deletions.
  1. +2 −3 lib/ripl/rails.rb
View
@@ -15,12 +15,11 @@ def self.load_rails
ENV['RAILS_ENV'] = ARGV[0] if ARGV[0].to_s[/^[^-]/]
require "#{Dir.pwd}/config/boot"
- require 'rails' unless defined? ::Rails
- if ::Rails.version >= '3.0'
+ if File.exists?("#{Dir.pwd}/config/application.rb")
Object.const_set :APP_PATH, File.expand_path("#{Dir.pwd}/config/application")
+ require APP_PATH
require 'rails/console/app'
require 'rails/console/helpers'
- require APP_PATH
::Rails.application.require_environment!
else
["#{Dir.pwd}/config/environment", 'console_app', 'console_with_helpers'].each {|e| require e }

0 comments on commit 38165ce

Please sign in to comment.