Created
March 7, 2018 00:17
-
-
Save joaquim-oliveira-neto/d31895bc402bf1a631eecfed17f35b31 to your computer and use it in GitHub Desktop.
Problem with running rake on production
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#-----lib/tasks/import.rake------# | |
# require File.expand_path(File.dirname(__FILE__) + '../../../app/models/application_record.rb') | |
# require File.expand_path(File.dirname(__FILE__) + '../../../app/models/invoice.rb') | |
# require File.expand_path(File.dirname(__FILE__) + '../../../app/models/installment.rb') | |
# require File.expand_path(File.dirname(__FILE__) + '../../../app/models/seller.rb') | |
# require File.expand_path(File.dirname(__FILE__) + '../../../app/models/payer.rb') | |
# require File.expand_path(File.dirname(__FILE__) + '../../../app/models/operation.rb') | |
# require File.expand_path(File.dirname(__FILE__) + '../../../app/services/legacy_importation.rb') | |
namespace :import do | |
desc "Given the path of a excel spreadsheet exported from Smart it will import paid invoices " | |
task :paid_invoices, [:path] do |t, args| | |
# Rails.application.eager_load! | |
path = args.path | |
LegacyImportation.new.paid_invoices_importation(path) | |
end | |
desc "Given the path of a excel spreadsheet exported from Smart it will import opened invoices " | |
task :opened_invoices, [:path] do |t, args| | |
# Rails.application.eager_load! | |
path = args.path | |
LegacyImportation.new.opened_invoices_importation(path) | |
end | |
end | |
#--------on terminal--------# | |
# works fine | |
rake import:opened_invoices\[lib/xlsx_reader/titulos_abertos_biort.xlsx\] | |
# throw us an error: "uninitialized constant" | |
heroku run rake import:opened_invoices\[lib/xlsx_reader/titulos_abertos_biort.xlsx\] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment