mpath
mpath

Reputation: 29

Error: Rake Aborted. Uninitialized Constant Settings

Newbie here trying to create a development environment for a project. I've installed MySQL and Ruby on Rails on my device already. However, I'm running into the below error message when trying to run the 3 commands below after "bundle install" runs successfully. Any ideas?

  1. bundle exec rake db:setup RAILS_ENV="development"
  2. bundle exec rake db:migrate RAILS_ENV="development"
  3. bundle exec rake db:seed RAILS_ENV=“development"

error message is as follows:

wcai-projects already exists
rake aborted!
uninitialized constant Settings

EDIT-here's the console log:

$ bundle exec rake db:setup RAILS_ENV=development
/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/activesupport-3.2.12/lib/active_support/values/time_zone.rb:270: warning: circular argument reference - now
wcai-projects already exists
rake aborted!
uninitialized constant Settings
/wcai-web/config/initializers/carrier_wave.rb:4:in `block in <top (required)>'
/wcai-web/config/initializers/carrier_wave.rb:1:in `<top (required)>'
/wcai-web/config/environment.rb:5:in `<top (required)>'
Tasks: TOP => db:setup => db:schema:load_if_ruby => environment
(See full trace by running task with --trace)

EDIT-contents of config/initializers/carrier_wave.rb:

CarrierWave.configure do |config|
  config.fog_credentials = {
    :provider               => 'AWS',       # required
    :aws_access_key_id      => Settings.aws_access_key,      # required
    :aws_secret_access_key  => Settings.aws_secret_key       # required
#    :region                 => 'eu-west-1'  # optional, defaults to 'us-east-1'
  }
  config.fog_directory  = Settings.aws_bucket                    # required
  config.fog_public     = false     
  config.fog_authenticated_url_expiration = 120
  config.fog_attributes = {'Cache-Control'=>'max-age=315576000'}  # optional, defaults to {}
  #config.asset_host     = 'https://assets.example.com'            # optional, defaults to nil

end

Upvotes: 2

Views: 747

Answers (1)

userresu
userresu

Reputation: 107

Update your Rails version in Gemfile to 4.2.4. Then type bundle update rails and try again.

Upvotes: 1

Related Questions