Load default gems based on bundle config.
This commit is contained in:
parent
591881ccf6
commit
ed78be7d50
2 changed files with 16 additions and 4 deletions
|
@ -3,8 +3,18 @@
|
|||
|
||||
$LOAD_PATH << './lib'
|
||||
require 'rubygems'
|
||||
require 'daemons'
|
||||
|
||||
# load rails env
|
||||
dir = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
||||
Dir.chdir dir
|
||||
RAILS_ENV = ENV['RAILS_ENV'] || 'development'
|
||||
|
||||
require 'rails/all'
|
||||
require 'bundler'
|
||||
Bundler.require(:default, Rails.env)
|
||||
require File.join(dir, 'config', 'environment')
|
||||
|
||||
require 'daemons'
|
||||
|
||||
daemon_options = {
|
||||
multiple: false,
|
||||
|
@ -22,12 +32,10 @@ Daemons.run_proc(name, daemon_options) do
|
|||
end
|
||||
|
||||
Dir.chdir dir
|
||||
RAILS_ENV = ARGV.first || ENV['RAILS_ENV'] || 'development'
|
||||
|
||||
$stdout.reopen( dir + '/log/' + name + '_out.log', 'w')
|
||||
$stderr.reopen( dir + '/log/' + name + '_err.log', 'w')
|
||||
require File.join(dir, 'config', 'environment')
|
||||
require 'scheduler'
|
||||
|
||||
require 'scheduler'
|
||||
Scheduler.threads
|
||||
end
|
||||
|
|
|
@ -14,6 +14,10 @@ require 'daemons'
|
|||
dir = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
||||
Dir.chdir dir
|
||||
RAILS_ENV = ENV['RAILS_ENV'] || 'development'
|
||||
|
||||
require 'rails/all'
|
||||
require 'bundler'
|
||||
Bundler.require(:default, Rails.env)
|
||||
require File.join(dir, 'config', 'environment')
|
||||
|
||||
require 'sessions'
|
||||
|
|
Loading…
Reference in a new issue