Iam creating a Rails Applocation in Rails 3.2 in which I'm trying to implement twitter login using gem 'omniauth-twitter'. I have installed the same gem. Now I try to add my twitter credentials in /config/app.yml in Rails as:
config/app.yml
development: &default
s3_bucket_name: xxxx
aws_access_key_id: xxxx
aws_secret_access_key: xxxx
cloud_made_key: xxxx
facebook_key: "xxxxx"
facebook_secret: 'xxxxxxx'
twitter_consumer_key: "xxxx"
twitter_consumer_secret: "xxxxx"
When I restart my server I get the following error:
error
/home/swati/.rvm/rubies/ruby-1.9.2-p318/lib/ruby/1.9.1/psych.rb:148:in `parse': couldn't parse YAML at line 8 column 0 (Psych::SyntaxError)
from /home/swati/.rvm/rubies/ruby-1.9.2-p318/lib/ruby/1.9.1/psych.rb:148:in `parse_stream'
from /home/swati/.rvm/rubies/ruby-1.9.2-p318/lib/ruby/1.9.1/psych.rb:119:in `parse'
from /home/swati/.rvm/rubies/ruby-1.9.2-p318/lib/ruby/1.9.1/psych.rb:106:in `load'
from /home/swati/projects/hackathon-io/config/application.rb:77:in `<class:Application>'
from /home/swati/projects/hackathon-io/config/application.rb:13:in `<module:HackathonIo>'
from /home/swati/projects/hackathon-io/config/application.rb:12:in `<top (required)>'
from /home/swati/.rvm/gems/ruby-1.9.2-p290@hackathon-io/gems/railties-3.2.6/lib/rails/commands.rb:53:in `require'
from /home/swati/.rvm/gems/ruby-1.9.2-p290@hackathon-io/gems/railties-3.2.6/lib/rails/commands.rb:53:in `block in <top (required)>'
from /home/swati/.rvm/gems/ruby-1.9.2-p290@hackathon-io/gems/railties-3.2.6/lib/rails/commands.rb:50:in `tap'
from /home/swati/.rvm/gems/ruby-1.9.2-p290@hackathon-io/gems/railties-3.2.6/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
I searched for a solution and found the same problem and implemented the answer as specified in rails error, couldn't parse YAML.
/config/boot.rb
require 'yaml'
YAML::ENGINE.yamler = 'syck'
I restarted my server and again got the error:
`/home/swati/.rvm/rubies/ruby-1.9.2-p318/lib/ruby/1.9.1/syck.rb:135:in `load': syntax error on line 8, col 22: ` twitter_consumer_key: "xxxxx"' (ArgumentError)
from /home/swati/.rvm/rubies/ruby-1.9.2-p318/lib/ruby/1.9.1/syck.rb:135:in `load'
from /home/swati/projects/hackathon-io/config/application.rb:77:in `<class:Application>'
from /home/swati/projects/hackathon-io/config/application.rb:13:in `<module:HackathonIo>'
from /home/swati/projects/hackathon-io/config/application.rb:12:in `<top (required)>'
from /home/swati/.rvm/gems/ruby-1.9.2-p290@hackathon-io/gems/railties- 3.2.6/lib/rails/commands.rb:53:in `require'
from /home/swati/.rvm/gems/ruby-1.9.2-p290@hackathon-io/gems/railties-3.2.6/lib/rails/commands.rb:53:in `block in <top (required)>'
from /home/swati/.rvm/gems/ruby-1.9.2-p290@hackathon-io/gems/railties-3.2.6/lib/rails/commands.rb:50:in `tap'
from /home/swati/.rvm/gems/ruby-1.9.2-p290@hackathon-io/gems/railties-3.2.6/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
I am not able to figure out the syntax error. Please help me out to figure this error.