Open madtocode opened 9 years ago
Any update on this please? I'm blocked right now.
@madtocode: ever heard about the tradition of providing the sample file, so the developer could, like, reproduce your problem?
No need of file. I was getting the same problem when trying to create a new workbook using rubyXL. Just refer to the rails console commands given. I was creating a new workbook and saving with a name. That's it.
@madtocode: works just fine.
2.1.1 :001 > require 'rubyXL'
=> true
2.1.1 :002 > @result_workbook = RubyXL::Workbook.new
=> #<RubyXL::Workbook:0x000000029e2a08 ....... >
2.1.1 :003 > @result_workbook.write("test_output.xlsx")
=> "test_output.xlsx"
2.1.1 :004 > RUBY_VERSION
=> "2.1.1"
I tried on Mac and centos, not working. On ubuntu, it worked. Is there any configuration need to done for this?
adding # encoding: utf-8
didn't work. Tried other things too. Could you please tell me where it actually is dependent on?
RUBY_VERSION we are using is 2.0.0
I'm on ubuntu.
I can't tell for sure what causes your problem, but I have a suspicion.
I suggest you do the following: in the console, execute the following code:
module RubyXL
class Theme < OOXMLTopLevelObject
def self.default
default_theme = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme">
</a:theme>'
self.parse(default_theme)
end
end
end
and then try again. See if it fixes things. If yes, I'll see what can be done.
It's still the same @weshatheleopard even after executing the code block you provided. I'm using rubyXL version 3.1.0 btw.
Try adding # encoding: utf-8
to objects/theme.rb
Getting the above error whenever I try to 'write' to an xlsx file. Modifying existing excel sheet raised this error. I even tried creating a new excel sheet as follows (in rails console):
Just created a new workbook and saved it without performing any other operations, still it is failing.
Your help is appreciated.