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
Use of 'faker' gem requires Ruby versions > 1.8.7 #157
Comments
Thanks for point to this. Now workarounded by eaab807. |
Thanks for the fix. I think you also need to bump faker to 1.1.1 because I still get this error: $ /usr/bin/ruby1.8 -S rspec ./spec/lib/git_commit_notifier/webhook_spec.rb ..F Failures: 1) GitCommitNotifier::Emailer new should assign parameters from options Failure/Error: options[name.to_sym] = Faker::Lorem.sentence ArgumentError: syntax error on line 4, col 586: ` state: ["北海道","青森県","岩手県","宮城県","秋田県","山形県","福島県","茨城県","栃木県","群馬県","埼玉県","千葉県","東京都","神奈川県","新潟県","富山県","石川県","福井県","山梨県","長野県","岐阜県","静岡県","愛知県","三重県","滋賀県","京都府","大阪府","兵庫県","奈良県","和歌山県","鳥取県","島根県","岡山県","広島県","山口県","徳島県","香川県","愛媛県","高知県","福岡県","佐賀県","長崎県","熊本県","大分県","宮崎県","鹿児島県","沖縄県"]' # ./spec/lib/git_commit_notifier/webhook_spec.rb:22 # ./spec/lib/git_commit_notifier/webhook_spec.rb:21:in `each' # ./spec/lib/git_commit_notifier/webhook_spec.rb:21 2) GitCommitNotifier::Emailer payload should produce a valid json payload Failure/Error: options[name.to_sym] = Faker::Lorem.sentence ArgumentError: syntax error on line 4, col 586: ` state: ["北海道","青森県","岩手県","宮城県","秋田県","山形県","福島県","茨城県","栃木県","群馬県","埼玉県","千葉県","東京都","神奈川県","新潟県","富山県","石川県","福井県","山梨県","長野県","岐阜県","静岡県","愛知県","三重県","滋賀県","京都府","大阪府","兵庫県","奈良県","和歌山県","鳥取県","島根県","岡山県","広島県","山口県","徳島県","香川県","愛媛県","高知県","福岡県","佐賀県","長崎県","熊本県","大分県","宮崎県","鹿児島県","沖縄県"]' # ./spec/lib/git_commit_notifier/webhook_spec.rb:35 # ./spec/lib/git_commit_notifier/webhook_spec.rb:34:in `each' # ./spec/lib/git_commit_notifier/webhook_spec.rb:34 Turns out ja.yml in faker's locale directory isn't parsed happily in Ruby 1.8.7. There is a fix for this now: When I upgraded to faker 1.1.1, running 'rake' under Ruby v1.8.7 worked fine. |
FYI, Faker 1.1.2 now has your workaround in place, so it can be removed if you so desire: |
Thanks, removed monkey patch. |
The default Ubuntu 12.04 installation has Ruby 1.8.7 installed by default. While running 'rake'' under Ruby v1.8.7, I got the following error messages:
Upon further investigation, I found that Faker::Config.locale attempts to use downcase, a method that isn't isn't present in Ruby v1.8.7 but in v1.9+:
module Faker class Config @locale = nil
end
Since the locale isn't defined by default, the downcase call fails.
The first obvious workaround is to set the locale in spec_helper.rb:
Faker::Config.locale = "en-us"
Unfortunately, load_yml on the Japanese YML (ja.yml) fails to load on Ruby 1.8.7 for some reason.
When I upgraded to Ruby v1.9.1, everything worked fine.
Might it be time to require Ruby >= v1.9.1?
The text was updated successfully, but these errors were encountered: