Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I'm getting an error using Figaro gem in Rails

The error messages references a line in the gem, but I'm suspecting my trouble lay in my .yml file, which is here (with phony ids)

S3_KEY:ANGELINAANGELINA 

S3_SECRET:becaUSEILIKEherthatiswhy

S3_BUCKET:nameofmybucket

/home/tom/.rvm/gems/ruby-2.1.0/gems/figaro-0.7.0/lib/figaro.rb:39:in flatten': undefined methodreject' for # (NoMethodError)

like image 214
Tom Connolly Avatar asked Feb 26 '14 23:02

Tom Connolly


3 Answers

Well if you're just handing out green checks... I'll take one! :)

Parsing error, have a space after each :

like image 60
Patrick Avatar answered Oct 20 '22 18:10

Patrick


Figaro doesn't parse tab space either. That means that if you want any indentation, you will need to use single spaces. You can use an online parser to validate your code and play around. Here's one: http://www.yamllint.com/

like image 24
Ben Avatar answered Oct 20 '22 19:10

Ben


S3_KEY: ANGELINAANGELINA

S3_SECRET: becaUSEILIKEherthatiswhy

S3_BUCKET: nameofmybucket

Terminal : figaro install, To create the yml file and use the above format

like image 43
neo7 Avatar answered Oct 20 '22 19:10

neo7