laserlemon / figaro

Simple Rails app configuration
MIT License
3.77k stars 287 forks source link

Rails 5 - uninitialized constant Pusher (NameError) #252

Closed gangelo closed 7 years ago

gangelo commented 7 years ago

I am trying to start my rails server and I get the below exception. I've never used figaro before, so any help would be much appreciated:

$ rails s

/Users/gangelo/dev/rails/api.mohojo-werks/config/initializers/pusher.rb:1:in <top (required)>': uninitialized constant Pusher (NameError) from /Users/gangelo/dev/rails/api.mohojo-werks/vendor/bundle/gems/railties-5.0.0.1/lib/rails/engine.rb:648:inblock in load_config_initializer' from /Users/gangelo/dev/rails/api.mohojo-werks/vendor/bundle/gems/activesupport-5.0.0.1/lib/active_support/notifications.rb:166:in `instrument' etc...

# Gemfile

gem 'figaro', '~> 1.1', '>= 1.1.1'

# /config/application.yml

pusher_sendgrid_username: xxxxx@heroku.com""
pusher_sendgrid_password: "xxxxx"

# /config/initializers/pusher.rb

Pusher.SENDGRID_USERNAME = ENV["pusher_sendgrid_username"]
Pusher.SENDGRID_PASSWORD = ENV["pusher_sendgrid_password"]

# /config/initializers/figaro.rb

Figaro.require_keys("pusher_sendgrid_username", "pusher_sendgrid_password")
laserlemon commented 7 years ago

It doesn't seem like this has anything to do with Figaro. You may be missing gem "pusher" in your Gemfile. Hope that helps!