Read RACK_ENV but apply RAILS_ENV
Ruby whenever uses RAILS_ENV in crontab.
This commit is contained in:
parent
fa1a58bea2
commit
0dd3d03b67
2 changed files with 8 additions and 2 deletions
|
|
@ -1,5 +1,5 @@
|
||||||
if ENV['RAILS_ENV']
|
if ENV['RACK_ENV']
|
||||||
set :environment, ENV['RAILS_ENV']
|
set :environment, ENV['RACK_ENV']
|
||||||
end
|
end
|
||||||
|
|
||||||
set :output, 'vedia.log'
|
set :output, 'vedia.log'
|
||||||
|
|
|
||||||
6
vedia.rb
6
vedia.rb
|
|
@ -1,4 +1,10 @@
|
||||||
require 'sinatra'
|
require 'sinatra'
|
||||||
|
|
||||||
|
# Set environment before requiring 'sinatra/activerecord' to make `whenever` uses the database.
|
||||||
|
if ENV['RAILS_ENV']
|
||||||
|
set :environment, ENV['RAILS_ENV']
|
||||||
|
end
|
||||||
|
|
||||||
require 'sinatra/activerecord'
|
require 'sinatra/activerecord'
|
||||||
require 'bcrypt'
|
require 'bcrypt'
|
||||||
require 'gettext'
|
require 'gettext'
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue