Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby Ruby Foundations Numbers Currency

John Stoveld
John Stoveld
4,203 Points

Error with Money library.

The following code goes bonkers when I try to follow along with the currency video.

2.2.0 :005 > require "Money" => true 2.2.0 :006 > price = Money.new(1000) => #<Money fractional:1000 currency:USD> 2.2.0 :007 > puts price I18n::InvalidLocale: :en is not a valid locale from /Users/JS/.rvm/gems/ruby-2.2.0/gems/i18n-0.7.0/lib/i18n.rb:284:in enforce_available_locales!' from /Users/JS/.rvm/gems/ruby-2.2.0/gems/i18n-0.7.0/lib/i18n.rb:151:intranslate' from /Users/JS/.rvm/gems/ruby-2.2.0/gems/money-6.5.0/lib/money/money/formatting.rb:17:in block in define_i18n_method' from /Users/JS/.rvm/gems/ruby-2.2.0/gems/money-6.5.0/lib/money/money.rb:382:into_s' from (irb):7:in puts' from (irb):7:inputs' from (irb):7 from /Users/JS/.rvm/rubies/ruby-2.2.0/bin/irb:11:in `<main>'

I followed the video to a T... not sure what happened.

1 Answer