I am trying to add a new Action Mailer to my app and when I navigated to connections/new I received this error message:
Circular dependency detected while autoloading constant
ConnectionsController
full trace
activesupport (4.1.0) lib/active_support/dependencies.rb:478:in `load_missing_constant'
activesupport (4.1.0) lib/active_support/dependencies.rb:180:in `const_missing'
activesupport (4.1.0) lib/active_support/inflector/methods.rb:238:in `const_get'
activesupport (4.1.0) lib/active_support/inflector/methods.rb:238:in `block in constantize'
activesupport (4.1.0) lib/active_support/inflector/methods.rb:236:in `each'
activesupport (4.1.0) lib/active_support/inflector/methods.rb:236:in `inject'
activesupport (4.1.0) lib/active_support/inflector/methods.rb:236:in `constantize'
activesupport (4.1.0) lib/active_support/dependencies.rb:552:in `get'
activesupport (4.1.0) lib/active_support/dependencies.rb:583:in `constantize'
actionpack (4.1.0) lib/action_dispatch/routing/route_set.rb:76:in `controller_reference'
actionpack (4.1.0) lib/action_dispatch/routing/route_set.rb:66:in `controller'
actionpack (4.1.0) lib/action_dispatch/routing/route_set.rb:44:in `call'
actionpack (4.1.0) lib/action_dispatch/journey/router.rb:71:in `block in call'
actionpack (4.1.0) lib/action_dispatch/journey/router.rb:59:in `each'
actionpack (4.1.0) lib/action_dispatch/journey/router.rb:59:in `call'
actionpack (4.1.0) lib/action_dispatch/routing/route_set.rb:676:in `call'
warden (1.2.4) lib/warden/manager.rb:35:in `block in call'
warden (1.2.4) lib/warden/manager.rb:34:in `catch'
warden (1.2.4) lib/warden/manager.rb:34:in `call'
rack (1.5.5) lib/rack/etag.rb:23:in `call'
rack (1.5.5) lib/rack/conditionalget.rb:25:in `call'
rack (1.5.5) lib/rack/head.rb:11:in `call'
actionpack (4.1.0) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
actionpack (4.1.0) lib/action_dispatch/middleware/flash.rb:254:in `call'
rack (1.5.5) lib/rack/session/abstract/id.rb:225:in `context'
rack (1.5.5) lib/rack/session/abstract/id.rb:220:in `call'
actionpack (4.1.0) lib/action_dispatch/middleware/cookies.rb:560:in `call'
activerecord (4.1.0) lib/active_record/query_cache.rb:36:in `call'
activerecord (4.1.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:621:in `call'
activerecord (4.1.0) lib/active_record/migration.rb:380:in `call'
actionpack (4.1.0) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.1.0) lib/active_support/callbacks.rb:82:in `run_callbacks'
actionpack (4.1.0) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (4.1.0) lib/action_dispatch/middleware/reloader.rb:73:in `call'
actionpack (4.1.0) lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
rollbar (2.4.0) lib/rollbar/middleware/rails/rollbar.rb:24:in `block in call'
rollbar (2.4.0) lib/rollbar.rb:842:in `scoped'
rollbar (2.4.0) lib/rollbar/middleware/rails/rollbar.rb:22:in `call'
actionpack (4.1.0) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
rollbar (2.4.0) lib/rollbar/middleware/rails/show_exceptions.rb:22:in `call_with_rollbar'
actionpack (4.1.0) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.1.0) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.1.0) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.1.0) lib/active_support/tagged_logging.rb:68:in `block in tagged'
activesupport (4.1.0) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (4.1.0) lib/active_support/tagged_logging.rb:68:in `tagged'
railties (4.1.0) lib/rails/rack/logger.rb:20:in `call'
actionpack (4.1.0) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.5.5) lib/rack/methodoverride.rb:21:in `call'
rack (1.5.5) lib/rack/runtime.rb:17:in `call'
activesupport (4.1.0) lib/active_support/cache/strategy/local_cache_middleware.rb:26:in `call'
rack (1.5.5) lib/rack/lock.rb:17:in `call'
actionpack (4.1.0) lib/action_dispatch/middleware/static.rb:64:in `call'
rack (1.5.5) lib/rack/sendfile.rb:112:in `call'
railties (4.1.0) lib/rails/engine.rb:514:in `call'
railties (4.1.0) lib/rails/application.rb:144:in `call'
rack (1.5.5) lib/rack/lock.rb:17:in `call'
rack (1.5.5) lib/rack/content_length.rb:14:in `call'
rack (1.5.5) lib/rack/handler/webrick.rb:60:in `service'
/usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/webrick/httpserver.rb:138:in `service'
/usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/webrick/httpserver.rb:94:in `run'
/usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/webrick/server.rb:294:in `block in start_thread'
controllers/connections_controller.rb
class ConnectionionsController < ApplicationController
def new
#connection = connection.new
end
def create
#connection = Connection.new(connection_params)
if #connection.save
name = params[:connection][:your_name]
email = params[:connection][:email]
body = params[:connection][:mentors_name, :mentees_name]
connectionMailer.connection_email(name, email, body).deliver
flash[:success] = "Message sent. Someone at Jr. Dev Mentoring will respond to your message soon. Thank you."
redirect_to new_connection_path
else
flash[:danger] = "Error occured, message has not been sent. You must complete all form fields"
redirect_to new_connection_path
end
end
private
def connection_params
params.require(:connection).permit(:your_name, :email, :mentors_name, :mentees_name)
end
end
mailers/connection_mailer.rb
class ConnectionsMailer < ActionMailer::Base
default to: 'info#jrdevmentoring.com'
def connection_email(name, email, body)
#name = name
#email = email
#body = body
mail(from: email, subject: 'Jr. Dev Mentoring Connect Form Message')
end
end
models/connection.rb
class Connection < ActiveRecord::Base
validates :your_name, presence: true
validates :email, presence: true
end
views/connections/new.html.erb
<div class="row">
<div class="col-md-4 col-md-offset-4">
<h1 class="text-center">Let's Connect</h1>
<p class="text-center">I'd like to connect</p>
<div class="well">
<%= form_for #connection do |f| %>
<div class="form-group">
<%= f.label :your_name %>
<%= f.text_field :your_name, class: 'form-control' %>
</div>
<div class="form-group">
<%= f.label :email %>
<%= f.email_field :email, class: 'form-control' %>
</div>
<div class="form-group, 'Mentors Name'">
<%= f.label :comments %>
<%= f.text_area :mentors_name, class: 'form-control' %>
</div>
<div class="form-group, 'Mentees Name'">
<%= f.label :comments %>
<%= f.text_area :mentees_name, class: 'form-control' %>
</div>
<%= f.submit 'Submit', class: 'btn btn-default' %>
<% end %>
</div>
</div>
</div>
views/connection_mailer/connection_email.html.erb
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<p>You have received a message from the Jr. Dev Mentoring site's connect form, from <%= "#{ #name }, #{ #email }." %></p>
<p><%= #body %></p>
</body>
</html>
db/migrate
class CreateConnections < ActiveRecord::Migration
def change
create_table :connections do |t|
t.string :your_name
t.string :email
t.text :mentors_name
t.text :mentees_name
t.timestamps
end
schema
create_table "connections", force: true do |t|
t.string "your_name"
t.string "email"
t.text "mentors_name"
t.text "mentees_name"
t.datetime "created_at"
t.datetime "updated_at"
end
routes
Rails.application.routes.draw do
devise_for :users,:controllers => { :registrations => "users/registrations" }
resources :users do
resource :profile
end
resources :connections
resources :contacts
get '/about' => 'pages#about'
namespace :mentee do
root 'pages#home'
get '/mentor_profiles' => 'profiles#mentor_profiles'
end
namespace :mentor do
root 'pages#home'
get '/mentee_profiles' => 'profiles#mentee_profiles'
end
root 'pages#home'
I found several spelling and capitalization errors in my connections_controller.rb file
replaced class ConnectionionsController < ApplicationController with class ConnectionsController < ApplicationController
replaced #connection = connection.new with #connection = Connection.new
replaced connectionMailer.connection_email(name, email, body).deliver with ConnectionMailer.connection_email(name, email, body).deliver
Related
I've set up the impressionist gem in my Film model. It has been working fine, updating the impressions count, but suddenly I've been receiving the following error when trying to GET the Films#Show page.
undefined method `cookie_value' for "60cb104e4befe185a8b81aac9a2c5e3c":String
It seems like it has something to do with the session_hash, but not sure how to solve this issue.
Does anyone have any ideas?
Here is my Film model:
class Film < ApplicationRecord
acts_as_votable
is_impressionable
mount_uploader :cover, ImageUploader
mount_uploader :video, VideoUploader
mount_uploader :trailer, VideoUploader
def score
self.get_upvotes.size - self.get_downvotes.size
end
extend FriendlyId
friendly_id :title, use: :slugged
# one film has many reviews
has_many :reviews, dependent: :destroy
validates :title, presence: true
validates :author, presence: true
validates :cover, presence: true
validates :description, presence: true
end
Films show page
<%= render "shared/ticker" %>
<div class="back-to-films">
<%= link_to films_path do %>
<span><%= image_tag "BackArrow1.svg" %> </span><h3 class="back-to-gallery">Back to film gallery</h3>
<% end %>
</div>
<section class="film-show-grid">
<div class="film-show-img" onclick="toggle();">
<%= image_tag #film.cover.show.url %>
</div>
<div class="film-show-info">
<span><% if #film.is_top_pick %>
<%= image_tag "is_featured.svg", :class => "top-pick-show" %>
<% end %></span>
<span class="liking-target">
<%= link_to like_film_path(#film), class: "upvoted {liked_or_not}", method: :put, remote: :true do %>
<%= image_tag "Polygon2.svg", :class => "polygon" %>
<% end %>
<span class="like_count">
<%= #film.get_likes.size %>
</span>
</span>
<span class="views">
<%= image_tag "view.svg", :class => "eyeball" %>
<span class="impressions"><%= #film.impressionist_count(:filter=>:ip_address) %></span>
</span>
<div class="">
<h2 class="film-title"><%= #film.title %></h2>
<h6 class="film-author"><%= #film.author %></h6> <span><%= #film.description %></span>
<p class="film-description"><%= #film.description_body %></p>
</div>
<div class="play-button" onclick="toggle();">
<span> Play </span> <%= image_tag "play.svg", :class => "play-symbol" %>
</div>
<div class="preview-button" onclick="toggleTrailer();">
Trailer
</div>
<%= link_to film_reviews_path(#film) do %>
<div class="cafe-talk-button">
Café talk
</div>
<% end %>
And my full stack trace
impressionist (2.0.0) app/controllers/impressionist_controller.rb:143:in `session_hash'
impressionist (2.0.0) app/controllers/impressionist_controller.rb:60:in `associative_create_statement'
impressionist (2.0.0) app/controllers/impressionist_controller.rb:27:in `impressionist'
app/controllers/films_controller.rb:28:in `show'
actionpack (6.0.3.2) lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
actionpack (6.0.3.2) lib/abstract_controller/base.rb:195:in `process_action'
actionpack (6.0.3.2) lib/action_controller/metal/rendering.rb:30:in `process_action'
actionpack (6.0.3.2) lib/abstract_controller/callbacks.rb:42:in `block in process_action'
activesupport (6.0.3.2) lib/active_support/callbacks.rb:135:in `run_callbacks'
actionpack (6.0.3.2) lib/abstract_controller/callbacks.rb:41:in `process_action'
actionpack (6.0.3.2) lib/action_controller/metal/rescue.rb:22:in `process_action'
actionpack (6.0.3.2) lib/action_controller/metal/instrumentation.rb:33:in `block in process_action'
activesupport (6.0.3.2) lib/active_support/notifications.rb:180:in `block in instrument'
activesupport (6.0.3.2) lib/active_support/notifications/instrumenter.rb:24:in `instrument'
activesupport (6.0.3.2) lib/active_support/notifications.rb:180:in `instrument'
actionpack (6.0.3.2) lib/action_controller/metal/instrumentation.rb:32:in `process_action'
actionpack (6.0.3.2) lib/action_controller/metal/params_wrapper.rb:245:in `process_action'
activerecord (6.0.3.2) lib/active_record/railties/controller_runtime.rb:27:in `process_action'
actionpack (6.0.3.2) lib/abstract_controller/base.rb:136:in `process'
actionview (6.0.3.2) lib/action_view/rendering.rb:39:in `process'
actionpack (6.0.3.2) lib/action_controller/metal.rb:190:in `dispatch'
actionpack (6.0.3.2) lib/action_controller/metal.rb:254:in `dispatch'
actionpack (6.0.3.2) lib/action_dispatch/routing/route_set.rb:50:in `dispatch'
actionpack (6.0.3.2) lib/action_dispatch/routing/route_set.rb:33:in `serve'
actionpack (6.0.3.2) lib/action_dispatch/journey/router.rb:49:in `block in serve'
actionpack (6.0.3.2) lib/action_dispatch/journey/router.rb:32:in `each'
actionpack (6.0.3.2) lib/action_dispatch/journey/router.rb:32:in `serve'
actionpack (6.0.3.2) lib/action_dispatch/routing/route_set.rb:834:in `call'
warden (1.2.8) lib/warden/manager.rb:36:in `block in call'
warden (1.2.8) lib/warden/manager.rb:34:in `catch'
warden (1.2.8) lib/warden/manager.rb:34:in `call'
rack (2.2.3) lib/rack/tempfile_reaper.rb:15:in `call'
rack (2.2.3) lib/rack/etag.rb:27:in `call'
rack (2.2.3) lib/rack/conditional_get.rb:27:in `call'
rack (2.2.3) lib/rack/head.rb:12:in `call'
actionpack (6.0.3.2) lib/action_dispatch/http/content_security_policy.rb:18:in `call'
rack (2.2.3) lib/rack/session/abstract/id.rb:266:in `context'
rack (2.2.3) lib/rack/session/abstract/id.rb:260:in `call'
actionpack (6.0.3.2) lib/action_dispatch/middleware/cookies.rb:648:in `call'
activerecord (6.0.3.2) lib/active_record/migration.rb:567:in `call'
actionpack (6.0.3.2) lib/action_dispatch/middleware/callbacks.rb:27:in `block in call'
activesupport (6.0.3.2) lib/active_support/callbacks.rb:101:in `run_callbacks'
actionpack (6.0.3.2) lib/action_dispatch/middleware/callbacks.rb:26:in `call'
actionpack (6.0.3.2) lib/action_dispatch/middleware/executor.rb:14:in `call'
actionpack (6.0.3.2) lib/action_dispatch/middleware/actionable_exceptions.rb:17:in `call'
actionpack (6.0.3.2) lib/action_dispatch/middleware/debug_exceptions.rb:32:in `call'
web-console (4.0.4) lib/web_console/middleware.rb:132:in `call_app'
web-console (4.0.4) lib/web_console/middleware.rb:28:in `block in call'
web-console (4.0.4) lib/web_console/middleware.rb:17:in `catch'
web-console (4.0.4) lib/web_console/middleware.rb:17:in `call'
actionpack (6.0.3.2) lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
railties (6.0.3.2) lib/rails/rack/logger.rb:37:in `call_app'
railties (6.0.3.2) lib/rails/rack/logger.rb:26:in `block in call'
activesupport (6.0.3.2) lib/active_support/tagged_logging.rb:80:in `block in tagged'
activesupport (6.0.3.2) lib/active_support/tagged_logging.rb:28:in `tagged'
activesupport (6.0.3.2) lib/active_support/tagged_logging.rb:80:in `tagged'
railties (6.0.3.2) lib/rails/rack/logger.rb:26:in `call'
sprockets-rails (3.2.1) lib/sprockets/rails/quiet_assets.rb:13:in `call'
actionpack (6.0.3.2) lib/action_dispatch/middleware/remote_ip.rb:81:in `call'
actionpack (6.0.3.2) lib/action_dispatch/middleware/request_id.rb:27:in `call'
rack (2.2.3) lib/rack/method_override.rb:24:in `call'
rack (2.2.3) lib/rack/runtime.rb:22:in `call'
activesupport (6.0.3.2) lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call'
actionpack (6.0.3.2) lib/action_dispatch/middleware/executor.rb:14:in `call'
actionpack (6.0.3.2) lib/action_dispatch/middleware/static.rb:126:in `call'
rack (2.2.3) lib/rack/sendfile.rb:110:in `call'
actionpack (6.0.3.2) lib/action_dispatch/middleware/host_authorization.rb:82:in `call'
webpacker (4.2.2) lib/webpacker/dev_server_proxy.rb:23:in `perform_request'
rack-proxy (0.6.5) lib/rack/proxy.rb:57:in `call'
railties (6.0.3.2) lib/rails/engine.rb:527:in `call'
puma (4.3.5) lib/puma/configuration.rb:228:in `call'
puma (4.3.5) lib/puma/server.rb:713:in `handle_request'
puma (4.3.5) lib/puma/server.rb:472:in `process_client'
puma (4.3.5) lib/puma/server.rb:328:in `block in run'
puma (4.3.5) lib/puma/thread_pool.rb:134:in `block in spawn_thread'
I updated a legacy Rails application that is using the impression gem to version 6 and ran into the same exception. I worked around it by specifying a specific commit for the impression gem in the Gemfile:
gem 'impressionist',
git: 'git#github.com:charlotte-ruby/impressionist.git',
ref: '46a582ff8cd3496da64f174b30b91f9d97e86643'
The reason for this is that the fix for the exception is not in their latest release (2.0.0) but is in its master branch.
I'm trying to update a selectbox that depends on another selectbox. Depending on the first one, it will search all those records that are related. Should work, this I am doing at the device login but I am getting the following error:
ActionController::RoutingError (uninitialized constant Usuarios::SessionsControllerController):
activesupport (4.2.6) lib/active_support/inflector/methods.rb:263:in `const_get'
activesupport (4.2.6) lib/active_support/inflector/methods.rb:263:in `block in constantize'
activesupport (4.2.6) lib/active_support/inflector/methods.rb:259:in `each'
activesupport (4.2.6) lib/active_support/inflector/methods.rb:259:in `inject'
activesupport (4.2.6) lib/active_support/inflector/methods.rb:259:in `constantize'
actionpack (4.2.6) lib/action_dispatch/routing/route_set.rb:70:in `controller_reference'
actionpack (4.2.6) lib/action_dispatch/routing/route_set.rb:60:in `controller'
actionpack (4.2.6) lib/action_dispatch/routing/route_set.rb:39:in `serve'
actionpack (4.2.6) lib/action_dispatch/journey/router.rb:43:in `block in serve'
actionpack (4.2.6) lib/action_dispatch/journey/router.rb:30:in `each'
actionpack (4.2.6) lib/action_dispatch/journey/router.rb:30:in `serve'
actionpack (4.2.6) lib/action_dispatch/routing/route_set.rb:817:in `call'
rack-pjax (1.0.0) lib/rack/pjax.rb:12:in `call'
actionpack (4.2.6) lib/action_dispatch/middleware/flash.rb:260:in `call'
warden (1.2.6) lib/warden/manager.rb:35:in `block in call'
warden (1.2.6) lib/warden/manager.rb:34:in `catch'
warden (1.2.6) lib/warden/manager.rb:34:in `call'
rack (1.6.4) lib/rack/etag.rb:24:in `call'
rack (1.6.4) lib/rack/conditionalget.rb:25:in `call'
rack (1.6.4) lib/rack/head.rb:13:in `call'
remotipart (1.3.1) lib/remotipart/middleware.rb:32:in `call'
actionpack (4.2.6) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
actionpack (4.2.6) lib/action_dispatch/middleware/flash.rb:260:in `call'
rack (1.6.4) lib/rack/session/abstract/id.rb:225:in `context'
rack (1.6.4) lib/rack/session/abstract/id.rb:220:in `call'
actionpack (4.2.6) lib/action_dispatch/middleware/cookies.rb:560:in `call'
activerecord (4.2.6) lib/active_record/query_cache.rb:36:in `call'
activerecord (4.2.6) lib/active_record/connection_adapters/abstract/connection_pool.rb:653:in `call'
activerecord (4.2.6) lib/active_record/migration.rb:377:in `call'
actionpack (4.2.6) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.2.6) lib/active_support/callbacks.rb:88:in `__run_callbacks__'
activesupport (4.2.6) lib/active_support/callbacks.rb:778:in `_run_call_callbacks'
activesupport (4.2.6) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (4.2.6) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (4.2.6) lib/action_dispatch/middleware/reloader.rb:73:in `call'
actionpack (4.2.6) lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
actionpack (4.2.6) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
web-console (2.3.0) lib/web_console/middleware.rb:28:in `block in call'
web-console (2.3.0) lib/web_console/middleware.rb:18:in `catch'
web-console (2.3.0) lib/web_console/middleware.rb:18:in `call'
actionpack (4.2.6) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.2.6) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.2.6) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.2.6) lib/active_support/tagged_logging.rb:68:in `block in tagged'
activesupport (4.2.6) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (4.2.6) lib/active_support/tagged_logging.rb:68:in `tagged'
railties (4.2.6) lib/rails/rack/logger.rb:20:in `call'
actionpack (4.2.6) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.6.4) lib/rack/methodoverride.rb:22:in `call'
rack (1.6.4) lib/rack/runtime.rb:18:in `call'
activesupport (4.2.6) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
rack (1.6.4) lib/rack/lock.rb:17:in `call'
actionpack (4.2.6) lib/action_dispatch/middleware/static.rb:120:in `call'
rack (1.6.4) lib/rack/sendfile.rb:113:in `call'
railties (4.2.6) lib/rails/engine.rb:518:in `call'
railties (4.2.6) lib/rails/application.rb:165:in `call'
rack (1.6.4) lib/rack/content_length.rb:15:in `call'
thin (1.7.0) lib/thin/connection.rb:86:in `block in pre_process'
thin (1.7.0) lib/thin/connection.rb:84:in `catch'
thin (1.7.0) lib/thin/connection.rb:84:in `pre_process'
thin (1.7.0) lib/thin/connection.rb:53:in `process'
thin (1.7.0) lib/thin/connection.rb:39:in `receive_data'
eventmachine (1.2.0.1) lib/eventmachine.rb:194:in `run_machine'
eventmachine (1.2.0.1) lib/eventmachine.rb:194:in `run'
thin (1.7.0) lib/thin/backends/base.rb:73:in `start'
thin (1.7.0) lib/thin/server.rb:162:in `start'
rack (1.6.4) lib/rack/handler/thin.rb:19:in `run'
rack (1.6.4) lib/rack/server.rb:286:in `start'
railties (4.2.6) lib/rails/commands/server.rb:80:in `start'
railties (4.2.6) lib/rails/commands/commands_tasks.rb:80:in `block in server'
railties (4.2.6) lib/rails/commands/commands_tasks.rb:75:in `tap'
railties (4.2.6) lib/rails/commands/commands_tasks.rb:75:in `server'
railties (4.2.6) lib/rails/commands/commands_tasks.rb:39:in `run_command!'
railties (4.2.6) lib/rails/commands.rb:17:in `<top (required)>'
bin/rails:9:in `require'
bin/rails:9:in `<top (required)>'
spring (2.0.0) lib/spring/client/rails.rb:28:in `load'
spring (2.0.0) lib/spring/client/rails.rb:28:in `call'
spring (2.0.0) lib/spring/client/command.rb:7:in `call'
spring (2.0.0) lib/spring/client.rb:30:in `run'
spring (2.0.0) bin/spring:49:in `<top (required)>'
spring (2.0.0) lib/spring/binstub.rb:31:in `load'
spring (2.0.0) lib/spring/binstub.rb:31:in `<top (required)>'
/home/luis/.rbenv/versions/2.3.1/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
/home/luis/.rbenv/versions/2.3.1/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
bin/spring:13:in `<top (required)>'
bin/rails:3:in `load'
bin/rails:3:in `<main>'
Rendered /home/luis/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/rescues/_trace.text.erb (1.5ms)
Rendered /home/luis/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/rescues/routing_error.text.erb (9.7ms)
this is my new.html.erb (view->devise->sessions)
<%= form_for(resource, as: resource_name, url: session_path(resource_name), html: {class: "form-horizontal"}) do |f| %>
<h1>Login Form</h1>
<div class="forml">
<div class="form-group">
<div >
<%= f.text_field :login, autofocus: true, :class => "form-control", :placeholder =>"Username or Email", :required => "" %>
</div>
</div>
<div class="form-group">
<div >
<%= f.password_field :password, autofocus: true, :class => "form-control", :placeholder =>"Password", :required => "" %>
</div>
<%= select_tag :empresa, options_for_select(#empresas.map{|e|[e.Empresa, e.id]}), :'data-remote' => 'true', :'data-url' => url_for(:controller => 'sessions_controller', :action => 'busqueda_sucursales', format: 'js') %>
<div id="sucursales"><%= render 'sucursales' %></div>
</div>
</div>
<div class="form-group">
<% if devise_mapping.rememberable? -%>
<div class="checkbox-inline col-md-5">
<%= f.check_box :remember_me %>
<%= f.label :remember_me %>
</div>
<% end -%>
</div>
<div>
<%= f.submit "Log in", :class => "btn btn-default submit col-md-10"%>
<div class="form-group">
<%= render "devise/shared/links" %>
</div>
</div>
<div class="clearfix"></div>
<div class="separator">
</div>
<% end %>
this is my partial _sucursales.html.erb(view->devise->sessions)
<div class="form-group">
<%= label_tag :sucursal, "Selecciona sucursal:" %>
<div class="">
<%= select_tag :sucursal, options_for_select(#sucursales.map{|e|[e.Sucursal, e.IdEmpresa]}), class: "form-control js-example-basic-single" %>
</div>
</div>
this is my busqueda_sucursales.js.erb (view->devise->sessions)
$("#sucursales").html("<%= escape_javascript(render("sucursales"))%>")
this is my sessions_controller.rb (controllers->usuarios)
class Usuarios::SessionsController < Devise::SessionsController
# before_action :configure_sign_in_params, only: [:create]
# GET /resource/sign_in
# def new
# super
# end
# POST /resource/sign_in
# def create
# super
# end
# DELETE /resource/sign_out
# def destroy
# super
# end
# protected
# If you have extra params to permit, append them to the sanitizer.
# def configure_sign_in_params
# devise_parameter_sanitizer.permit(:sign_in, keys: [:attribute])
# end
def busqueda_sucursales #Actualiza las sucursales concorde a las empresas en el acceso
#sucursales = Empresa.where("empresamadre_id = ?", params[:empresa])
respond_to do |format|
format.js
end
end
def new
#empresas = Empresamadre.all
#sucursales = Empresa.where("empresamadre_id = ?", #empresas.first.id)
super
end
def create
super
end
def update
super
end
private
def sign_up_params
allow = [:email, :usuario, :password, :password_confirmation, :nombre, :idempresa]
params.require(resource_name).permit(allow)
end
end
this is my routes.rb
devise_for :usuarios, controllers: {
registrations: "usuarios/registrations",
sessions: "usuarios/sessions",
passwords: "usuarios/passwords"}
resources :usuarios do
get 'usuarios_check', :on => :collection
get 'usuarios_check2', :on => :collection
end
get 'usuarios/sessions_controller/busqueda_sucursales', as: 'busqueda_sucursales'
Reading the first line of your error, it seemed off to see the word Controller repeated:
ActionController::RoutingError (uninitialized constant Usuarios::SessionsControllerController):
This line:
<%= select_tag :empresa, options_for_select(#empresas.map{|e|[e.Empresa, e.id]}), :'data-remote' => 'true', :'data-url' => url_for(:controller => 'sessions_controller', :action => 'busqueda_sucursales', format: 'js') %>
replace :controller => 'sessions_controller' with :controller => 'sessions'
See the examples here: http://apidock.com/rails/ActionView/RoutingUrlFor/url_for
I just switched my app from a hand-made login system to use the Devise gem. I have used this gem with many apps before, but have never had this issue. All the views are implemented correctly and display when they should, but when I try to create a new registration I get the following error:
ActionController::UnknownFormat in RegistrationsController#create
The trace it gives is as follows:
responders (2.2.0) lib/action_controller/respond_with.rb:207:in `respond_with'
devise (4.2.0) app/controllers/devise/registrations_controller.rb:32:in `create'
actionpack (4.2.6) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
actionpack (4.2.6) lib/abstract_controller/base.rb:198:in `process_action'
actionpack (4.2.6) lib/action_controller/metal/rendering.rb:10:in `process_action'
actionpack (4.2.6) lib/abstract_controller/callbacks.rb:20:in `block in process_action'
activesupport (4.2.6) lib/active_support/callbacks.rb:117:in `call'
activesupport (4.2.6) lib/active_support/callbacks.rb:117:in `call'
activesupport (4.2.6) lib/active_support/callbacks.rb:555:in `block (2 levels) in compile'
activesupport (4.2.6) lib/active_support/callbacks.rb:505:in `call'
activesupport (4.2.6) lib/active_support/callbacks.rb:505:in `call'
activesupport (4.2.6) lib/active_support/callbacks.rb:92:in `__run_callbacks__'
activesupport (4.2.6) lib/active_support/callbacks.rb:778:in `_run_process_action_callbacks'
activesupport (4.2.6) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (4.2.6) lib/abstract_controller/callbacks.rb:19:in `process_action'
actionpack (4.2.6) lib/action_controller/metal/rescue.rb:29:in `process_action'
actionpack (4.2.6) lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
activesupport (4.2.6) lib/active_support/notifications.rb:164:in `block in instrument'
activesupport (4.2.6) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.2.6) lib/active_support/notifications.rb:164:in `instrument'
actionpack (4.2.6) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
actionpack (4.2.6) lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
activerecord (4.2.6) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
actionpack (4.2.6) lib/abstract_controller/base.rb:137:in `process'
actionview (4.2.6) lib/action_view/rendering.rb:30:in `process'
actionpack (4.2.6) lib/action_controller/metal.rb:196:in `dispatch'
actionpack (4.2.6) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
actionpack (4.2.6) lib/action_controller/metal.rb:237:in `block in action'
actionpack (4.2.6) lib/action_dispatch/routing/route_set.rb:74:in `call'
actionpack (4.2.6) lib/action_dispatch/routing/route_set.rb:74:in `dispatch'
actionpack (4.2.6) lib/action_dispatch/routing/route_set.rb:43:in `serve'
actionpack (4.2.6) lib/action_dispatch/routing/mapper.rb:49:in `serve'
actionpack (4.2.6) lib/action_dispatch/journey/router.rb:43:in `block in serve'
actionpack (4.2.6) lib/action_dispatch/journey/router.rb:30:in `each'
actionpack (4.2.6) lib/action_dispatch/journey/router.rb:30:in `serve'
actionpack (4.2.6) lib/action_dispatch/routing/route_set.rb:817:in `call'
warden (1.2.6) lib/warden/manager.rb:35:in `block in call'
warden (1.2.6) lib/warden/manager.rb:34:in `catch'
warden (1.2.6) lib/warden/manager.rb:34:in `call'
rack (1.6.4) lib/rack/etag.rb:24:in `call'
rack (1.6.4) lib/rack/conditionalget.rb:38:in `call'
rack (1.6.4) lib/rack/head.rb:13:in `call'
actionpack (4.2.6) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
actionpack (4.2.6) lib/action_dispatch/middleware/flash.rb:260:in `call'
rack (1.6.4) lib/rack/session/abstract/id.rb:225:in `context'
rack (1.6.4) lib/rack/session/abstract/id.rb:220:in `call'
actionpack (4.2.6) lib/action_dispatch/middleware/cookies.rb:560:in `call'
activerecord (4.2.6) lib/active_record/query_cache.rb:36:in `call'
activerecord (4.2.6) lib/active_record/connection_adapters/abstract/connection_pool.rb:653:in `call'
activerecord (4.2.6) lib/active_record/migration.rb:377:in `call'
actionpack (4.2.6) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.2.6) lib/active_support/callbacks.rb:88:in `__run_callbacks__'
activesupport (4.2.6) lib/active_support/callbacks.rb:778:in `_run_call_callbacks'
activesupport (4.2.6) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (4.2.6) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (4.2.6) lib/action_dispatch/middleware/reloader.rb:73:in `call'
actionpack (4.2.6) lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
actionpack (4.2.6) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
actionpack (4.2.6) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.2.6) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.2.6) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.2.6) lib/active_support/tagged_logging.rb:68:in `block in tagged'
activesupport (4.2.6) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (4.2.6) lib/active_support/tagged_logging.rb:68:in `tagged'
railties (4.2.6) lib/rails/rack/logger.rb:20:in `call'
quiet_assets (1.1.0) lib/quiet_assets.rb:27:in `call_with_quiet_assets'
actionpack (4.2.6) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.6.4) lib/rack/methodoverride.rb:22:in `call'
rack (1.6.4) lib/rack/runtime.rb:18:in `call'
activesupport (4.2.6) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
rack (1.6.4) lib/rack/lock.rb:17:in `call'
actionpack (4.2.6) lib/action_dispatch/middleware/static.rb:120:in `call'
rack (1.6.4) lib/rack/sendfile.rb:113:in `call'
railties (4.2.6) lib/rails/engine.rb:518:in `call'
railties (4.2.6) lib/rails/application.rb:165:in `call'
rack (1.6.4) lib/rack/lock.rb:17:in `call'
rack (1.6.4) lib/rack/content_length.rb:15:in `call'
rack (1.6.4) lib/rack/handler/webrick.rb:88:in `service'
/Users/elizabethbayardelle/.rbenv/versions/2.2.4/lib/ruby/2.2.0/webrick/httpserver.rb:138:in `service'
/Users/elizabethbayardelle/.rbenv/versions/2.2.4/lib/ruby/2.2.0/webrick/httpserver.rb:94:in `run'
/Users/elizabethbayardelle/.rbenv/versions/2.2.4/lib/ruby/2.2.0/webrick/server.rb:294:in `block in start_thread'
When I attempt to log in, I also get a blank white screen that just says "You need to sign in or sign up before continuing."
I think these errors are related, but as I have had no experience with this set of errors with Devise I'm not 100% sure. Can anyone help me figure out what's going wrong here?
ADDITIONAL INFORMATION
Here's the code for registrations#new:
<div class="hero-image-row">
<div class="hero-image-outer text-center">
<div class="hero-image-inner text-center">
<%= image_tag 'Background 17.jpg', class: "hero-image",alt: "Beautiful golf hole by the ocean" %>
</div> <!-- hero-image-inner -->
</div> <!-- hero-image-inner -->
</div> <!-- row -->
<div class="overlap-hero-image">
<div class="buffer-25"></div>
<div class="buffer-50"></div>
<div class="container">
<div class="container text-center col-xs-10 col-xs-push-1" style="background-color: rgba(235, 235, 235, 0.8) !important">
<h1 style="color: black">Sign Up</h1>
<%= simple_form_for(resource, as: resource_name, url: user_registration_path(resource_name)) do |f| %>
<%= f.error_notification %>
<div class="form-inputs text-left row">
<div class="col-sm-12">
<%= f.input :email, required: true, autofocus: true %>
</div>
<div class="col-sm-6">
<%= f.input :password, required: true, hint: ("#{#minimum_password_length} characters minimum" if #minimum_password_length) %>
</div>
<div class="col-sm-6">
<%= f.input :password_confirmation, required: true %>
</div>
</div>
<div class="form-actions">
<%= f.button :submit, "Sign up" %>
</div>
<% end %>
<%= render "devise/shared/links" %>
</div> <!-- columns box -->
</div> <!-- container -->
</div> <!-- overlap-tall-hero-image -->
Here's a supplemental registrations_controller for some added columns:
class RegistrationsController < Devise::RegistrationsController
private
def sign_up_params
params.require(:user).permit(:first_name, :last_name, :email, :password, :password_confirmation, :gender, :birthday, :dom_hand, :sport, :g_years, :g_rounds, :g_practice, :handicap, :g_score, :admin)
end
def account_update_params
params.require(:user).permit(:first_name, :last_name, :email, :password, :password_confirmation, :current_password, :gender, :birthday, :dom_hand, :sport, :g_years, :g_rounds, :g_practice, :handicap, :g_score, :admin)
end
end
And here's how it's reflected in my routes:
devise_for :users, :controllers => { registrations: 'registrations' }
It turned out that Devise autogenerated this for both registrations#new and sessions#new:
<%= simple_form_for(resource, as: resource_name, url: user_registration_path(resource_name)) do |f| %>
The error disappeared when I removed (resource_name) on each form.
I tried to create a refinerycms engine with a photo field in it, and came across this problem when rendering a page with an image.
I searched for answers with no result.
ArgumentError (Didn't recognise the geometry string ):
dragonfly (0.9.15) lib/dragonfly/image_magick/processor.rb:104:in `thumb'
dragonfly (0.9.15) lib/dragonfly/function_manager.rb:39:in `call'
dragonfly (0.9.15) lib/dragonfly/function_manager.rb:39:in `block (2 levels) in call_last'
dragonfly (0.9.15) lib/dragonfly/function_manager.rb:38:in `catch'
dragonfly (0.9.15) lib/dragonfly/function_manager.rb:38:in `block in call_last'
dragonfly (0.9.15) lib/dragonfly/function_manager.rb:37:in `each'
dragonfly (0.9.15) lib/dragonfly/function_manager.rb:37:in `call_last'
dragonfly (0.9.15) lib/dragonfly/processor.rb:5:in `process'
dragonfly (0.9.15) lib/dragonfly/job.rb:79:in `apply'
dragonfly (0.9.15) lib/dragonfly/job.rb:268:in `block in apply'
dragonfly (0.9.15) lib/dragonfly/job.rb:268:in `each'
dragonfly (0.9.15) lib/dragonfly/job.rb:268:in `apply'
dragonfly (0.9.15) lib/dragonfly/response.rb:25:in `to_response'
dragonfly (0.9.15) lib/dragonfly/server.rb:43:in `block in call'
dragonfly (0.9.15) lib/dragonfly/server.rb:39:in `catch'
dragonfly (0.9.15) lib/dragonfly/server.rb:39:in `call'
journey (1.0.4) lib/journey/router.rb:68:in `block in call'
journey (1.0.4) lib/journey/router.rb:56:in `each'
journey (1.0.4) lib/journey/router.rb:56:in `call'
actionpack (3.2.13) lib/action_dispatch/routing/route_set.rb:612:in `call'
railties (3.2.13) lib/rails/engine.rb:479:in `call'
railties (3.2.13) lib/rails/railtie/configurable.rb:30:in `method_missing'
journey (1.0.4) lib/journey/router.rb:68:in `block in call'
journey (1.0.4) lib/journey/router.rb:56:in `each'
journey (1.0.4) lib/journey/router.rb:56:in `call'
actionpack (3.2.13) lib/action_dispatch/routing/route_set.rb:612:in `call'
warden (1.2.3) lib/warden/manager.rb:35:in `block in call'
warden (1.2.3) lib/warden/manager.rb:34:in `catch'
warden (1.2.3) lib/warden/manager.rb:34:in `call'
actionpack (3.2.13) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
rack (1.4.5) lib/rack/etag.rb:23:in `call'
rack (1.4.5) lib/rack/conditionalget.rb:25:in `call'
actionpack (3.2.13) lib/action_dispatch/middleware/head.rb:14:in `call'
actionpack (3.2.13) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
actionpack (3.2.13) lib/action_dispatch/middleware/flash.rb:242:in `call'
rack (1.4.5) lib/rack/session/abstract/id.rb:210:in `context'
rack (1.4.5) lib/rack/session/abstract/id.rb:205:in `call'
actionpack (3.2.13) lib/action_dispatch/middleware/cookies.rb:341:in `call'
dragonfly (0.9.15) lib/dragonfly/cookie_monster.rb:9:in `call'
activerecord (3.2.13) lib/active_record/query_cache.rb:64:in `call'
activerecord (3.2.13) lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in `call'
actionpack (3.2.13) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
activesupport (3.2.13) lib/active_support/callbacks.rb:405:in `_run__2453851283421214568__call__3206204981088823143__callbacks'
activesupport (3.2.13) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.13) lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
activesupport (3.2.13) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.2.13) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (3.2.13) lib/action_dispatch/middleware/reloader.rb:65:in `call'
actionpack (3.2.13) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
actionpack (3.2.13) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
actionpack (3.2.13) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
railties (3.2.13) lib/rails/rack/logger.rb:32:in `call_app'
railties (3.2.13) lib/rails/rack/logger.rb:16:in `block in call'
activesupport (3.2.13) lib/active_support/tagged_logging.rb:22:in `tagged'
railties (3.2.13) lib/rails/rack/logger.rb:16:in `call'
actionpack (3.2.13) lib/action_dispatch/middleware/request_id.rb:22:in `call'
rack (1.4.5) lib/rack/methodoverride.rb:21:in `call'
rack (1.4.5) lib/rack/runtime.rb:17:in `call'
activesupport (3.2.13) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.4.5) lib/rack/lock.rb:15:in `call'
actionpack (3.2.13) lib/action_dispatch/middleware/static.rb:63:in `call'
railties (3.2.13) lib/rails/engine.rb:479:in `call'
railties (3.2.13) lib/rails/application.rb:223:in `call'
rack (1.4.5) lib/rack/content_length.rb:14:in `call'
railties (3.2.13) lib/rails/rack/log_tailer.rb:17:in `call'
rack (1.4.5) lib/rack/handler/webrick.rb:59:in `service'
Here is code but it was generated by the refinery with this command:
rails g refinery:engine car name:string description:string photo:image
This is the controller:
def show
#car = Car.find(params[:id])
present(#page)
end
This is the view:
<% content_for :body_content_title do %>
<%= #car.name %>
<% end %>
<% content_for :body do %>
<section>
<h1>Name</h1>
<p>
<%=raw #car.name %>
</p>
</section>
<section>
<h1>Description</h1>
<p>
<%=raw #car.description %>
</p>
</section>
<section>
<h1>Photo</h1>
<p>
<%= image_fu #car.photo, nil %>
</p>
</section>
<% end %>
<% content_for :side_body do %>
<aside>
<h2><%= t('.other') %></h2>
<ul id="cars">
<% #cars.each do |car| %>
<li>
<%= link_to car.name, refinery.cars_car_path(car) %>
</li>
<% end %>
</ul>
</aside>
<% end %>
<%= render '/refinery/content_page' %>
This is a model:
module Refinery
module Cars
class Car < Refinery::Core::BaseModel
self.table_name = 'refinery_cars'
attr_accessible :name, :description, :photo_id, :position
validates :name, :presence => true, :uniqueness => true
belongs_to :photo, :class_name => '::Refinery::Image'
end
end
end
This solved the problem:
<%= image_fu(#car.photo, "300x300")%>
Thanks for helping.
If you want to display an image without specifying the size, try the below:
<%= image_tag #car.photo.url %>
I'm trying to use paperclip to handle file uploads in my Rails app. I'm currently running Paperclip 2.4.1 on Rails 3.0.9, running a WEBrick server on sqlite3.
The form worked fine before adding the file upload portion, but after following the quickstart instructions in the Paperclips docs (http://rdoc.info/gems/paperclip/2.4.1/file/README.md), upon form submission I get the following error:
undefined method `exitstatus' for nil:NilClass
at app/controllers/shows_controller.rb:62:in `create'
Here's the code for my model:
class Show < ActiveRecord::Base
has_many :pictures
has_attached_file :thumb,
:styles => { :thumb => "150x150>" },
:url => "/images/:id/thumb.:extension"
validates_attachment_presence :thumb
validates_presence_of :title
validates_presence_of :start_date
validates_presence_of :end_date
validates_presence_of :description
validates_presence_of :blurb
validates_presence_of :location
def self.current
where("shows.end_date > ?", Time.new).first
end
def self.thumb
image_tag self.thumb.url(:thumb)
end
end
The create method for my controller:
def create
#show = Show.create(params[:show])
respond_to do |format|
if #show.save
format.html { redirect_to(#show, :notice => 'Show was successfully created.') }
format.xml { render :xml => #show, :status => :created, :location => #show }
else
format.html { render :action => "new" }
format.xml { render :xml => #show.errors, :status => :unprocessable_entity }
end
end
(Line 62 is the #show = Show.create(params[:show] line))
My form:
<%= form_for #show, :html => {:multipart => true} do |f| %>
<% if #show.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(#show.errors.count, "error") %> prohibited this show from being saved:</h2>
<ul>
<% #show.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<% end %>
<div class="field">
<%= f.label :title %><br />
<%= f.text_field :title %>
</div>
<div class="field">
<%= f.label :start_date %><br />
<%= f.date_select :start_date %>
</div>
<div class="field">
<%= f.label :end_date %><br />
<%= f.date_select :end_date %>
</div>
<div class="field">
<%= f.label :description %><br />
<%= f.text_area :description %>
</div>
<div class="field">
<%= f.label :blurb %><br />
<%= f.text_field :blurb %>
</div>
<div class="field">
<%= f.label :location %><br />
<%= f.text_field :location %>
</div>
<div class="field">
<%= f.label :thumb %><br />
<%= f.file_field :thumb %>
</div>
<div class="actions">
<%= f.submit %>
</div>
<% end %>
And the full stack trace:
activesupport (3.0.9) lib/active_support/whiny_nil.rb:48:in `method_missing'
cocaine (0.2.0) lib/cocaine/command_line.rb:35:in `run'
paperclip (2.4.2) lib/paperclip.rb:102:in `run'
paperclip (2.4.2) lib/paperclip/geometry.rb:20:in `from_file'
paperclip (2.4.2) lib/paperclip/thumbnail.rb:35:in `initialize'
paperclip (2.4.2) lib/paperclip/processor.rb:33:in `new'
paperclip (2.4.2) lib/paperclip/processor.rb:33:in `make'
paperclip (2.4.2) lib/paperclip/attachment.rb:397:in `post_process_styles'
activemodel (3.0.9) lib/active_model/attribute_methods.rb:295:in `inject'
paperclip (2.4.2) lib/paperclip/attachment.rb:396:in `each'
paperclip (2.4.2) lib/paperclip/attachment.rb:396:in `inject'
paperclip (2.4.2) lib/paperclip/attachment.rb:396:in `post_process_styles'
activesupport (3.0.9) lib/active_support/ordered_hash.rb:139:in `each'
activesupport (3.0.9) lib/active_support/ordered_hash.rb:139:in `each'
paperclip (2.4.2) lib/paperclip/attachment.rb:392:in `post_process_styles'
paperclip (2.4.2) lib/paperclip/attachment.rb:386:in `post_process'
activesupport (3.0.9) lib/active_support/callbacks.rb:414:in `_run_thumb_post_process_callbacks'
activesupport (3.0.9) lib/active_support/callbacks.rb:94:in `send'
activesupport (3.0.9) lib/active_support/callbacks.rb:94:in `run_callbacks'
paperclip (2.4.2) lib/paperclip/callback_compatibility.rb:54:in `run_paperclip_callbacks'
paperclip (2.4.2) lib/paperclip/attachment.rb:385:in `post_process'
activesupport (3.0.9) lib/active_support/callbacks.rb:414:in `_run_post_process_callbacks'
activesupport (3.0.9) lib/active_support/callbacks.rb:94:in `send'
activesupport (3.0.9) lib/active_support/callbacks.rb:94:in `run_callbacks'
paperclip (2.4.2) lib/paperclip/callback_compatibility.rb:54:in `run_paperclip_callbacks'
paperclip (2.4.2) lib/paperclip/attachment.rb:384:in `post_process'
paperclip (2.4.2) lib/paperclip/attachment.rb:142:in `assign'
paperclip (2.4.2) lib/paperclip.rb:335:in `thumb='
activerecord (3.0.9) lib/active_record/base.rb:1564:in `send'
activerecord (3.0.9) lib/active_record/base.rb:1564:in `attributes='
activerecord (3.0.9) lib/active_record/base.rb:1560:in `each'
activerecord (3.0.9) lib/active_record/base.rb:1560:in `attributes='
activerecord (3.0.9) lib/active_record/base.rb:1412:in `initialize'
activerecord (3.0.9) lib/active_record/base.rb:502:in `new'
activerecord (3.0.9) lib/active_record/base.rb:502:in `create'
app/controllers/shows_controller.rb:62:in `create'
actionpack (3.0.9) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
actionpack (3.0.9) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
actionpack (3.0.9) lib/abstract_controller/base.rb:150:in `process_action'
actionpack (3.0.9) lib/action_controller/metal/rendering.rb:11:in `process_action'
actionpack (3.0.9) lib/abstract_controller/callbacks.rb:18:in `process_action'
activesupport (3.0.9) lib/active_support/callbacks.rb:441:in `_run__918721632__process_action__524098549__callbacks'
activesupport (3.0.9) lib/active_support/callbacks.rb:410:in `send'
activesupport (3.0.9) lib/active_support/callbacks.rb:410:in `_run_process_action_callbacks'
activesupport (3.0.9) lib/active_support/callbacks.rb:94:in `send'
activesupport (3.0.9) lib/active_support/callbacks.rb:94:in `run_callbacks'
actionpack (3.0.9) lib/abstract_controller/callbacks.rb:17:in `process_action'
actionpack (3.0.9) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
activesupport (3.0.9) lib/active_support/notifications.rb:52:in `instrument'
activesupport (3.0.9) lib/active_support/notifications/instrumenter.rb:21:in `instrument'
activesupport (3.0.9) lib/active_support/notifications.rb:52:in `instrument'
actionpack (3.0.9) lib/action_controller/metal/instrumentation.rb:29:in `process_action'
actionpack (3.0.9) lib/action_controller/metal/rescue.rb:17:in `process_action'
actionpack (3.0.9) lib/abstract_controller/base.rb:119:in `process'
actionpack (3.0.9) lib/abstract_controller/rendering.rb:41:in `process'
actionpack (3.0.9) lib/action_controller/metal.rb:138:in `dispatch'
actionpack (3.0.9) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
actionpack (3.0.9) lib/action_controller/metal.rb:178:in `action'
actionpack (3.0.9) lib/action_dispatch/routing/route_set.rb:62:in `call'
actionpack (3.0.9) lib/action_dispatch/routing/route_set.rb:62:in `dispatch'
actionpack (3.0.9) lib/action_dispatch/routing/route_set.rb:27:in `call'
rack-mount (0.6.14) lib/rack/mount/route_set.rb:148:in `call'
rack-mount (0.6.14) lib/rack/mount/code_generation.rb:93:in `recognize'
rack-mount (0.6.14) lib/rack/mount/code_generation.rb:68:in `optimized_each'
rack-mount (0.6.14) lib/rack/mount/code_generation.rb:92:in `recognize'
rack-mount (0.6.14) lib/rack/mount/route_set.rb:139:in `call'
actionpack (3.0.9) lib/action_dispatch/routing/route_set.rb:493:in `call'
actionpack (3.0.9) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
actionpack (3.0.9) lib/action_dispatch/middleware/head.rb:14:in `call'
rack (1.2.3) lib/rack/methodoverride.rb:24:in `call'
actionpack (3.0.9) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
actionpack (3.0.9) lib/action_dispatch/middleware/flash.rb:182:in `call'
actionpack (3.0.9) lib/action_dispatch/middleware/session/abstract_store.rb:149:in `call'
actionpack (3.0.9) lib/action_dispatch/middleware/cookies.rb:302:in `call'
activerecord (3.0.9) lib/active_record/query_cache.rb:32:in `call'
activerecord (3.0.9) lib/active_record/connection_adapters/abstract/query_cache.rb:28:in `cache'
activerecord (3.0.9) lib/active_record/query_cache.rb:12:in `cache'
activerecord (3.0.9) lib/active_record/query_cache.rb:31:in `call'
activerecord (3.0.9) lib/active_record/connection_adapters/abstract/connection_pool.rb:354:in `call'
actionpack (3.0.9) lib/action_dispatch/middleware/callbacks.rb:46:in `call'
activesupport (3.0.9) lib/active_support/callbacks.rb:416:in `_run_call_callbacks'
actionpack (3.0.9) lib/action_dispatch/middleware/callbacks.rb:44:in `call'
rack (1.2.3) lib/rack/sendfile.rb:107:in `call'
actionpack (3.0.9) lib/action_dispatch/middleware/remote_ip.rb:48:in `call'
actionpack (3.0.9) lib/action_dispatch/middleware/show_exceptions.rb:47:in `call'
railties (3.0.9) lib/rails/rack/logger.rb:13:in `call'
rack (1.2.3) lib/rack/runtime.rb:17:in `call'
activesupport (3.0.9) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.2.3) lib/rack/lock.rb:11:in `call'
rack (1.2.3) lib/rack/lock.rb:11:in `synchronize'
rack (1.2.3) lib/rack/lock.rb:11:in `call'
actionpack (3.0.9) lib/action_dispatch/middleware/static.rb:30:in `call'
railties (3.0.9) lib/rails/application.rb:168:in `call'
railties (3.0.9) lib/rails/application.rb:77:in `send'
railties (3.0.9) lib/rails/application.rb:77:in `method_missing'
railties (3.0.9) lib/rails/rack/log_tailer.rb:14:in `call'
rack (1.2.3) lib/rack/content_length.rb:13:in `call'
rack (1.2.3) lib/rack/handler/webrick.rb:52:in `service'
C:/Rails/Ruby1.8.7/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
C:/Rails/Ruby1.8.7/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
C:/Rails/Ruby1.8.7/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
C:/Rails/Ruby1.8.7/lib/ruby/1.8/webrick/server.rb:162:in `start'
C:/Rails/Ruby1.8.7/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
C:/Rails/Ruby1.8.7/lib/ruby/1.8/webrick/server.rb:95:in `start'
C:/Rails/Ruby1.8.7/lib/ruby/1.8/webrick/server.rb:92:in `each'
C:/Rails/Ruby1.8.7/lib/ruby/1.8/webrick/server.rb:92:in `start'
C:/Rails/Ruby1.8.7/lib/ruby/1.8/webrick/server.rb:23:in `start'
C:/Rails/Ruby1.8.7/lib/ruby/1.8/webrick/server.rb:82:in `start'
rack (1.2.3) lib/rack/handler/webrick.rb:13:in `run'
rack (1.2.3) lib/rack/server.rb:217:in `start'
railties (3.0.9) lib/rails/commands/server.rb:65:in `start'
railties (3.0.9) lib/rails/commands.rb:30
railties (3.0.9) lib/rails/commands.rb:27:in `tap'
railties (3.0.9) lib/rails/commands.rb:27
script/rails:6:in `require'
script/rails:6
I wasn't able to find any instance of this error elsewhere relating to paperclip; It looks like its bubbling up from within Rails somewhere; any suggestions?
It seems that the command, that is run with cocaine is not correct. Have you configured paperclip's command path with Paperclip.options[:command_path] = "/usr/local/bin/" and installed ImageMagick in this path?
You can find out where ImageMagick is with which convert. This should yield the path to the convert binary of ImageMagick - in my case /usr/local/bin/convert