Fix bootstrap task that does not load the environment

This commit is contained in:
Maciej Szlosarczyk 2018-10-24 09:12:41 +03:00
parent 910753b076
commit 3d78128c76
No known key found for this signature in database
GPG key ID: 41D62D42D3B0D765
3 changed files with 8 additions and 8 deletions

View file

@ -44,7 +44,7 @@ Manual demo install and database setup:
cp config/application-example.yml config/application.yml # and edit it cp config/application-example.yml config/application.yml # and edit it
cp config/database-example.yml config/database.yml # and edit it cp config/database-example.yml config/database.yml # and edit it
bundle exec rake db:setup:all # for production, please follow deployment howto bundle exec rake db:setup:all # for production, please follow deployment howto
bundle exec rake:bootstrap bundle exec rake bootstrap
bundle exec rake assets:precompile bundle exec rake assets:precompile
### Apache with patched mod_epp (Debian 7/Ubuntu 14.04 LTS) ### Apache with patched mod_epp (Debian 7/Ubuntu 14.04 LTS)

View file

@ -1,6 +1,6 @@
# Add your own tasks in files placed in lib/tasks ending in .rake, # Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
require File.expand_path('../config/application', __FILE__) require File.expand_path('../config/environment', __FILE__)
Rails.application.load_tasks Rails.application.load_tasks

View file

@ -1,11 +1,11 @@
desc 'Bootstraps production-like environment' desc 'Bootstraps production-like environment'
task :bootstrap do task :bootstrap do
AdminUser.create!( AdminUser.create!(
username: 'admin', username: 'admin',
email: 'admin@domain.tld', email: 'admin@domain.tld',
password: 'adminadmin', password: 'adminadmin',
password_confirmation: 'adminadmin', password_confirmation: 'adminadmin',
country_code: 'US', country_code: 'US',
roles: ['admin'] roles: ['admin']
) )
end end