Rails application failed to start properly - not sure why - ruby-on-rails-3

I have a personal rails app running on DreamHost.com. It's been running fine, but I haven't been on it in a couple of weeks. Now, when I go to the site, I get the message, "Rails application failed to start properly". I ssh'd to my account and tried running a command from the terminal. I tried to enter the console in production mode and I tried running 'rake routes'. For both, I get the following output. I'm thinking it is a routes problem but I'm really not sure. I was hoping someone more into rails than I am might be able to tell if the problem is being reported to me and what it is.
Thanks for any assistance.
Here is what I'm running:
[coneflower]$ ruby -v
ruby 1.9.3p392 (2013-02-22 revision 39386) [x86_64-linux]
[coneflower]$ gem -v
1.8.25
[coneflower]$ rails -v
Rails 3.2.2
Error output:
[coneflower]$ rake routes
rake aborted!
missing :action
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.2/lib/action_dispatch/routing/mapper.rb:183:in `default_controller_and_action'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.2/lib/action_dispatch/routing/mapper.rb:76:in `normalize_options!'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.2/lib/action_dispatch/routing/mapper.rb:59:in `initialize'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.2/lib/action_dispatch/routing/mapper.rb:1302:in `new'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.2/lib/action_dispatch/routing/mapper.rb:1302:in `add_route'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.2/lib/action_dispatch/routing/mapper.rb:1282:in `decomposed_match'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.2/lib/action_dispatch/routing/mapper.rb:1268:in `block in match'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.2/lib/action_dispatch/routing/mapper.rb:1268:in `each'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.2/lib/action_dispatch/routing/mapper.rb:1268:in `match'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.2/lib/action_dispatch/routing/mapper.rb:258:in `root'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.2/lib/action_dispatch/routing/mapper.rb:1315:in `root'
/home/johndcow/rails/drywall/releases/20130306000519/config/routes.rb:2:in `block in <top (required)>'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.2/lib/action_dispatch/routing/route_set.rb:276:in `instance_exec'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.2/lib/action_dispatch/routing/route_set.rb:276:in `eval_block'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.2/lib/action_dispatch/routing/route_set.rb:254:in `draw'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.2/lib/active_support/dependencies.rb:245:in `load'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.2/lib/active_support/dependencies.rb:245:in `block in load'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.2/lib/active_support/dependencies.rb:236:in `load_dependency'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.2/lib/active_support/dependencies.rb:245:in `load'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.2/lib/rails/application/routes_reloader.rb:40:in `block in load_paths'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/railties- 3.2.2/lib/rails/application/routes_reloader.rb:40:in `each'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.2/lib/rails/application/routes_reloader.rb:40:in `load_paths'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.2/lib/rails/application/routes_reloader.rb:16:in `reload!'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.2/lib/rails/application/routes_reloader.rb:26:in `block in updater'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.2/lib/active_support/file_update_checker.rb:78:in `call'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.2/lib/active_support/file_update_checker.rb:78:in `execute'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.2/lib/rails/application/routes_reloader.rb:27:in `updater'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.2/lib/rails/application/routes_reloader.rb:7:in `execute_if_updated'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.2/lib/rails/application/finisher.rb:66:in `block in <module:Finisher>'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.2/lib/rails/initializable.rb:30:in `instance_exec'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.2/lib/rails/initializable.rb:30:in `run'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.2/lib/rails/initializable.rb:55:in `block in run_initializers'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.2/lib/rails/initializable.rb:54:in `each'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.2/lib/rails/initializable.rb:54:in `run_initializers'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.2/lib/rails/application.rb:136:in `initialize!'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.2/lib/rails/railtie/configurable.rb:30:in `method_missing'
/home/johndcow/rails/drywall/releases/20130306000519/config/environment.rb:5:in `<top (required)>'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.2/lib/rails/application.rb:103:in `require'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.2/lib/rails/application.rb:103:in `require_environment!'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.2/lib/rails/application.rb:292:in `block (2 levels) in initialize_tasks'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/bin/ruby_noexec_wrapper:14:in `eval'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/bin/ruby_noexec_wrapper:14:in `<main>'
Tasks: TOP => routes => environment
(See full trace by running task with --trace)
[coneflower]$
Routes File:
Drywall::Application.routes.draw do
resources :access, :only => :index
resources :users, :only => [:index, :new]
resources :payments
resources :materials
resources :hours
resources :jobs
resources :customer
resources :reports, :only => :index do
collection do
get :statement
end
end
# I removed the commented out examples here
#
# The priority is based upon order of creation:
# first created -> highest priority.
# See how all your routes lay out with "rake routes"
# This is a legacy wild controller route that's not recommended for RESTful applications.
# Note: This route will make all actions in every controller accessible via GET requests.
match ':controller(/:action(/:id))(.:format)'
end

That resources :access may be causing issues. It's known to break pluralization in rake in prod. mode. See http://bparanj.blogspot.no/2011/07/reserved-words-in-rails.html

Related

Impossible to use rake in my rails project

Every time I try to use rake in my rails project it throw me the message below. I tried to re-install ruby, rails, rake, re-create the project, launch my rake db:migrate with sudo but nothing seems to work...
I created the object via the scaffold command:
rails generate scaffold User nom:string email:string
After this command execute succesfully, i launch
rake db:migrate
And it return this message:
rake aborted!
GONE
/var/lib/gems/1.9.1/gems/railties-3.0.5/lib/rails/tasks/documentation.rake:1:in `require'
/var/lib/gems/1.9.1/gems/railties-3.0.5/lib/rails/tasks/documentation.rake:1:in `<top (required)>'
/var/lib/gems/1.9.1/gems/railties-3.0.5/lib/rails/tasks.rb:15:in `load'
/var/lib/gems/1.9.1/gems/railties-3.0.5/lib/rails/tasks.rb:15:in `block in <top (required)>'
/var/lib/gems/1.9.1/gems/railties-3.0.5/lib/rails/tasks.rb:6:in `each'
/var/lib/gems/1.9.1/gems/railties-3.0.5/lib/rails/tasks.rb:6:in `<top (required)>'
/var/lib/gems/1.9.1/gems/railties-3.0.5/lib/rails/application.rb:213:in `require'
/var/lib/gems/1.9.1/gems/railties-3.0.5/lib/rails/application.rb:213:in `initialize_tasks'
/var/lib/gems/1.9.1/gems/railties-3.0.5/lib/rails/application.rb:139:in `load_tasks'
/var/lib/gems/1.9.1/gems/railties-3.0.5/lib/rails/application.rb:77:in `method_missing'
/home/bassochette/Dev/rails/tuto/demo_app/Rakefile:7:in `<top (required)>'
(See full trace by running task with --trace)
ps: I'm new to rails and in the learning phase.

Rails 3.2 ActionMailer Demo Failing

I've been using rails 3 for quite a while, but I haven't had to use ActionMailer until now. I followed the guide and expected it to work out of the box. However, it appears that I've hit some error that lies deeply inside internal rails code. Unfortunately, I can't find any mention of this error, which I'm guessing must be do to configuration.
My mailer class is:
class UserMailer < ActionMailer::Base
default :from => "notifications#example.com"
def welcome_email
#url = "http://example.com/login"
mail(:to => "test#example.com", :subject => "Welcome to My Awesome Site")
end
end
When I try to use the mailer I get:
UserMailer.welcome_email
NoMethodError: undefined method `protected_instance_variables=' for ActionController::Base:Class
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.2.1/lib/action_controller/metal/compatibility.rb:22:in `block in <module:Compatibility>'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.1/lib/active_support/concern.rb:117:in `class_eval'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.1/lib/active_support/concern.rb:117:in `append_features'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.2.1/lib/action_controller/base.rb:232:in `include'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.2.1/lib/action_controller/base.rb:232:in `<class:Base>'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.2.1/lib/action_controller/base.rb:171:in `<module:ActionController>'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.2.1/lib/action_controller/base.rb:3:in `<top (required)>'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.2.1/lib/action_view/test_case.rb:11:in `<class:TestCase>'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.2.1/lib/action_view/test_case.rb:10:in `<module:ActionView>'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.2.1/lib/action_view/test_case.rb:8:in `<top (required)>'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/prototype-rails-3.2.1/lib/prototype-rails/on_load_action_view.rb:17:in `<top (required)>'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:251:in `require'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:251:in `block in require'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:234:in `block in load_dependency'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:639:in `new_constants_in'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:234:in `load_dependency'
... 23 levels...
from /users/user/Documents/element/app/mailers/user_mailer.rb:1:in `<top (required)>'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:469:in `load'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:469:in `block in load_file'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:639:in `new_constants_in'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:468:in `load_file'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:353:in `require_or_load'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:502:in `load_missing_constant'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:192:in `block in const_missing'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:190:in `each'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:190:in `const_missing'
from (irb):1
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.2.1/lib/rails/commands/console.rb:47:in `start'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.2.1/lib/rails/commands/console.rb:8:in `start'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.2.1/lib/rails/commands.rb:41:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
I'm using rails 3.2.1. I saw some mention of protected_instance_variables= being deprecated, which could maybe explain why it isn't defined for ActionController::Base. But, that seems like it would be a rails bug, and I would imagine that ActionMailer has been well tested. Anyone have any ideas?
Thanks
I had experienced a similar error on starting my rails 3.2.1 application--removing the prototype-rails gem solved it for me.
Of course I happen to be using prototype, so there is now a different problem to address.

Error - uninitialized constant Devise::IndifferentHash (NameError)

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.

Undefined method `omniauth' for Devise:Module (devise, omniauth, heroku, rails 3.0.3)

I have an app that uses Amazon Product Advertising API at local with no issues. In order to push it to Heroku, I have to change the version of the aws gem I use to make it work with Heroku ("treyconnell-ruby-aaws" v0.8.3) and that version limits me to Rails 3.0.3 and to devise v1.1.8 gems.
When I downgrade gems and 'bundle update', something breaks even at local, guessing omniauth and devise start fighting. The server fail to starts with the following error log.
I tried many different configurations of loading omniauth gem, oa-auth, requiring omniauth/oauth etc, still the same error. What might be the issue here?
PS. I have to use this aws gem for now.
/Users/eerdogan/Sites/myApp/config/initializers/devise.rb:17: undefined method `omniauth' for Devise:Module (NoMethodError)
from /Library/Ruby/Gems/1.8/gems/devise-1.1.8/lib/devise.rb:183:in `setup'
from /Users/eerdogan/Sites/myApp/config/initializers/devise.rb:3
from /Library/Ruby/Gems/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:235:in `load'
from /Library/Ruby/Gems/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:235:in `load'
from /Library/Ruby/Gems/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:225:in `load_dependency'
from /Library/Ruby/Gems/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:596:in `new_constants_in'
from /Library/Ruby/Gems/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:225:in `load_dependency'
from /Library/Ruby/Gems/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:235:in `load'
from /Library/Ruby/Gems/1.8/gems/railties-3.0.3/lib/rails/engine.rb:201
from /Library/Ruby/Gems/1.8/gems/railties-3.0.3/lib/rails/engine.rb:200:in `each'
from /Library/Ruby/Gems/1.8/gems/railties-3.0.3/lib/rails/engine.rb:200
from /Library/Ruby/Gems/1.8/gems/railties-3.0.3/lib/rails/initializable.rb:25:in `instance_exec'
from /Library/Ruby/Gems/1.8/gems/railties-3.0.3/lib/rails/initializable.rb:25:in `run'
from /Library/Ruby/Gems/1.8/gems/railties-3.0.3/lib/rails/initializable.rb:50:in `run_initializers'
from /Library/Ruby/Gems/1.8/gems/railties-3.0.3/lib/rails/initializable.rb:49:in `each'
from /Library/Ruby/Gems/1.8/gems/railties-3.0.3/lib/rails/initializable.rb:49:in `run_initializers'
from /Library/Ruby/Gems/1.8/gems/railties-3.0.3/lib/rails/application.rb:134:in `initialize!'
from /Library/Ruby/Gems/1.8/gems/railties-3.0.3/lib/rails/application.rb:77:in `send'
from /Library/Ruby/Gems/1.8/gems/railties-3.0.3/lib/rails/application.rb:77:in `method_missing'
from /Users/eerdogan/Sites/myApp/config/environment.rb:5
from /Library/Ruby/Gems/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:239:in `require'
from /Library/Ruby/Gems/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:239:in `require'
from /Library/Ruby/Gems/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:225:in `load_dependency'
from /Library/Ruby/Gems/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:596:in `new_constants_in'
from /Library/Ruby/Gems/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:225:in `load_dependency'
from /Library/Ruby/Gems/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:239:in `require'
from /Users/eerdogan/Sites/myApp/config.ru:3
from /Library/Ruby/Gems/1.8/gems/rack-1.2.4/lib/rack/builder.rb:46:in `instance_eval'
from /Library/Ruby/Gems/1.8/gems/rack-1.2.4/lib/rack/builder.rb:46:in `initialize'
from /Users/eerdogan/Sites/myApp/config.ru:1:in `new'
from /Users/eerdogan/Sites/myApp/config.ru:1
Edit: here is the devise.rb file:
# Use this hook to configure devise mailer, warden hooks and so forth. The first
# four configuration values can also be set straight in your models.
Devise.setup do |config|
config.mailer_sender = "please-change-me-at-config-initializers-devise#example.com"
require 'devise/orm/active_record'
config.omniauth :facebook, "1*************", "3******************************"
config.case_insensitive_keys = [ :email ]
config.stretches = 10
config.use_salt_as_remember_token = true
config.reset_password_within = 2.hours
end
I think the config.facebook line in devise.rb is causing you the grief.
I took a look at my devise.rb and I also have another file called omniauth.rb.
(1) My devise.rb does not have the config.facebook line. Try removing that and see if it works.
(2) I have a file called omniauth.rb, located in the same directory as devise.rb. I'm pasting it below:
require 'openid/store/filesystem'
Rails.application.config.middleware.use OmniAuth::Builder do
case Rails.env
when "development"
provider :facebook, 'XXX', 'XXXX' , {:scope => 'manage_pages,publish_stream,offline_access,email'}
when "production"
provider :facebook, 'XXX', 'XXXX', {:scope => 'manage_pages,publish_stream,offline_access,email', :client_options => {:ssl => {:ca_file => '/usr/lib/ssl/certs/ca-certificates.crt'}}}
end
end
See if this works out for you. :)

Why is my development server not loading? default_controller_and_action': missing :action (ArgumentError)

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.