ruby - TypeError: no implicit conversion of Pathname into String -
i want use code run rake task:
task :backup_and_delete_old_data => :environment if defined?(rails) require rails.root + '/config/boot' else require '../../../config/boot' end require rails.root + '/config/environment' factory_backup.each |factory_data| puts ">> backup , delete old #{factory_data.to_s.pluralize.humanize} data..." factory_data.factory_backup(backup_and_delete_old_data) end end but when run rake task error:
typeerror: no implicit conversion of pathname string for line:
require rails.root + '/config/boot' do know how can fix issue?
you have use below format require ruby file,
require file.expand_path('../../../config/environment', __file__) please specify correct ../ correct location of file.
Comments
Post a Comment