I got this error when I start my project with memcache (gem) and rails 3.0.0beta
Here's the full trace:
/Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/activesupport-3.0.0.beta4/lib/active_support/cache/mem_cache_store.rb:39:in `build_mem_cache': uninitialized constant ActiveSupport::Cache::MemCacheStore::MemCache (NameError)
from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/activesupport-3.0.0.beta4/lib/active_support/cache/mem_cache_store.rb:65:in `initialize'
from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/activesupport-3.0.0.beta4/lib/active_support/cache.rb:64:in `new'
from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/activesupport-3.0.0.beta4/lib/active_support/cache.rb:64:in `lookup_store'
from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/railties-3.0.0.beta4/lib/rails/application/bootstrap.rb:47
from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/activesupport-3.0.0.beta4/lib/active_support/core_ext/kernel/reporting.rb:11:in `silence_warnings'
from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/activesupport-3.0.0.beta4/lib/active_support/core_ext/kernel/reporting.rb:22:in `with_warnings'
from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/activesupport-3.0.0.beta4/lib/active_support/core_ext/kernel/reporting.rb:11:in `silence_warnings'
from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/railties-3.0.0.beta4/lib/rails/application/bootstrap.rb:47
from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/railties-3.0.0.beta4/lib/rails/initializable.rb:25:in `instance_exec'
from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/railties-3.0.0.beta4/lib/rails/initializable.rb:25:in `run'
from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/railties-3.0.0.beta4/lib/rails/initializable.rb:55:in `run_initializers'
from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/railties-3.0.0.beta4/lib/rails/initializable.rb:54:in `each'
from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/railties-3.0.0.beta4/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/railties-3.0.0.beta4/lib/rails/application.rb:119:in `initialize!'
from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/railties-3.0.0.beta4/lib/rails/application.rb:81:in `send'
from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/railties-3.0.0.beta4/lib/rails/application.rb:81:in `method_missing'
from /Users/netbe/Projects/banana/config/environment.rb:5
from config.ru:3:in `require'
from config.ru:3
from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/rack-1.1.0/lib/rack/builder.rb:46:in `instance_eval'
from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/rack-1.1.0/lib/rack/builder.rb:46:in `initialize'
from config.ru:1:in `new'
from config.ru:1
Here's some code from my environment.rb, line #5 : module Cache
require 'active_support/cache'
module ActiveSupport
module Cache
class MemCacheStore < Store
def logger
Rails.logger
end
end
end
end
Is there anyone who can guess what's wrong here, is it a rails 3 issue?
actually you have not added gem "memcache-client" to your Gemfile, apparently you only have gem "memcache"
I think my answer is too late :) But may be it's help somebody. I've got same error and the problem was in name of the file in lib/memcache.rb directory. After renaming it, project started as usual.
Related
I am having some troubles with my Rails environment - running a command like:
$ rails generate scaffold_controller model_name
results in the following trace:
/Users/me/.rvm/gems/ruby-1.9.3-p392#myproject/gems/railties-3.2.13/lib/rails/generators/generated_attribute.rb:13:in `parse': undefined method `split' for :clear:Symbol (NoMethodError)
from /Users/me/.rvm/gems/ruby-1.9.3-p392#myproject/gems/railties-3.2.13/lib/rails/generators/named_base.rb:161:in `block in parse_attributes!'
from /Users/me/.rvm/gems/ruby-1.9.3-p392#myproject/gems/railties-3.2.13/lib/rails/generators/named_base.rb:160:in `map'
from /Users/me/.rvm/gems/ruby-1.9.3-p392#myproject/gems/railties-3.2.13/lib/rails/generators/named_base.rb:160:in `parse_attributes!'
from /Users/me/.rvm/gems/ruby-1.9.3-p392#myproject/gems/railties-3.2.13/lib/rails/generators/named_base.rb:21:in `initialize'
from /Users/me/.rvm/gems/ruby-1.9.3-p392#myproject/gems/railties-3.2.13/lib/rails/generators/resource_helpers.rb:18:in `initialize'
from /Users/me/.rvm/gems/ruby-1.9.3-p392#myproject/gems/thor-0.18.1/lib/thor/group.rb:227:in `new'
from /Users/me/.rvm/gems/ruby-1.9.3-p392#myproject/gems/thor-0.18.1/lib/thor/group.rb:227:in `dispatch'
from /Users/me/.rvm/gems/ruby-1.9.3-p392#myproject/gems/thor-0.18.1/lib/thor/base.rb:439:in `start'
from /Users/me/.rvm/gems/ruby-1.9.3-p392#myproject/gems/railties-3.2.13/lib/rails/generators.rb:171:in `invoke'
from /Users/me/.rvm/gems/ruby-1.9.3-p392#myproject/gems/railties-3.2.13/lib/rails/commands/generate.rb:12:in `<top (required)>'
from /Users/me/.rvm/gems/ruby-1.9.3-p392#myproject/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
from /Users/me/.rvm/gems/ruby-1.9.3-p392#myproject/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
from /Users/me/.rvm/gems/ruby-1.9.3-p392#myproject/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
from /Users/me/.rvm/gems/ruby-1.9.3-p392#myproject/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
from /Users/me/.rvm/gems/ruby-1.9.3-p392#myproject/gems/railties-3.2.13/lib/rails/commands.rb:29:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
As nothing in the trace seems to even be from my specific project, I'm a little stumped as to what could be going on. As you can see, I'm running rails 3.2.13 on an rvm-installed ruby 1.9.3.
Any ideas?
I had the same problem. it turns out that I had following line somewhere in my code.
include Term::ANSIColor
This code is needed for colorised Term output. But it is fine to comment it out temporarily when you need to generate or destroy scaffolds. The method or symbol 'clear' conflicts with other gems. So this probably fixes rake:erd as well.
I'm on Ruby 1.9.3 and Rails 3.0.11. I recently installed Draper(0.12.0) gem, but I'm unable to run its generators. I get the following error when I try to run the generator on the Post model :-
rails generate decorator Post
/home/mohnish/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.11/lib/active_support/whiny_nil.rb:48:in `method_missing': undefined method `config' for nil:NilClass (NoMethodError)
from /home/mohnish/.rvm/gems/ruby-1.9.3-p194/gems/draper-0.12.0/lib/draper/railtie.rb:6:in `block in <class:Railtie>'
from /home/mohnish/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.11/lib/rails/railtie.rb:189:in `call'
from /home/mohnish/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.11/lib/rails/railtie.rb:189:in `each'
from /home/mohnish/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.11/lib/rails/railtie.rb:189:in `load_generators'
from /home/mohnish/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.11/lib/rails/application.rb:147:in `block in load_generators'
from /home/mohnish/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.11/lib/rails/application/railties.rb:11:in `each'
from /home/mohnish/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.11/lib/rails/application/railties.rb:11:in `all'
from /home/mohnish/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.11/lib/rails/application.rb:147:in `load_generators'
from /home/mohnish/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.11/lib/rails/generators.rb:319:in `load_generators_from_railties!'
from /home/mohnish/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.11/lib/rails/generators.rb:278:in `lookup'
from /home/mohnish/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.11/lib/rails/generators.rb:141:in `find_by_namespace'
from /home/mohnish/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.11/lib/rails/generators.rb:161:in `invoke'
from /home/mohnish/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.11/lib/rails/commands/generate.rb:10:in `<top (required)>'
from /home/mohnish/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.11/lib/active_support/dependencies.rb:239:in `require'
from /home/mohnish/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.11/lib/active_support/dependencies.rb:239:in `block in require'
from /home/mohnish/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.11/lib/active_support/dependencies.rb:225:in `block in load_dependency'
from /home/mohnish/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.11/lib/active_support/dependencies.rb:593:in `new_constants_in'
from /home/mohnish/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.11/lib/active_support/dependencies.rb:225:in `load_dependency'
from /home/mohnish/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.11/lib/active_support/dependencies.rb:239:in `require'
from /home/mohnish/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.11/lib/rails/commands.rb:17:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
Any inputs, on how can I debug this would be really helpful.
Thank you.
The Problem is this section in v0.12.0 (the one you are using) https://github.com/drapergem/draper/blob/v0.12.0/lib/draper/railtie.rb#L5-L8
When I look at the master branch they changed to code to look like: https://github.com/drapergem/draper/blob/master/lib/draper/railtie.rb#L5-L10
You should upgrade your draper gem to the latest release and see if the error still occurs.
working in rails, and am trying the command 'rails g spree:site' as described in section 4.5 of the Spree getting Started Guide. not sure what the problem is, I am running rails 3.1.1.rc2 on a windows 7 platform. The error is below.
C:/Ruby192/lib/ruby/gems/1.9.1/gems/spree_auth-0.40.0/lib/spree_auth.rb:17:in `a
ctivate': uninitialized constant Devise::IndifferentHash (NameError)
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.1.1.rc2/lib/act
ive_support/callbacks.rb:413:in `_run_prepare_callbacks'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.1.1.rc2/lib/act
ive_support/callbacks.rb:81:in `run_callbacks'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/actionpack-3.1.1.rc2/lib/action
_dispatch/middleware/reloader.rb:46:in `prepare!'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.1.rc2/lib/rails/ap
plication/finisher.rb:41:in `block in <module:Finisher>'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.1.rc2/lib/rails/in
itializable.rb:29:in `instance_exec'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.1.rc2/lib/rails/in
itializable.rb:29:in `run'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.1.rc2/lib/rails/in
itializable.rb:54:in `block in run_initializers'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.1.rc2/lib/rails/in
itializable.rb:53:in `each'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.1.rc2/lib/rails/in
itializable.rb:53:in `run_initializers'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.1.rc2/lib/rails/ap
plication.rb:96:in `initialize!'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.1.rc2/lib/rails/ra
iltie/configurable.rb:30:in `method_missing'
from C:/Users/Edu/RubymineProjects/myStore/config/environment.rb:5:in `<
top (required)>'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.1.rc2/lib/rails/ap
plication.rb:83:in `require_environment!'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.1.rc2/lib/rails/co
mmands.rb:22:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
I had the same problem with rails 3.1. The solution was to put the following lines in my GEMFILE:
# ===:git with the repository's url that works=== #
gem 'spree', :git => 'git://github.com/spree/spree.git'
This should help in your case, too.
#jhsilva007 : Specifying this line ( gem 'spree', :git => 'git://github.com/spree/spree.git' )
definitely helped me resolving of error.
I think this line will get the latest version of the spree from github. What if I just want the particular version number of spree. I mean I don't like to get the beta version.
I have a problem with setting up rails application. We use rails 3 (we also use memcached), and have I installed everthing (DB, ruby, rubygems, rails, ...) and configure the DB. So if I run rails server the apllication starts ok.
For production we will use Apache and Phusion Passenger, both have been installed sucessfuly. When I restart apache I get this error:
*
[ pid=1557 thr=-608134948 file=utils.rb:176 time=2011-08-13 12:51:05.974 ]: *** Exception NameError in PhusionPassenger::Rack::ApplicationSpawner (undefined local variable or method `application_controller' for main:Object) (process 1557, thread #<Thread:0xb78131b8>):
from /media/Disc/ABC/CODE/TESTINGAPP/app/controllers/application.rb:1
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:239:in `require'
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:239:in `require'
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:227:in `load_dependency'
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:239:in `require'
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:346:in `require_or_load'
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:300:in `depend_on'
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:216:in `require_dependency'
from /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/engine.rb:138:in `eager_load!'
from /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/engine.rb:137:in `each'
from /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/engine.rb:137:in `eager_load!'
from /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/engine.rb:135:in `each'
from /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/engine.rb:135:in `eager_load!'
from /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/application.rb:108:in `eager_load!'
from /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/application/finisher.rb:41
from /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/initializable.rb:25:in `instance_exec'
from /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/initializable.rb:25:in `run'
from /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/initializable.rb:50:in `run_initializers'
from /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/initializable.rb:49:in `each'
from /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/initializable.rb:49:in `run_initializers'
from /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/application.rb:134:in `initialize!'
from /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/application.rb:77:in `send'
from /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/application.rb:77:in `method_missing'
from /media/Disc/ABC/CODE/TESTINGAPP/config/environment.rb:5
from config.ru:3:in `require'
from config.ru:3
from /usr/lib/ruby/gems/1.8/gems/rack-1.2.1/lib/rack/builder.rb:46:in `instance_eval'
from /usr/lib/ruby/gems/1.8/gems/rack-1.2.1/lib/rack/builder.rb:46:in `initialize'
from config.ru:1:in `new'
from config.ru:1
*
First I thought that it might be sometnig with memcached, like some missing module for apache, but I read that there is no configuration needed for apache/passenger.
My question is, why application doesn't start? Have I forgot to install or configure someting? I really don't know what might be wronge since the application starts ok with rails server.
Tnx in advance ;)
Look at this file:
/media/Disc/ABC/CODE/TESTINGAPP/app/controllers/application.rb
Since Rails 2.3 this file should be called application_controller.rb and not application.rb. Rename the file and it should work:
/media/Disc/ABC/CODE/TESTINGAPP/app/controllers/application_controller.rb
I'm a Ruby nuby (and new to Stack Overflow) working on the Rails Tutorial by Michael Hartl and all of a sudden my development server won't load and keeps exiting. Console also won't load and Rspec spec/ produces errors/exceptions. I am including some output from the terminal, your help is much appreciated.
Exiting
/Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/actionpack-3.0.3/lib/action_dispatch/routing/mapper.rb:164:in `default_controller_and_action': missing :action (ArgumentError)
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/actionpack-3.0.3/lib/action_dispatch/routing/mapper.rb:68:in `normalize_options!'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/actionpack-3.0.3/lib/action_dispatch/routing/mapper.rb:51:in `initialize'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/actionpack-3.0.3/lib/action_dispatch/routing/mapper.rb:261:in `new'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/actionpack-3.0.3/lib/action_dispatch/routing/mapper.rb:261:in `match'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/actionpack-3.0.3/lib/action_dispatch/routing/mapper.rb:1112:in `match'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/actionpack-3.0.3/lib/action_dispatch/routing/mapper.rb:1297:in `match'
from /Users/ameedachowdhury/rails_projects/railstutorial/config/routes.rb:11:in `block in <top (required)>'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/actionpack-3.0.3/lib/action_dispatch/routing/route_set.rb:233:in `instance_exec'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/actionpack-3.0.3/lib/action_dispatch/routing/route_set.rb:233:in `draw'
from /Users/ameedachowdhury/rails_projects/railstutorial/config/routes.rb:1:in `<top (required)>'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:235:in `load'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:235:in `block in load'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:225:in `block in load_dependency'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:596:in `new_constants_in'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:225:in `load_dependency'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:235:in `load'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/railties-3.0.3/lib/rails/application.rb:127:in `block in reload_routes!'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/railties-3.0.3/lib/rails/application.rb:127:in `each'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/railties-3.0.3/lib/rails/application.rb:127:in `reload_routes!'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/railties-3.0.3/lib/rails/application.rb:120:in `block in routes_reloader'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/activesupport-3.0.3/lib/active_support/file_update_checker.rb:32:in `call'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/activesupport-3.0.3/lib/active_support/file_update_checker.rb:32:in `execute_if_updated'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/railties-3.0.3/lib/rails/application/finisher.rb:51:in `block (2 levels) in <module:Finisher>'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/railties-3.0.3/lib/rails/application/finisher.rb:52:in `call'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/railties-3.0.3/lib/rails/application/finisher.rb:52:in `block in <module:Finisher>'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/railties-3.0.3/lib/rails/initializable.rb:25:in `instance_exec'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/railties-3.0.3/lib/rails/initializable.rb:25:in `run'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/railties-3.0.3/lib/rails/initializable.rb:50:in `block in run_initializers'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/railties-3.0.3/lib/rails/initializable.rb:49:in `each'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/railties-3.0.3/lib/rails/initializable.rb:49:in `run_initializers'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/railties-3.0.3/lib/rails/application.rb:134:in `initialize!'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/railties-3.0.3/lib/rails/application.rb:77:in `method_missing'
from /Users/ameedachowdhury/rails_projects/railstutorial/config/environment.rb:5:in `<top (required)>'
from /Users/ameedachowdhury/rails_projects/railstutorial/config.ru:3:in `require'
from /Users/ameedachowdhury/rails_projects/railstutorial/config.ru:3:in `block in <main>'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/rack-1.2.1/lib/rack/builder.rb:46:in `instance_eval'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/rack-1.2.1/lib/rack/builder.rb:46:in `initialize'
from /Users/ameedachowdhury/rails_projects/railstutorial/config.ru:1:in `new'
from /Users/ameedachowdhury/rails_projects/railstutorial/config.ru:1:in `<main>'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/rack-1.2.1/lib/rack/builder.rb:35:in `eval'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/rack-1.2.1/lib/rack/builder.rb:35:in `parse_file'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/rack-1.2.1/lib/rack/server.rb:162:in `app'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/rack-1.2.1/lib/rack/server.rb:248:in `wrapped_app'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/rack-1.2.1/lib/rack/server.rb:213:in `start'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/railties-3.0.3/lib/rails/commands/server.rb:65:in `start'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/railties-3.0.3/lib/rails/commands.rb:30:in `block in <top (required)>'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/railties-3.0.3/lib/rails/commands.rb:27:in `tap'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/railties-3.0.3/lib/rails/commands.rb:27:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
ameeda-chowdhurys-macbook:railstutorial ameedachowdhury$
When I ran into this problem, it was because one of the routes in routes.rb had a slash (/) instead of the hash (#) when using the controller#action syntax (I used "controller/action", which was incorrect).
For example, I accidentally had root :to => 'home/index'. It was supposed to be root :to => 'home#index'.
I found this solution in here.
This is caused by incorrect routes -
Please check your config/routes.rb , even if one route mentioned is wrong then this error is thrown !!
Also make sure that the route is
'/url/for/something' => 'controller#action'
or
root :to => 'controller#action
I'm also a Ruby nuby and had the same error while working on the Rails Tutorial by Michael Hartl. If you're like me, you might be just typing in all code that appears in the book with really reading or understanding the text. Not everything is step by step. In demonstrating camel case vs. snake case Hartl shows a box with the following code
$ rails generate controller static_pages ...
Here, Hartl is simply trying to contrast instructions to generate a StaticPages controller using snake case, rather than camel case, which was done in Listing 3.4. The dots "..." are simply to edit out or truncate the rest of the instructions for the cmd line. I typed in exactly what was shown and wound up with the following in my routes file:
SampleApp::Application.routes.draw do
get "static_pages/..."
get "static_pages/home"
get "static_pages/help"
open up your routes file, delete
get "static_pages/..."
save the routes file, and try starting rails server again.
I also destroyed "rails generate controller static_pages ..." Not sure if that had any effect, but now everything works.
By default you get this:
Rails.application.routes.draw do
get 'static_pages/...'
get 'static_pages/home'
get 'static_pages/help'
JUST ERASE THIS:
get 'static_pages/...'
AND YOU WILL HAVE THIS IN THE ROUTES.RB FILE
Rails.application.routes.draw do
get 'static_pages/home'
get 'static_pages/help'
In my case it was caused by the suffix slash '/' in some of my routes. E.g.
post 'load_query/'
After removing this suffix to
post 'load_query'
it worked.
change your default root in the routes.rb file.
get "static_pages#home" TO root to: 'static_pages#home'
I've gone through the same issue, and the above change worked for me.