Reputation: 1312
When i try to start my server after installing Figaro and adding variables to my application.yml file i get a load of errors. Can anyone explain what i need to do to fix. I've read the errors but i'm unsure.
server errors
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/psych.rb:205:in `parse': (<unknown>): found character that cannot start any token while scanning for the next token at line 10 column 1 (Psych::SyntaxError)
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/psych.rb:205:in `parse_stream'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/psych.rb:153:in `parse'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/psych.rb:129:in `load'
from /Library/Ruby/Gems/2.0.0/gems/figaro-0.7.0/lib/figaro.rb:21:in `raw'
from /Library/Ruby/Gems/2.0.0/gems/figaro-0.7.0/lib/figaro.rb:17:in `env'
from /Library/Ruby/Gems/2.0.0/gems/figaro-0.7.0/lib/figaro/railtie.rb:7:in `block in <class:Railtie>'
from /Library/Ruby/Gems/2.0.0/gems/activesupport-4.0.3/lib/active_support/lazy_load_hooks.rb:36:in `call'
from /Library/Ruby/Gems/2.0.0/gems/activesupport-4.0.3/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
from /Library/Ruby/Gems/2.0.0/gems/activesupport-4.0.3/lib/active_support/lazy_load_hooks.rb:45:in `block in run_load_hooks'
from /Library/Ruby/Gems/2.0.0/gems/activesupport-4.0.3/lib/active_support/lazy_load_hooks.rb:44:in `each'
from /Library/Ruby/Gems/2.0.0/gems/activesupport-4.0.3/lib/active_support/lazy_load_hooks.rb:44:in `run_load_hooks'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.0.3/lib/rails/application.rb:67:in `inherited'
from /Users/jamesrobinson/maeson/Chippy/config/application.rb:14:in `<module:Chippy>'
from /Users/jamesrobinson/maeson/Chippy/config/application.rb:13:in `<top (required)>'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.0.3/lib/rails/commands.rb:74:in `require'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.0.3/lib/rails/commands.rb:74:in `block in <top (required)>'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.0.3/lib/rails/commands.rb:71:in `tap'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.0.3/lib/rails/commands.rb:71:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
Application.rb
require File.expand_path('../boot', __FILE__)
require 'rails/all'
require "active_merchant"
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(:default, Rails.env)
module Chippy
class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
# config.time_zone = 'Central Time (US & Canada)'
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
# config.i18n.default_locale = :de
end
end
Application.yml
# Add application configuration variables here, as shown below.
#
# PUSHER_APP_ID: "2954"
# PUSHER_KEY: 7381a978f7dd7f9a1117
# PUSHER_SECRET: abdc3b896a0ffb85d373
# STRIPE_API_KEY: EdAvEPVEC3LuaTg5Q3z6WbDVqZlcBQ8Z
# STRIPE_PUBLIC_KEY: pk_BRgD57O8fHja9HxduJUszhef6jCyS
development:
STRIPE_SECRET_KEY: "sk_test_redactedredactedredractedWdLb"
STRIPE_PUBLISHABLE_KEY: "pk_test_redactedredactedredractedAJb"
GMAIL_USERNAME: "[email protected]"
GMAIL_PASSWORD: "password"
Thanks a lot
Upvotes: 1
Views: 890
Reputation: 1312
There was a syntax error on line 10 of my application.yml file. Changing the indentation in my Editor from tabs to spaces fixed the issue.
Upvotes: 0
Reputation: 53038
As per your config/application.yml
file, you have used tabs
for indentation.
YAML
does not allow TAB characters (\t) for indentation. Replace all the tabs in your config/application.yml
with 2 spaces indentation.
For example:
development:
STRIPE_SECRET_KEY: "sk_test_redactedredactedredractedWdLb"
STRIPE_PUBLISHABLE_KEY: "pk_test_redactedredactedredractedAJb"
GMAIL_USERNAME: "[email protected]"
GMAIL_PASSWORD: "password"
Upvotes: 1