Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined method `downcase' when call the serialize method #657

Open
marknguyen85 opened this issue Nov 3, 2020 · 2 comments
Open

undefined method `downcase' when call the serialize method #657

marknguyen85 opened this issue Nov 3, 2020 · 2 comments

Comments

@marknguyen85
Copy link

Hi there,
I use the axlsx lib to write to xls file but got an error

api_1           | F, [2020-11-04T00:31:01.394784 #1] FATAL -- : [8f75aa98-0ecf-4285-952e-de661d02b51b]   
api_1           | F, [2020-11-04T00:31:01.394951 #1] FATAL -- : [8f75aa98-0ecf-4285-952e-de661d02b51b] NoMethodError (undefined method `downcase' for nil:NilClass):
api_1           | F, [2020-11-04T00:31:01.395017 #1] FATAL -- : [8f75aa98-0ecf-4285-952e-de661d02b51b]   
api_1           | F, [2020-11-04T00:31:01.395051 #1] FATAL -- : [8f75aa98-0ecf-4285-952e-de661d02b51b] (eval):3:in `map'
api_1           | [8f75aa98-0ecf-4285-952e-de661d02b51b] (eval):3:in `map'

Here is my environment:

Docker image: Ruby 2.5
Rails 5.2

Here is my code logic:

p = Axlsx::Package.new
wb = p.workbook
wb.add_worksheet(name: "Data") do |sheet|
     ....
end

dir_tmp = File.join(Rails.root, 'tmp')
FileUtils.mkdir_p(dir_tmp)
file_name_xls = "data.xlsx"
file_save_tmp = "#{dir_tmp}/#{file_name_xls}"

p.serialize(file_save_tmp) => got exception at this line

Plz help me fix it.
@marknguyen85
Copy link
Author

Does anyone help me?

@noniq
Copy link
Collaborator

noniq commented Nov 8, 2020

Could you provide a complete backtrace?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants