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
6
vedia.rb
6
vedia.rb
|
|
@ -1,4 +1,10 @@
|
|||
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 'bcrypt'
|
||||
require 'gettext'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue