markbates / configatron

A super cool, simple, and feature rich configuration system for Ruby apps.

Home Page:http://www.metabates.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

uninitialized constant Configatron::Integrations (NameError)

thebenjy opened this issue · comments

apologies to take the groups time. i cannot find anything on net that suggests anyone has a similar problem.
not a rails / ruby wiz so i’m afraid i’m doing something stupid
using configatron within rails app. bundle install’d etc
have used rails generate configatron:install

but i keep getting : uninitialized constant Configatron::Integrations (NameError)
have tried various gem versions
all files where we’re referring to configatron items have require ''
have even tried require within actual config files.

still get uninitialized constant Configatron::Integrations (NameError)

any ideas?

thanks so much

Post the output of these commands (from your rails project directory):

  • bundle show configatron (shows where bundle is getting configatron from)
  • bundle exec gem which configatron/integrations (should show the integrations.rb under the directory from the previous step)
  • grep configatron Gemfile* (shows how you are loading configatron)
  • cat config/initializers/configatron.rb (this file is what calls Configatron::Intitializations)

gone through as requested. interestingly 'gem which configratron/integrations' returns an error?

air:billslim Ben$ bundle show configatron
/Users/Ben/.rvm/gems/ruby-2.0.0-p451@billslim/gems/configatron-3.0.2
air:billslim Ben$ bundle exec gem which configatron/integrations
ERROR: Can't find ruby library file or shared library configatron/integrations
air:billslim Ben$ grep configatron Gemfile*
Gemfile:gem 'configatron', '>3.0.0'
Gemfile.lock: configatron (3.0.2)
Gemfile.lock: configatron (
> 3.0.0)
air:billslim Ben$ cat config/initializers/configatron.rb
require 'configatron'
Configatron::Integrations::Rails.init

The initializer doesn't match your configatron version for some reason. You either need to update configatron or use the older initializer from 3.0.2 (https://github.com/markbates/configatron/blob/v3.0.2/lib/generators/configatron/install/templates/initializers/configatron.rb):

require 'configatron'
Configatron::Rails.init

Thanks bob. Weird. Not sure how they got out of sync. Updated and seems to work.

Sent from my iPhone

On Nov 18, 2014, at 5:33 AM, Bob Showalter notifications@github.com wrote:

The initializer doesn't match your configatron version for some reason. You either need to update configatron or use the older initializer from 3.0.2 (https://github.com/markbates/configatron/blob/v3.0.2/lib/generators/configatron/install/templates/initializers/configatron.rb):

require 'configatron'
Configatron::Rails.init

Reply to this email directly or view it on GitHub.