Skip to content

Added require 'iconv' before you call before you call Excel.new #1

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

nicholasklick
Copy link

This allows excel2csv to work. See roo related discussion here: https://github.com/hmcgowan/roo/issues/13

@scpike
Copy link
Owner

scpike commented Oct 31, 2012

This should only be required when on ruby < 1.9. Can you wrap the require?

Something like:

if RUBY_VERSION == '1.8.7'                                                                                                                                                                                                                                       
  require 'iconv'                                                                                                                                                                                                                                                
end  

I get a warning about deprecated iconv on 1.9.3 otherwise.

@nicholasklick
Copy link
Author

Sure. But I am using ruby-1.9.3 not 1.8.7.

Without the IConv require I get this with 1.9.3:

~/.rvm/gems/ruby-1.9.3-p194/gems/roo-1.10.1/lib/roo/excel.rb:284:in
`platform_specific_iconv': uninitialized constant Excel::Iconv (NameError)

On Wed, Oct 31, 2012 at 2:37 PM, Stephen Pike [email protected]:

This should only be required when on ruby 1.8.7. Can you wrap the require?

if RUBY_VERSION == '1.8.7'
require 'iconv'
end

I get a warning about deprecated iconv on 1.9.3 otherwise.


Reply to this email directly or view it on GitHubhttps://github.com//pull/1#issuecomment-9959000.

@nicholasklick
Copy link
Author

Could this be a roo version issue?

On Wed, Oct 31, 2012 at 2:42 PM, Nicholas Klick [email protected]:

Sure. But I am using ruby-1.9.3 not 1.8.7.

Without the IConv require I get this with 1.9.3:

~/.rvm/gems/ruby-1.9.3-p194/gems/roo-1.10.1/lib/roo/excel.rb:284:in
`platform_specific_iconv': uninitialized constant Excel::Iconv (NameError)

On Wed, Oct 31, 2012 at 2:37 PM, Stephen Pike [email protected]:

This should only be required when on ruby 1.8.7. Can you wrap the require?

if RUBY_VERSION == '1.8.7'
require 'iconv'
end

I get a warning about deprecated iconv on 1.9.3 otherwise.


Reply to this email directly or view it on GitHubhttps://github.com//pull/1#issuecomment-9959000.

@scpike
Copy link
Owner

scpike commented Oct 31, 2012

We're both using roo 1.10.1. I'm on 1.9.3 as well, and have no problem without the require iconv. I'm not going to merge this since it works for me, but if you figure out the root cause of this I'd love to have a patch and/or some install notes for the readme.

Are you using rvm (I am)?
https://rvm.io/packages/iconv/

Some more info from my working environment:
bundle list
Gems included by the bundle:
* bundler (1.1.4)
* choice (0.1.6)
* faraday (0.8.0)
* google-spreadsheet-ruby (0.1.8)
* httpauth (0.1)
* log4r (1.1.10)
* multi_json (1.3.4)
* multipart-post (1.1.5)
* nokogiri (1.5.2)
* oauth (0.4.6)
* oauth2 (0.7.1)
* rack (1.4.1)
* roo (1.10.1)
* ruby-ole (1.2.11.3)
* rubyzip (0.9.8)
* spreadsheet (0.6.9)
* todonotes (0.1.0)

@nicholasklick
Copy link
Author

Looks like we have the same setup. 1.9.3 on RVM.

I will dig into this and get back to you.

Nicholas$ bundle list
Gems included by the bundle:

  • bundler (1.2.0)
  • choice (0.1.6)
  • faraday (0.8.0)
  • google-spreadsheet-ruby (0.1.8)
  • httpauth (0.1)
  • log4r (1.1.10)
  • multi_json (1.3.4)
  • multipart-post (1.1.5)
  • nokogiri (1.5.2)
  • oauth (0.4.6)
  • oauth2 (0.7.1)
  • rack (1.4.1)
  • roo (1.10.1)
  • ruby-ole (1.2.11.3)
  • rubyzip (0.9.8)
  • spreadsheet (0.6.9)
  • todonotes (0.1.0)
    Nicholas$ rvm list

rvm rubies

ruby-1.9.2-p320 [ x86_64 ]
=* ruby-1.9.3-p194 [ x86_64 ]

On Wed, Oct 31, 2012 at 2:51 PM, Stephen Pike [email protected]:

We're both using roo 1.10.1. I'm on 1.9.3 as well, and have no problem
without the require iconv. I'm not going to merge this since it works for
me, but if you figure out the root cause of this I'd love to have a patch
and/or some install notes for the readme.

Are you using rvm?
https://rvm.io/packages/iconv/

Some more info from my working environment:
bundle list
Gems included by the bundle:

  • bundler (1.1.4)
  • choice (0.1.6)
  • faraday (0.8.0)
  • google-spreadsheet-ruby (0.1.8)
  • httpauth (0.1)
  • log4r (1.1.10)
  • multi_json (1.3.4)
  • multipart-post (1.1.5)
  • nokogiri (1.5.2)
  • oauth (0.4.6)
  • oauth2 (0.7.1)
  • rack (1.4.1)
  • roo (1.10.1)
  • ruby-ole (1.2.11.3)
  • rubyzip (0.9.8)
  • spreadsheet (0.6.9)
  • todonotes (0.1.0)


Reply to this email directly or view it on GitHubhttps://github.com//pull/1#issuecomment-9959464.

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

Successfully merging this pull request may close these issues.

2 participants