josedonizetti/ruby-duration

SyntaxError

Closed this issue · 2 comments

Hi,

I'm receiving a SyntaxError upon loading the library under ruby 1.9.3p0:

irb(main):001:0> require "duration"
SyntaxError: /Users/administrator/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/duration-0.1.0/lib/duration/localizations/korean.rb:6: invalid multibyte char (US-ASCII)
/Users/administrator/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/duration-0.1.0/lib/duration/localizations/korean.rb:6: invalid multibyte char (US-ASCII)
/Users/administrator/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/duration-0.1.0/lib/duration/localizations/korean.rb:6: syntax error, unexpected $end, expecting keyword_end
      PLURALS   = %w(초 분 시간 일 주)
                       ^
    from /Users/administrator/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /Users/administrator/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /Users/administrator/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/duration-0.1.0/lib/duration/localizations.rb:3:in `<top (required)>'
    from /Users/administrator/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /Users/administrator/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /Users/administrator/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/duration-0.1.0/lib/duration.rb:4:in `<top (required)>'
    from /Users/administrator/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/rubygems/custom_require.rb:59:in `require'
    from /Users/administrator/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/rubygems/custom_require.rb:59:in `rescue in require'
    from /Users/administrator/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
    from (irb):1
    from /Users/administrator/.rbenv/versions/1.9.3-p0/bin/irb:12:in `<main>'

This looks like a problem with strings not being UTF-8.

just add # -- coding: utf-8 -- to the beginning of the file