1

I am trying to learn Ruby on Rails for the first time and the install/setup is is a lot to take in and I am having a bit of trouble. Specifically portion 1.4.2 of http://www.railstutorial.org/book/beginning#uid28 the Heroku setup.

When I enter in the command git push heroku master I get errors which prevent me from continuing in the tutorial. Please let me know if there is any other piece of information I should provide.

The problem seems to be

Running: rake assets:precompile
       rake aborted!
       NoMethodError: undefined method `configure' for #<FirstApp::Application:0x007fee78f193e8>

However in this tutorial I do not recall creating/editing any method named configure

Gemfile:

source 'https://rubygems.org'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.1'
group :development do
  gem 'sqlite3', '1.3.8'
end


# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.1'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 2.1.1'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.1'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer',  platforms: :ruby

# Use jquery as the JavaScript library
gem 'jquery-rails', '3.0.4'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks', '1.1.1'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '1.0.2'
# bundle exec rake doc:rails generates the API under doc/api.
group :doc do
  gem 'sdoc', '0.3.20', require: false
end

group :production do
  gem 'pg', '0.15.1'
  gem 'rails_12factor', '0.0.2'
end

# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring',        group: :development

# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use unicorn as the app server
# gem 'unicorn'

# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development

# Use debugger
# gem 'debugger', group: [:development, :test]

ruby '2.0.0'
# ruby-gemset=railstutorial_rails_4_0

msg:

-----> Writing config/database.yml to read from DATABASE_URL
-----> Preparing app for Rails asset pipeline
       Running: rake assets:precompile
       rake aborted!
       NoMethodError: undefined method `configure' for #<FirstApp::Application:0x007fee78f193e8>
       /tmp/build_07914188-f9fb-4a8e-bfb4-5a9d47e43d61/config/environments/production.rb:1:in `<top (required)>'
       /tmp/build_07914188-f9fb-4a8e-bfb4-5a9d47e43d61/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in `require'
       /tmp/build_07914188-f9fb-4a8e-bfb4-5a9d47e43d61/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in `block in require'
       /tmp/build_07914188-f9fb-4a8e-bfb4-5a9d47e43d61/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:214:in `load_dependency'
       /tmp/build_07914188-f9fb-4a8e-bfb4-5a9d47e43d61/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in `require'
       /tmp/build_07914188-f9fb-4a8e-bfb4-5a9d47e43d61/vendor/bundle/ruby/2.0.0/gems/railties-4.0.1/lib/rails/engine.rb:591:in `block (2 levels) in <class:Engine>'
       /tmp/build_07914188-f9fb-4a8e-bfb4-5a9d47e43d61/vendor/bundle/ruby/2.0.0/gems/railties-4.0.1/lib/rails/engine.rb:590:in `each'
       /tmp/build_07914188-f9fb-4a8e-bfb4-5a9d47e43d61/vendor/bundle/ruby/2.0.0/gems/railties-4.0.1/lib/rails/engine.rb:590:in `block in <class:Engine>'
       /tmp/build_07914188-f9fb-4a8e-bfb4-5a9d47e43d61/vendor/bundle/ruby/2.0.0/gems/railties-4.0.1/lib/rails/initializable.rb:30:in `instance_exec'
       /tmp/build_07914188-f9fb-4a8e-bfb4-5a9d47e43d61/vendor/bundle/ruby/2.0.0/gems/railties-4.0.1/lib/rails/initializable.rb:30:in `run'
       /tmp/build_07914188-f9fb-4a8e-bfb4-5a9d47e43d61/vendor/bundle/ruby/2.0.0/gems/railties-4.0.1/lib/rails/initializable.rb:55:in `block in run_initializers'
       /tmp/build_07914188-f9fb-4a8e-bfb4-5a9d47e43d61/vendor/bundle/ruby/2.0.0/gems/railties-4.0.1/lib/rails/initializable.rb:44:in `each'
       /tmp/build_07914188-f9fb-4a8e-bfb4-5a9d47e43d61/vendor/bundle/ruby/2.0.0/gems/railties-4.0.1/lib/rails/initializable.rb:44:in `tsort_each_child'
       /tmp/build_07914188-f9fb-4a8e-bfb4-5a9d47e43d61/vendor/bundle/ruby/2.0.0/gems/railties-4.0.1/lib/rails/initializable.rb:54:in `run_initializers'
       /tmp/build_07914188-f9fb-4a8e-bfb4-5a9d47e43d61/vendor/bundle/ruby/2.0.0/gems/railties-4.0.1/lib/rails/application.rb:215:in `initialize!'
       /tmp/build_07914188-f9fb-4a8e-bfb4-5a9d47e43d61/config/environment.rb:5:in `<top (required)>'
       /tmp/build_07914188-f9fb-4a8e-bfb4-5a9d47e43d61/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in `require'
       /tmp/build_07914188-f9fb-4a8e-bfb4-5a9d47e43d61/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in `block in require'
       /tmp/build_07914188-f9fb-4a8e-bfb4-5a9d47e43d61/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:214:in `load_dependency'
       /tmp/build_07914188-f9fb-4a8e-bfb4-5a9d47e43d61/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in `require'
       /tmp/build_07914188-f9fb-4a8e-bfb4-5a9d47e43d61/vendor/bundle/ruby/2.0.0/gems/railties-4.0.1/lib/rails/application.rb:189:in `require_environment!'
       /tmp/build_07914188-f9fb-4a8e-bfb4-5a9d47e43d61/vendor/bundle/ruby/2.0.0/gems/railties-4.0.1/lib/rails/application.rb:250:in `block in run_tasks_blocks'
       /tmp/build_07914188-f9fb-4a8e-bfb4-5a9d47e43d61/vendor/bundle/ruby/2.0.0/gems/sprockets-rails-2.0.1/lib/sprockets/rails/task.rb:54:in `block (2 levels) in define'
       Tasks: TOP => environment
       (See full trace by running task with --trace)
 !
 !     Precompiling assets failed.
 !

 !     Push rejected, failed to compile Ruby app

To git@heroku.com:still-crag-4202.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:still-crag-4202.git'
Liondancer
  • 15,721
  • 51
  • 149
  • 255

1 Answers1

0

Configure

This is the error for your perusal:

undefined method `configure'

--

The problem looks like you've got some sort of reference to "configure" in your config/application.rb / config/environments/development.rb / config/environments/production.rb files

I've just seen your edit, and went to the tutorial to see what was up. I could not find any references to configure either, so I went to look at some answers for you, and found this:

I resolved it by doing following step.

Step 1: go to app/config/initializers/development.rb

Change this line

Rails.application.configure do To

Your_Rails_Application_Folder_name::Application.configure do For example

My rails project folder name is 'Spree_demo' so **Your_Rails_Application_Folder_name**

in the following line

Your_Rails_Application_Folder_name::Application.configure do will replace as

SpreeDemo::Application.configure do Note: See underscore in your application folder name it gets removed.

Hope it works for you guys.

Community
  • 1
  • 1
Richard Peck
  • 76,116
  • 9
  • 93
  • 147
  • Thanks for the help. However I don't seem to have a `development.rb` file =/ – Liondancer Jun 19 '14 at 07:08
  • Which version of Rails are you using? Try in `config/environments/developent.rb` – Richard Peck Jun 19 '14 at 07:12
  • I am using Rails version 4.0.1 i believe. At least that is what it says in my Gemfile. Also when I type in the command `rvm -v` it says I have 1.25.27 (stable) not sure if this has anything to do with the error. I tried the edits and the same error occured =/ – Liondancer Jun 19 '14 at 07:19
  • You'd best typing `rails -v` in your CMD - you'll be getting back the `RVM` version otherwise :) Have you checked your `config/environments/development.rb`? – Richard Peck Jun 19 '14 at 08:14
  • I deleted the project and redid the ch 1 tutorial and it went smoothly . There must have been something I forgotten sorry for wasting your time. I really appreciate your help – Liondancer Jun 19 '14 at 08:17
  • lol it happens - glad you got it working again! You may want to accept my answer so no-one else answers, and future viewers will read this comments section for updates – Richard Peck Jun 19 '14 at 08:21
  • 1
    **You may want to accept my answer** Your answer didn't solve the op's problem, why should the op accept your answer? – 7stud Sep 23 '14 at 19:04