In my Ruby on Rails app I have the following partial patients/_patient_link.html.erb
<a class="patient" href="<%= patient_path(patient_link.id) %>">
<span class="name"><%= patient_link.name %></span>
</a>
I'm trying to render this partial from the console using the following code:
include Rails.application.routes.url_helpers
view = ActionView::Base.new('app/views/patients', {}, ActionController::Base.new)
output = view.render(file: '_patient_link.html', locals: {patient_link: User.last, current_user: User.last})
It returns me following error:
ActionView::Template::Error: wrong number of arguments (given 3, expected 0..1)
from /home/mateusz/.rvm/gems/ruby-2.4.1/gems/actionpack-4.2.8/lib/action_dispatch/routing/url_for.rb:150:in `url_for'
from /home/mateusz/.rvm/gems/ruby-2.4.1/gems/actionpack-4.2.8/lib/action_dispatch/routing/route_set.rb:280:in `call'
from /home/mateusz/.rvm/gems/ruby-2.4.1/gems/actionpack-4.2.8/lib/action_dispatch/routing/route_set.rb:223:in `call'
from /home/mateusz/.rvm/gems/ruby-2.4.1/gems/actionpack-4.2.8/lib/action_dispatch/routing/route_set.rb:345:in `block (2 levels) in define_url_helper'
from /home/mateusz/projects/dashboard/app/views/patients/_patient_link.html.erb:1:in `_app_views_patients__patient_link_html_erb__1558238916296672676_82012840'
from /home/mateusz/.rvm/gems/ruby-2.4.1/gems/actionview-4.2.8/lib/action_view/template.rb:145:in `block in render'
from /home/mateusz/.rvm/gems/ruby-2.4.1/gems/activesupport-4.2.8/lib/active_support/notifications.rb:166:in `instrument'
from /home/mateusz/.rvm/gems/ruby-2.4.1/gems/actionview-4.2.8/lib/action_view/template.rb:333:in `instrument'
from /home/mateusz/.rvm/gems/ruby-2.4.1/gems/actionview-4.2.8/lib/action_view/template.rb:143:in `render'
from /home/mateusz/.rvm/gems/ruby-2.4.1/gems/actionview-4.2.8/lib/action_view/renderer/template_renderer.rb:54:in `block (2 levels) in render_template'
from /home/mateusz/.rvm/gems/ruby-2.4.1/gems/actionview-4.2.8/lib/action_view/renderer/abstract_renderer.rb:39:in `block in instrument'
from /home/mateusz/.rvm/gems/ruby-2.4.1/gems/activesupport-4.2.8/lib/active_support/notifications.rb:164:in `block in instrument'
from /home/mateusz/.rvm/gems/ruby-2.4.1/gems/activesupport-4.2.8/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
from /home/mateusz/.rvm/gems/ruby-2.4.1/gems/activesupport-4.2.8/lib/active_support/notifications.rb:164:in `instrument'
from /home/mateusz/.rvm/gems/ruby-2.4.1/gems/actionview-4.2.8/lib/action_view/renderer/abstract_renderer.rb:39:in `instrument'
from /home/mateusz/.rvm/gems/ruby-2.4.1/gems/actionview-4.2.8/lib/action_view/renderer/template_renderer.rb:53:in `block in render_template'
from /home/mateusz/.rvm/gems/ruby-2.4.1/gems/actionview-4.2.8/lib/action_view/renderer/template_renderer.rb:61:in `render_with_layout'
from /home/mateusz/.rvm/gems/ruby-2.4.1/gems/actionview-4.2.8/lib/action_view/renderer/template_renderer.rb:52:in `render_template'
from /home/mateusz/.rvm/gems/ruby-2.4.1/gems/actionview-4.2.8/lib/action_view/renderer/template_renderer.rb:14:in `render'
from /home/mateusz/.rvm/gems/ruby-2.4.1/gems/actionview-4.2.8/lib/action_view/renderer/renderer.rb:46:in `render_template'
from /home/mateusz/.rvm/gems/ruby-2.4.1/gems/actionview-4.2.8/lib/action_view/renderer/renderer.rb:27:in `render'
from /home/mateusz/.rvm/gems/ruby-2.4.1/gems/actionview-4.2.8/lib/action_view/helpers/rendering_helper.rb:32:in `render'
from /home/mateusz/.rvm/gems/ruby-2.4.1/gems/haml-4.0.7/lib/haml/helpers/action_view_mods.rb:12:in `render_with_haml'
from (irb):5
from /home/mateusz/.rvm/gems/ruby-2.4.1/gems/railties-4.2.8/lib/rails/commands/console.rb:110:in `start'
from /home/mateusz/.rvm/gems/ruby-2.4.1/gems/railties-4.2.8/lib/rails/commands/console.rb:9:in `start'
from /home/mateusz/.rvm/gems/ruby-2.4.1/gems/railties-4.2.8/lib/rails/commands/commands_tasks.rb:68:in `console'
from /home/mateusz/.rvm/gems/ruby-2.4.1/gems/railties-4.2.8/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /home/mateusz/.rvm/gems/ruby-2.4.1/gems/railties-4.2.8/lib/rails/commands.rb:17:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
This href attribute inside partial is causing this error: href="<%= patient_path(patient_link.id) %>". How can I fix that?
I was able to make it work with following code:
ApplicationController.new.render_to_string(
:partial => 'patients/patient_link',
:locals => { :patient_link => User.last , current_user: User.first}
)
Related
I'm currently in the middle of upgrading a Ruby on Rails 3 project to Ruby on Rails 4.0.
Several of my tests related to controllers are failing because specific files cannot be found when rendering the templates during the tests:
ActionView::Template::Error: No such file or directory
All these errors have the same in common, that they try to load files from the tmp/cache in the Rails application. This was working all fine under Rails 3.
Is something specific required for asset compilation under Rails 4 in tests?
# config/application.rb
# Enable the asset pipeline
config.assets.enabled = true
The above is not overwritten in our test environment, so I assume this remains enabled? And we used Sprockets in Rails 3 as well.
Rails : 4.0
Sprockets : 3.6
I'm probably missing something obvious, just can't find it...
Error output
test_0001_should show a form to upload attachments and display existing ones(AttachmentsControllerTest::#new):
ActionView::Template::Error: No such file or directory # rb_sysopen - /root/my_app/tmp/cache/assets/test/sprockets/v3.0/m7/m7YIr0duEvKhRldOP5LjpABJF7kd9H6aT5dCMyGnOl8.cache.47262198725000.3291.4516
/root/my_app/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.2/lib/sprockets/path_utils.rb:278:in `initialize'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.2/lib/sprockets/path_utils.rb:278:in `open'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.2/lib/sprockets/path_utils.rb:278:in `atomic_write'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.2/lib/sprockets/cache/file_store.rb:107:in `set'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.2/lib/sprockets/cache.rb:212:in `set'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.2/lib/sprockets/cache.rb:86:in `fetch'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.2/lib/sprockets/base.rb:56:in `file_digest'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.2/lib/sprockets/unloaded_asset.rb:104:in `dependency_history_key'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:304:in `fetch_asset_from_dependency_cache'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:44:in `load'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.2/lib/sprockets/cached_environment.rb:20:in `block in initialize'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.2/lib/sprockets/cached_environment.rb:47:in `yield'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.2/lib/sprockets/cached_environment.rb:47:in `load'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.2/lib/sprockets/base.rb:66:in `find_asset'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.2/lib/sprockets/environment.rb:30:in `find_asset'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.2/lib/sprockets/base.rb:92:in `[]'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/sprockets-rails-2.3.3/lib/sprockets/rails/helper.rb:123:in `asset_digest_path'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/sprockets-rails-2.3.3/lib/sprockets/rails/helper.rb:76:in `compute_asset_path'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/actionpack-4.0.13/lib/action_view/helpers/asset_url_helper.rb:132:in `asset_path'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/sprockets-rails-2.3.3/lib/sprockets/rails/helper.rb:91:in `asset_path'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/actionpack-4.0.13/lib/action_view/helpers/asset_url_helper.rb:234:in `javascript_path'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/actionpack-4.0.13/lib/action_view/helpers/asset_tag_helper.rb:58:in `block in javascript_include_tag'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/actionpack-4.0.13/lib/action_view/helpers/asset_tag_helper.rb:56:in `map'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/actionpack-4.0.13/lib/action_view/helpers/asset_tag_helper.rb:56:in `javascript_include_tag'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/sprockets-rails-2.3.3/lib/sprockets/rails/helper.rb:148:in `javascript_include_tag'
/root/my_app/app/views/layouts/attachments.html.erb:2:in `block in _app_views_layouts_attachments_html_erb___457563631613762413_47262336759680'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/actionpack-4.0.13/lib/action_view/helpers/capture_helper.rb:38:in `block in capture'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/actionpack-4.0.13/lib/action_view/helpers/capture_helper.rb:200:in `with_output_buffer'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/haml-4.0.7/lib/haml/helpers/action_view_xss_mods.rb:5:in `with_output_buffer_with_haml_xss'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/actionpack-4.0.13/lib/action_view/helpers/capture_helper.rb:38:in `capture'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/haml-4.0.7/lib/haml/helpers/action_view_mods.rb:52:in `capture_with_haml'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/actionpack-4.0.13/lib/action_view/helpers/capture_helper.rb:152:in `content_for'
/root/my_app/app/views/layouts/attachments.html.erb:1:in `_app_views_layouts_attachments_html_erb___457563631613762413_47262336759680'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/actionpack-4.0.13/lib/action_view/template.rb:143:in `block in render'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.0.13/lib/active_support/notifications.rb:159:in `block in instrument'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.0.13/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.0.13/lib/active_support/notifications.rb:159:in `instrument'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/actionpack-4.0.13/lib/action_view/template.rb:141:in `render'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/actionpack-4.0.13/lib/action_view/renderer/template_renderer.rb:61:in `render_with_layout'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/actionpack-4.0.13/lib/action_view/renderer/template_renderer.rb:47:in `render_template'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/actionpack-4.0.13/lib/action_view/renderer/template_renderer.rb:17:in `render'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/actionpack-4.0.13/lib/action_view/renderer/renderer.rb:42:in `render_template'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/actionpack-4.0.13/lib/action_view/renderer/renderer.rb:23:in `render'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/actionpack-4.0.13/lib/abstract_controller/rendering.rb:127:in `_render_template'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/actionpack-4.0.13/lib/action_controller/metal/streaming.rb:219:in `_render_template'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/actionpack-4.0.13/lib/abstract_controller/rendering.rb:120:in `render_to_body'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/actionpack-4.0.13/lib/action_controller/metal/rendering.rb:33:in `render_to_body'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/actionpack-4.0.13/lib/action_controller/metal/renderers.rb:26:in `render_to_body'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/actionpack-4.0.13/lib/abstract_controller/rendering.rb:97:in `render'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/actionpack-4.0.13/lib/action_controller/metal/rendering.rb:16:in `render'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/actionpack-4.0.13/lib/action_controller/metal/instrumentation.rb:41:in `block (2 levels) in render'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.0.13/lib/active_support/core_ext/benchmark.rb:12:in `block in ms'
/usr/local/lib/ruby/2.2.0/benchmark.rb:303:in `realtime'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.0.13/lib/active_support/core_ext/benchmark.rb:12:in `ms'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/actionpack-4.0.13/lib/action_controller/metal/instrumentation.rb:41:in `block in render'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/actionpack-4.0.13/lib/action_controller/metal/instrumentation.rb:84:in `cleanup_view_runtime'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.0.13/lib/active_record/railties/controller_runtime.rb:25:in `cleanup_view_runtime'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/actionpack-4.0.13/lib/action_controller/metal/instrumentation.rb:40:in `render'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/actionpack-4.0.13/lib/action_controller/metal/implicit_render.rb:10:in `default_render'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/actionpack-4.0.13/lib/action_controller/metal/implicit_render.rb:5:in `send_action'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/actionpack-4.0.13/lib/abstract_controller/base.rb:189:in `process_action'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/actionpack-4.0.13/lib/action_controller/metal/rendering.rb:10:in `process_action'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/actionpack-4.0.13/lib/abstract_controller/callbacks.rb:18:in `block in process_action'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.0.13/lib/active_support/callbacks.rb:453:in `_run__64868443609262235__process_action__callbacks'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.0.13/lib/active_support/callbacks.rb:80:in `run_callbacks'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/actionpack-4.0.13/lib/abstract_controller/callbacks.rb:17:in `process_action'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/actionpack-4.0.13/lib/action_controller/metal/rescue.rb:29:in `process_action'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/actionpack-4.0.13/lib/action_controller/metal/instrumentation.rb:31:in `block in process_action'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.0.13/lib/active_support/notifications.rb:159:in `block in instrument'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.0.13/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.0.13/lib/active_support/notifications.rb:159:in `instrument'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/actionpack-4.0.13/lib/action_controller/metal/instrumentation.rb:30:in `process_action'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/actionpack-4.0.13/lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.0.13/lib/active_record/railties/controller_runtime.rb:18:in `process_action'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/actionpack-4.0.13/lib/abstract_controller/base.rb:136:in `process'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/actionpack-4.0.13/lib/abstract_controller/rendering.rb:44:in `process'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/actionpack-4.0.13/lib/action_controller/test_case.rb:572:in `process'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/actionpack-4.0.13/lib/action_controller/test_case.rb:64:in `process'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/active_model_serializers-0.9.5/lib/action_controller/serialization_test_case.rb:25:in `process'
/root/my_app/vendor/bundle/ruby/2.2.0/gems/actionpack-4.0.13/lib/action_controller/test_case.rb:472:in `get'
/root/my_app/test/functional/attachments_controller_test.rb:78:in `block (2 levels) in <class:AttachmentsControllerTest>'
EDIT
This is the file causing the error: app/views/layouts/attachments.html.erb
<%= content_for :head do %>
<%= javascript_include_tag 'attachments' %>
<% end %>
<%= render template: "layouts/standard_bootstrap" %>
The template is the following:
<!DOCTYPE html>
%html{lang: "en"}
%head
%script
= javascript_include_tag "/javascripts/jquery-ui-1.9.2.custom/js/jquery-1.8.3.js"
= javascript_include_tag "/javascripts/jquery-ui-1.9.2.custom/js/jquery-ui-1.9.2.custom.min.js"
= stylesheet_link_tag "/javascripts/jquery-ui-1.9.2.custom/css/flick/jquery-ui-1.9.2.custom.min.css"
= stylesheet_link_tag 'standard'
= stylesheet_link_tag '/stylesheets/bootstrap/css/bootstrap.min.css'
= stylesheet_link_tag '/stylesheets/bootstrap/css/bootstrap-datepicker.standalone.min.css'
= javascript_include_tag "standard_bootstrap_third_party.js"
= yield :head
%body
#content
= yield
Could it be that it's not finding one of the files in the template?
All the referenced files exist in the /public/javascripts folder.
I had the exact same issue when using parallel_tests,
fixed by adding the following to config/environments/test.rb:
config.cache_store = :file_store, Rails.root.join("tmp", "cache", "paralleltests#{ENV['TEST_ENV_NUMBER']}")
as mentioned in parallel tests wiki
I have a custom rake task and I am using a mailer with this task. I have an agent table with all of an agent's info. I also have an agent_card table that houses all of their license data. The agent_card table also has an agent_id column to identify which card goes with which agent. When trying to run the rake task and send out the mailer, I keep getting "ActionView::Template::Error: undefined method `name' for nil:NilClass." I can't figure out how to get the name, email, and phone through the agent_card table. I have included all the code below. Please and thank you!
Error:
rake aborted!
ActionView::Template::Error: undefined method `name' for nil:NilClass
/Users/michaelwiesenhart/Code/app/views/license_expire_mailer/license_expi re_mgr.html.erb:7:in `_app_views_license_expire_mailer_license_expire_mgr_html_erb___944550213720770297_70323524541360'
/Users/michaelwiesenhart/.rvm/gems/ruby-2.3.1#global/gems/actionview-4.2.6/lib/action_view/template.rb:145:in `block in render'
/Users/michaelwiesenhart/.rvm/gems/ruby-2.3.1#global/gems/activesupport-4.2.6/lib/active_support/notifications.rb:166:in `instrument'
/Users/michaelwiesenhart/.rvm/gems/ruby-2.3.1#global/gems/actionview-4.2.6/lib/action_view/template.rb:333:in `instrument'
/Users/michaelwiesenhart/.rvm/gems/ruby-2.3.1#global/gems/actionview-4.2.6/lib/action_view/template.rb:143:in `render'
/Users/michaelwiesenhart/.rvm/gems/ruby-2.3.1#global/gems/actionview-4.2.6/lib/action_view/renderer/template_renderer.rb:54:in `block (2 levels) in render_template'
/Users/michaelwiesenhart/.rvm/gems/ruby-2.3.1#global/gems/actionview-4.2.6/lib/action_view/renderer/abstract_renderer.rb:39:in `block in instrument'
/Users/michaelwiesenhart/.rvm/gems/ruby-2.3.1#global/gems/activesupport-4.2.6/lib/active_support/notifications.rb:164:in `block in instrument'
/Users/michaelwiesenhart/.rvm/gems/ruby-2.3.1#global/gems/activesupport-4.2.6/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/Users/michaelwiesenhart/.rvm/gems/ruby-2.3.1#global/gems/activesupport-4.2.6/lib/active_support/notifications.rb:164:in `instrument'
/Users/michaelwiesenhart/.rvm/gems/ruby-2.3.1#global/gems/actionview-4.2.6/lib/action_view/renderer/abstract_renderer.rb:39:in `instrument'
/Users/michaelwiesenhart/.rvm/gems/ruby-2.3.1#global/gems/actionview-4.2.6/lib/action_view/renderer/template_renderer.rb:53:in `block in render_template'
/Users/michaelwiesenhart/.rvm/gems/ruby-2.3.1#global/gems/actionview-4.2.6/lib/action_view/renderer/template_renderer.rb:61:in `render_with_layout'
/Users/michaelwiesenhart/.rvm/gems/ruby-2.3.1#global/gems/actionview-4.2.6/lib/action_view/renderer/template_renderer.rb:52:in `render_template'
/Users/michaelwiesenhart/.rvm/gems/ruby-2.3.1#global/gems/actionview-4.2.6/lib/action_view/renderer/template_renderer.rb:14:in `render'
/Users/michaelwiesenhart/.rvm/gems/ruby-2.3.1#global/gems/actionview-4.2.6/lib/action_view/renderer/renderer.rb:46:in `render_template'
/Users/michaelwiesenhart/.rvm/gems/ruby-2.3.1#global/gems/actionview-4.2.6/lib/action_view/renderer/renderer.rb:27:in `render'
/Users/michaelwiesenhart/.rvm/gems/ruby-2.3.1#global/gems/actionview-4.2.6/lib/action_view/rendering.rb:100:in `_render_template'
/Users/michaelwiesenhart/.rvm/gems/ruby-2.3.1#global/gems/actionview-4.2.6/lib/action_view/rendering.rb:83:in `render_to_body'
/Users/michaelwiesenhart/.rvm/gems/ruby-2.3.1#global/gems/actionpack-4.2.6/lib/abstract_controller/rendering.rb:25:in `render'
/Users/michaelwiesenhart/.rvm/gems/ruby-2.3.1#global/gems/actionmailer-4.2.6/lib/action_mailer/base.rb:904:in `block in collect_responses'
/Users/michaelwiesenhart/.rvm/gems/ruby-2.3.1#global/gems/actionmailer-4.2.6/lib/action_mailer/base.rb:918:in `each'
/Users/michaelwiesenhart/.rvm/gems/ruby-2.3.1#global/gems/actionmailer-4.2.6/lib/action_mailer/base.rb:918:in `each_template'
/Users/michaelwiesenhart/.rvm/gems/ruby-2.3.1#global/gems/actionmailer-4.2.6/lib/action_mailer/base.rb:900:in `collect_responses'
/Users/michaelwiesenhart/.rvm/gems/ruby-2.3.1#global/gems/actionmailer-4.2.6/lib/action_mailer/base.rb:829:in `mail'
/Users/michaelwiesenhart/Code/app/mailers/license_expire_mailer.rb:14:in `license_expire_mgr'
/Users/michaelwiesenhart/.rvm/gems/ruby-2.3.1#global/gems/actionpack-4.2.6/lib/abstract_controller/base.rb:198:in `process_action'
/Users/michaelwiesenhart/.rvm/gems/ruby-2.3.1#global/gems/actionpack-4.2.6/lib/abstract_controller/callbacks.rb:20:in `block in process_action'
/Users/michaelwiesenhart/.rvm/gems/ruby-2.3.1#global/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:88:in `__run_callbacks__'
/Users/michaelwiesenhart/.rvm/gems/ruby-2.3.1#global/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:778:in `_run_process_action_callbacks'
/Users/michaelwiesenhart/.rvm/gems/ruby-2.3.1#global/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:81:in `run_callbacks'
/Users/michaelwiesenhart/.rvm/gems/ruby-2.3.1#global/gems/actionpack-4.2.6/lib/abstract_controller/callbacks.rb:19:in `process_action'
/Users/michaelwiesenhart/.rvm/gems/ruby-2.3.1#global/gems/actionpack-4.2.6/lib/abstract_controller/base.rb:137:in `process'
/Users/michaelwiesenhart/.rvm/gems/ruby-2.3.1#global/gems/actionview-4.2.6/lib/action_view/rendering.rb:30:in `process'
/Users/michaelwiesenhart/.rvm/gems/ruby-2.3.1#global/gems/actionmailer-4.2.6/lib/action_mailer/base.rb:596:in `block in process'
/Users/michaelwiesenhart/.rvm/gems/ruby-2.3.1#global/gems/activesupport-4.2.6/lib/active_support/notifications.rb:164:in `block in instrument'
/Users/michaelwiesenhart/.rvm/gems/ruby-2.3.1#global/gems/activesupport-4.2.6/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/Users/michaelwiesenhart/.rvm/gems/ruby-2.3.1#global/gems/activesupport-4.2.6/lib/active_support/notifications.rb:164:in `instrument'
/Users/michaelwiesenhart/.rvm/gems/ruby-2.3.1#global/gems/actionmailer-4.2.6/lib/action_mailer/base.rb:593:in `process'
/Users/michaelwiesenhart/.rvm/gems/ruby-2.3.1#global/gems/actionmailer-4.2.6/lib/action_mailer/base.rb:584:in `initialize'
/Users/michaelwiesenhart/.rvm/gems/ruby-2.3.1#global/gems/actionmailer-4.2.6/lib/action_mailer/message_delivery.rb:25:in `new'
/Users/michaelwiesenhart/.rvm/gems/ruby-2.3.1#global/gems/actionmailer-4.2.6/lib/action_mailer/message_delivery.rb:25:in `__getobj__'
/Users/michaelwiesenhart/.rvm/gems/ruby-2.3.1#global/gems/actionmailer-4.2.6/lib/action_mailer/message_delivery.rb:34:in `message'
/Users/michaelwiesenhart/.rvm/gems/ruby-2.3.1#global/gems/actionmailer-4.2.6/lib/action_mailer/message_delivery.rb:85:in `deliver_now'
/Users/michaelwiesenhart/Code/lib/tasks/license_expiration.rake:17:in `block (3 levels) in <top (required)>'
/Users/michaelwiesenhart/.rvm/gems/ruby-2.3.1#global/gems/activerecord-4.2.6/lib/active_record/relation/delegation.rb:46:in `each'
/Users/michaelwiesenhart/.rvm/gems/ruby-2.3.1#global/gems/activerecord-4.2.6/lib/active_record/relation/delegation.rb:46:in `each'
/Users/michaelwiesenhart/Code/lib/tasks/license_expiration.rake:15:in `block (2 levels) in <top (required)>'
/Users/michaelwiesenhart/.rvm/gems/ruby-2.3.1#/bin/ruby_executable_hooks:15:in `eval'
/Users/michaelwiesenhart/.rvm/gems/ruby-2.3.1#/bin/ruby_executable_hooks:15:in `<main>'
Agent Model:
has_one :agent_card
AgentCard Model:
belongs_to :agent
license_expire_mgr.html.erb
Hiya, <br><br>
The agent listed below has a license that will expire one week from today. Please make sure they renew before it expires!<br><br>
<strong>Name:</strong> <%= #agent.name %><br>
<strong>Phone:</strong> <%= #agent.phone %><br>
<strong>Email:</strong> <%= #agent.email %><br><br>
license_expire_mailer.rb
class LicenseExpireMailer < ActionMailer::Base
default from: "Mike <help#mike.com>"
def license_expire_mgr(agent_card, agent)
#agent_cards = agent_card
#agent = agent
mail to: "mike#mike.com", subject: "Agent License Expiring"
end
end
#agent is not being passed through to the mailer or the value of it is being evaluated as nil.
The problem is not with your rake task or your mailer, figure out why the param is nil and that will solve your problem.
I figured it out. I was trying to use agent_card and didn't need it. Once I removed it, it works just fine!
This is probably an easy fix, but my google fu has failed me.
Is there an easy way to find out from this which file has the encoding problem.
The application file has a meta tag for UTF-8
The application controller has a config.encoding ="utf-8"
I don't see any error in the browser. I'm seeing it from rake test.
1) Error:
StoreControllerTest#test_should_get_index:
ActionView::Template::Error: unknown encoding name - undecided
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/actionpack-3.2.14/lib/action_view/template.rb:202:in `force_encoding'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/actionpack-3.2.14/lib/action_view/template.rb:202:in `encode!'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/actionpack-3.2.14/lib/action_view/template.rb:266:in `compile'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/actionpack-3.2.14/lib/action_view/template.rb:244:in `block in compile!'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/actionpack-3.2.14/lib/action_view/template.rb:232:in `synchronize'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/actionpack-3.2.14/lib/action_view/template.rb:232:in `compile!'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/actionpack-3.2.14/lib/action_view/template.rb:144:in `block in render'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/activesupport-3.2.14/lib/active_support/notifications.rb:123:in `block in instrument'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/activesupport-3.2.14/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/activesupport-3.2.14/lib/active_support/notifications.rb:123:in `instrument'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/actionpack-3.2.14/lib/action_view/template.rb:143:in `render'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/actionpack-3.2.14/lib/action_view/renderer/template_renderer.rb:48:in `block (2 levels) in render_template'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/actionpack-3.2.14/lib/action_view/renderer/abstract_renderer.rb:38:in `block in instrument'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/activesupport-3.2.14/lib/active_support/notifications.rb:123:in `block in instrument'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/activesupport-3.2.14/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/activesupport-3.2.14/lib/active_support/notifications.rb:123:in `instrument'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/actionpack-3.2.14/lib/action_view/renderer/abstract_renderer.rb:38:in `instrument'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/actionpack-3.2.14/lib/action_view/renderer/template_renderer.rb:47:in `block in render_template'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/actionpack-3.2.14/lib/action_view/renderer/template_renderer.rb:55:in `render_with_layout'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/actionpack-3.2.14/lib/action_view/renderer/template_renderer.rb:46:in `render_template'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/actionpack-3.2.14/lib/action_view/renderer/template_renderer.rb:19:in `render'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/actionpack-3.2.14/lib/action_view/renderer/renderer.rb:36:in `render_template'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/actionpack-3.2.14/lib/action_view/renderer/renderer.rb:17:in `render'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/actionpack-3.2.14/lib/abstract_controller/rendering.rb:110:in `_render_template'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/actionpack-3.2.14/lib/action_controller/metal/streaming.rb:225:in `_render_template'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/actionpack-3.2.14/lib/abstract_controller/rendering.rb:103:in `render_to_body'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/actionpack-3.2.14/lib/action_controller/metal/renderers.rb:28:in `render_to_body'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/actionpack-3.2.14/lib/action_controller/metal/compatibility.rb:50:in `render_to_body'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/actionpack-3.2.14/lib/abstract_controller/rendering.rb:88:in `render'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/actionpack-3.2.14/lib/action_controller/metal/rendering.rb:16:in `render'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/actionpack-3.2.14/lib/action_controller/metal/instrumentation.rb:40:in `block (2 levels) in render'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/activesupport-3.2.14/lib/active_support/core_ext/benchmark.rb:5:in `block in ms'
/home/ubuntu/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/benchmark.rb:294:in `realtime'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/activesupport-3.2.14/lib/active_support/core_ext/benchmark.rb:5:in `ms'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/actionpack-3.2.14/lib/action_controller/metal/instrumentation.rb:40:in `block in render'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/actionpack-3.2.14/lib/action_controller/metal/instrumentation.rb:83:in `cleanup_view_runtime'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/activerecord-3.2.14/lib/active_record/railties/controller_runtime.rb:24:in `cleanup_view_runtime'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/actionpack-3.2.14/lib/action_controller/metal/instrumentation.rb:39:in `render'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/actionpack-3.2.14/lib/action_controller/metal/implicit_render.rb:10:in `default_render'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/actionpack-3.2.14/lib/action_controller/metal/implicit_render.rb:5:in `send_action'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/actionpack-3.2.14/lib/abstract_controller/base.rb:167:in `process_action'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/actionpack-3.2.14/lib/action_controller/metal/rendering.rb:10:in `process_action'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/actionpack-3.2.14/lib/abstract_controller/callbacks.rb:18:in `block in process_action'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/activesupport-3.2.14/lib/active_support/callbacks.rb:414:in `_run__996699002__process_action__630865188__callbacks'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/activesupport-3.2.14/lib/active_support/callbacks.rb:405:in `__run_callback'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/activesupport-3.2.14/lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/activesupport-3.2.14/lib/active_support/callbacks.rb:81:in `run_callbacks'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/actionpack-3.2.14/lib/abstract_controller/callbacks.rb:17:in `process_action'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/actionpack-3.2.14/lib/action_controller/metal/rescue.rb:29:in `process_action'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/actionpack-3.2.14/lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/activesupport-3.2.14/lib/active_support/notifications.rb:123:in `block in instrument'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/activesupport-3.2.14/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/activesupport-3.2.14/lib/active_support/notifications.rb:123:in `instrument'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/actionpack-3.2.14/lib/action_controller/metal/instrumentation.rb:29:in `process_action'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/actionpack-3.2.14/lib/action_controller/metal/params_wrapper.rb:207:in `process_action'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/activerecord-3.2.14/lib/active_record/railties/controller_runtime.rb:18:in `process_action'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/actionpack-3.2.14/lib/abstract_controller/base.rb:121:in `process'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/actionpack-3.2.14/lib/abstract_controller/rendering.rb:45:in `process'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/actionpack-3.2.14/lib/action_controller/metal/testing.rb:17:in `process_with_new_base_test'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/actionpack-3.2.14/lib/action_controller/test_case.rb:490:in `process'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/actionpack-3.2.14/lib/action_controller/test_case.rb:54:in `process'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/actionpack-3.2.14/lib/action_controller/test_case.rb:407:in `get'
/home/ubuntu/Documents/hartl/depot/test/functional/store_controller_test.rb:5:in `block in <class:StoreControllerTest>'
/home/ubuntu/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/minitest/unit.rb:1265:in `run'
/home/ubuntu/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/test/unit/testcase.rb:17:in `run'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/activesupport-3.2.14/lib/active_support/testing/setup_and_teardown.rb:36:in `block in run'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/activesupport-3.2.14/lib/active_support/callbacks.rb:458:in `_run__884541456__setup__650240084__callbacks'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/activesupport-3.2.14/lib/active_support/callbacks.rb:405:in `__run_callback'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/activesupport-3.2.14/lib/active_support/callbacks.rb:385:in `_run_setup_callbacks'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/activesupport-3.2.14/lib/active_support/callbacks.rb:81:in `run_callbacks'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/activesupport-3.2.14/lib/active_support/testing/setup_and_teardown.rb:35:in `run'
/home/ubuntu/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/minitest/unit.rb:940:in `block in _run_suite'
/home/ubuntu/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/minitest/unit.rb:933:in `map'
/home/ubuntu/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/minitest/unit.rb:933:in `_run_suite'
/home/ubuntu/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/test/unit.rb:663:in `block in _run_suites'
/home/ubuntu/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/test/unit.rb:661:in `each'
/home/ubuntu/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/test/unit.rb:661:in `_run_suites'
/home/ubuntu/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/minitest/unit.rb:884:in `_run_anything'
/home/ubuntu/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/minitest/unit.rb:1092:in `run_tests'
/home/ubuntu/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/minitest/unit.rb:1079:in `block in _run'
/home/ubuntu/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/minitest/unit.rb:1078:in `each'
/home/ubuntu/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/minitest/unit.rb:1078:in `_run'
/home/ubuntu/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/minitest/unit.rb:1066:in `run'
/home/ubuntu/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/test/unit.rb:27:in `run'
/home/ubuntu/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/test/unit.rb:780:in `run'
/home/ubuntu/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/test/unit.rb:372:in `block (2 levels) in autorun'
/home/ubuntu/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/test/unit.rb:33:in `run_once'
/home/ubuntu/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/test/unit.rb:371:in `block in autorun'
Finished tests in 0.663328s, 12.0604 tests/s, 15.0755 assertions/s.
8 tests, 10 assertions, 0 failures, 1 errors, 0 skips
ruby -v: ruby 2.1.0p0 (2013-12-25 revision 44422) [i686-linux]
Errors running test:functionals! #<RuntimeError: Command failed with status (1): [ruby -I"lib:test" -I"/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib" "/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/rake_test_loader.rb" "test/functional/**/*_test.rb" ]>
I am trying to upload an image to Amazon S3.
The model Card.rb has
has_attached_file :marketing_image, default_url: '',
styles: {:thumb => ['66x80>', :png]},
hash_secret: "marketing-image-magic",
url: "/system/:class/:attachment/:id_partition/:style/:hash.:extension",
storage: :s3,
s3_credentials: {
bucket: ENV['AWS_BUCKET_NAME'],
access_key_id: ENV['AWS_ACCESS_KEY_ID'],
secret_access_key: ENV['AWS_SECRET_ACCESS_KEY'] },
s3_permissions: :public_read,
s3_headers: { 'Cache-Control' => 'max-age=315576000',
'Expires' => 10.years.from_now.httpdate },
s3_protocol: 'https'
and the credentials are stored in .env file.
All the tests are green on localhost but some fail on CI Jenkins server.
The trace for one of the test case on CI server is:
CardTest#test_uses_image_validation_as_default:
ArgumentError: missing required :bucket option
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/paperclip-4.2.1/lib/paperclip/storage/s3.rb:218:in `bucket_name'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/paperclip-4.2.1/lib/paperclip/storage/s3.rb:251:in `s3_bucket'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/paperclip-4.2.1/lib/paperclip/storage/s3.rb:255:in `s3_object'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/paperclip-4.2.1/lib/paperclip/storage/s3.rb:297:in `exists?'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/paperclip-4.2.1/lib/paperclip/attachment.rb:557:in `block in queue_all_for_delete'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/paperclip-4.2.1/lib/paperclip/attachment.rb:556:in `map'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/paperclip-4.2.1/lib/paperclip/attachment.rb:556:in `queue_all_for_delete'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/paperclip-4.2.1/lib/paperclip/has_attached_file.rb:92:in `block in add_active_record_callbacks'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.10/lib/active_support/callbacks.rb:443:in `instance_exec'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.10/lib/active_support/callbacks.rb:443:in `block in make_lambda'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.10/lib/active_support/callbacks.rb:161:in `call'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.10/lib/active_support/callbacks.rb:161:in `block in halting'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.10/lib/active_support/callbacks.rb:501:in `call'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.10/lib/active_support/callbacks.rb:501:in `block in call'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.10/lib/active_support/callbacks.rb:501:in `each'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.10/lib/active_support/callbacks.rb:501:in `call'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.10/lib/active_support/callbacks.rb:86:in `run_callbacks'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/activerecord-4.1.10/lib/active_record/callbacks.rb:292:in `destroy'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/activerecord-4.1.10/lib/active_record/transactions.rb:263:in `block in destroy'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/activerecord-4.1.10/lib/active_record/transactions.rb:329:in `block in with_transaction_returning_status'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/activerecord-4.1.10/lib/active_record/connection_adapters/abstract/database_statements.rb:201:in `block in transaction'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/activerecord-4.1.10/lib/active_record/connection_adapters/abstract/database_statements.rb:209:in `within_new_transaction'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/activerecord-4.1.10/lib/active_record/connection_adapters/abstract/database_statements.rb:201:in `transaction'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/activerecord-4.1.10/lib/active_record/transactions.rb:208:in `transaction'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/activerecord-4.1.10/lib/active_record/transactions.rb:326:in `with_transaction_returning_status'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/activerecord-4.1.10/lib/active_record/transactions.rb:263:in `destroy'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/activerecord-4.1.10/lib/active_record/associations/has_one_association.rb:81:in `remove_target!'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/activerecord-4.1.10/lib/active_record/associations/has_one_association.rb:35:in `block in replace'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/activerecord-4.1.10/lib/active_record/associations/has_one_association.rb:101:in `transaction_if'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/activerecord-4.1.10/lib/active_record/associations/has_one_association.rb:34:in `replace'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/activerecord-4.1.10/lib/active_record/associations/has_one_association.rb:73:in `set_new_record'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/protected_attributes-1.0.9/lib/active_record/mass_assignment_security/associations.rb:121:in `build'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/activerecord-4.1.10/lib/active_record/associations/builder/singular_association.rb:18:in `build_card'
/var/lib/jenkins/jobs/PunchhServer/workspace/test/models/card_test.rb:14:in `test_uses_image_validation_as_default'
and one more
Api::V1::CardsControllerTest#test_index:
ArgumentError: missing required :bucket option
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/paperclip-4.2.1/lib/paperclip/storage/s3.rb:218:in `bucket_name'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/paperclip-4.2.1/lib/paperclip/storage/s3.rb:173:in `block in extended'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/paperclip-4.2.1/lib/paperclip/interpolations.rb:34:in `block (2 levels) in interpolate'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/paperclip-4.2.1/lib/paperclip/interpolations.rb:33:in `gsub'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/paperclip-4.2.1/lib/paperclip/interpolations.rb:33:in `block in interpolate'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/paperclip-4.2.1/lib/paperclip/interpolations.rb:32:in `each'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/paperclip-4.2.1/lib/paperclip/interpolations.rb:32:in `inject'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/paperclip-4.2.1/lib/paperclip/interpolations.rb:32:in `interpolate'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/paperclip-4.2.1/lib/paperclip/url_generator.rb:13:in `for'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/paperclip-4.2.1/lib/paperclip/attachment.rb:143:in `url'
/var/lib/jenkins/jobs/PunchhServer/workspace/app/models/card.rb:131:in `marketing_image_url'
/var/lib/jenkins/jobs/PunchhServer/workspace/app/serializers/api_cardmeta.rb:121:in `marketing_image_url'
(eval):29:in `_fast_attributes'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/active_model_serializers-0.8.2/lib/active_model/serializer.rb:467:in `rescue in attributes'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/active_model_serializers-0.8.2/lib/active_model/serializer.rb:455:in `attributes'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/active_model_serializers-0.8.2/lib/active_model/serializer.rb:479:in `_serializable_hash'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/active_model_serializers-0.8.2/lib/active_model/serializer.rb:361:in `serializable_hash'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/active_model_serializers-0.8.2/lib/active_model/array_serializer.rb:89:in `block in _serializable_array'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/active_model_serializers-0.8.2/lib/active_model/array_serializer.rb:79:in `map'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/active_model_serializers-0.8.2/lib/active_model/array_serializer.rb:79:in `_serializable_array'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/active_model_serializers-0.8.2/lib/active_model/array_serializer.rb:73:in `serializable_array'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/active_model_serializers-0.8.2/lib/active_model/array_serializer.rb:53:in `as_json'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.10/lib/active_support/json/encoding.rb:34:in `encode'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.10/lib/active_support/json/encoding.rb:21:in `encode'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.10/lib/active_support/core_ext/object/json.rb:37:in `to_json_with_active_support_encoder'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/active_model_serializers-0.8.2/lib/active_model/array_serializer.rb:63:in `to_json'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/actionpack-4.1.10/lib/action_controller/metal/renderers.rb:96:in `block in <module:Renderers>'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/active_model_serializers-0.8.2/lib/action_controller/serialization.rb:46:in `_render_option_json'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/actionpack-4.1.10/lib/action_controller/metal/renderers.rb:39:in `block in _handle_render_options'
/usr/local/lib/ruby/2.2.0/set.rb:283:in `each_key'
/usr/local/lib/ruby/2.2.0/set.rb:283:in `each'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/actionpack-4.1.10/lib/action_controller/metal/renderers.rb:36:in `_handle_render_options'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/actionpack-4.1.10/lib/action_controller/metal/renderers.rb:32:in `render_to_body'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/actionpack-4.1.10/lib/abstract_controller/rendering.rb:25:in `render'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/actionpack-4.1.10/lib/action_controller/metal/rendering.rb:16:in `render'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/actionpack-4.1.10/lib/action_controller/metal/instrumentation.rb:44:in `block (2 levels) in render'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.10/lib/active_support/core_ext/benchmark.rb:12:in `block in ms'
/usr/local/lib/ruby/2.2.0/benchmark.rb:303:in `realtime'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.10/lib/active_support/core_ext/benchmark.rb:12:in `ms'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/actionpack-4.1.10/lib/action_controller/metal/instrumentation.rb:44:in `block in render'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/actionpack-4.1.10/lib/action_controller/metal/instrumentation.rb:87:in `cleanup_view_runtime'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/activerecord-4.1.10/lib/active_record/railties/controller_runtime.rb:25:in `cleanup_view_runtime'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/actionpack-4.1.10/lib/action_controller/metal/instrumentation.rb:43:in `render'
/var/lib/jenkins/jobs/PunchhServer/workspace/app/controllers/api/v1/cards_controller.rb:8:in `index'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/actionpack-4.1.10/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/actionpack-4.1.10/lib/abstract_controller/base.rb:189:in `process_action'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/actionpack-4.1.10/lib/action_controller/metal/rendering.rb:10:in `process_action'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/actionpack-4.1.10/lib/abstract_controller/callbacks.rb:20:in `block in process_action'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.10/lib/active_support/callbacks.rb:113:in `call'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.10/lib/active_support/callbacks.rb:113:in `call'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.10/lib/active_support/callbacks.rb:552:in `block (2 levels) in compile'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.10/lib/active_support/callbacks.rb:502:in `call'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.10/lib/active_support/callbacks.rb:502:in `call'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.10/lib/active_support/callbacks.rb:86:in `run_callbacks'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/actionpack-4.1.10/lib/abstract_controller/callbacks.rb:19:in `process_action'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/actionpack-4.1.10/lib/action_controller/metal/rescue.rb:29:in `process_action'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/actionpack-4.1.10/lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.10/lib/active_support/notifications.rb:159:in `block in instrument'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.10/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.10/lib/active_support/notifications.rb:159:in `instrument'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/actionpack-4.1.10/lib/action_controller/metal/instrumentation.rb:30:in `process_action'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/actionpack-4.1.10/lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/activerecord-4.1.10/lib/active_record/railties/controller_runtime.rb:18:in `process_action'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/actionpack-4.1.10/lib/abstract_controller/base.rb:136:in `process'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/actionview-4.1.10/lib/action_view/rendering.rb:30:in `process'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/actionpack-4.1.10/lib/action_controller/test_case.rb:595:in `process'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/apipie-rails-0.3.2/lib/apipie/extractor/recorder.rb:153:in `process_with_api_recording'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/actionpack-4.1.10/lib/action_controller/test_case.rb:64:in `process'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/devise-3.3.0/lib/devise/test_helpers.rb:19:in `block in process'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/devise-3.3.0/lib/devise/test_helpers.rb:72:in `catch'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/devise-3.3.0/lib/devise/test_helpers.rb:72:in `_catch_warden'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/devise-3.3.0/lib/devise/test_helpers.rb:19:in `process'
/var/lib/jenkins/jobs/PunchhServer/workspace/vendor/bundle/ruby/2.2.0/gems/actionpack-4.1.10/lib/action_controller/test_case.rb:495:in `get'
/var/lib/jenkins/jobs/PunchhServer/workspace/test/controllers/api/v1/cards_controller_test.rb:60:in `test_index'
How can I remove this error?
I've seemingly set up Devise for my User authentication, with the :confirmable option set.
Everything seems to run fine when I run it in the browser, I sign up, go to the confirmation url shown in the server log in my rails s console.
However, when I try to add the following to my db/seed.rb
User.create!(:username => 'haar', :email => 'haar#example.com', :password => 'password', :password_confirmation => 'password')
And run rake db:setup --trace
I get the following error:
rake aborted!
undefined method `confirmation_url' for #<#<Class:0x1062f79a0>:0x1062f6618>
/Users/haar/Dropbox/Websites/TenOutOfTen/app/views/devise/mailer/confirmation_instructions.html.haml:4:in `_app_views_devise_mailer_confirmation_instructions_html_haml___1737567023_2199377480_0'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/actionpack-3.0.8/lib/action_view/template.rb:135:in `send'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/actionpack-3.0.8/lib/action_view/template.rb:135:in `render'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/activesupport-3.0.8/lib/active_support/notifications.rb:54:in `instrument'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/actionpack-3.0.8/lib/action_view/template.rb:127:in `render'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/actionpack-3.0.8/lib/action_view/render/rendering.rb:59:in `_render_template'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/activesupport-3.0.8/lib/active_support/notifications.rb:52:in `instrument'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/activesupport-3.0.8/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/activesupport-3.0.8/lib/active_support/notifications.rb:52:in `instrument'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/actionpack-3.0.8/lib/action_view/render/rendering.rb:56:in `_render_template'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/actionpack-3.0.8/lib/action_view/render/rendering.rb:26:in `render_without_haml'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/haml-3.1.3/lib/haml/helpers/action_view_mods.rb:13:in `render'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/actionpack-3.0.8/lib/abstract_controller/rendering.rb:115:in `_render_template'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/actionpack-3.0.8/lib/abstract_controller/rendering.rb:109:in `render_to_body'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/actionpack-3.0.8/lib/abstract_controller/rendering.rb:102:in `render_to_string'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/actionpack-3.0.8/lib/abstract_controller/rendering.rb:93:in `render'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/actionmailer-3.0.8/lib/action_mailer/deprecated_api.rb:111:in `render'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/actionmailer-3.0.8/lib/action_mailer/base.rb:735:in `collect_responses_and_parts_order'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/actionmailer-3.0.8/lib/action_mailer/base.rb:750:in `each'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/actionmailer-3.0.8/lib/action_mailer/base.rb:750:in `each_template'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/actionmailer-3.0.8/lib/action_mailer/base.rb:745:in `each'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/actionmailer-3.0.8/lib/action_mailer/base.rb:745:in `each_template'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/actionmailer-3.0.8/lib/action_mailer/base.rb:731:in `collect_responses_and_parts_order'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/actionmailer-3.0.8/lib/action_mailer/base.rb:673:in `mail'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/devise-1.4.5/lib/devise/mailers/helpers.rb:21:in `devise_mail'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/devise-1.4.5/app/mailers/devise/mailer.rb:5:in `confirmation_instructions'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/actionpack-3.0.8/lib/abstract_controller/base.rb:150:in `send_action'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/actionpack-3.0.8/lib/abstract_controller/base.rb:150:in `process_action'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/actionpack-3.0.8/lib/abstract_controller/base.rb:119:in `process'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/actionpack-3.0.8/lib/abstract_controller/rendering.rb:41:in `process'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/actionmailer-3.0.8/lib/action_mailer/old_api.rb:75:in `process'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/actionmailer-3.0.8/lib/action_mailer/base.rb:471:in `process'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/actionmailer-3.0.8/lib/action_mailer/base.rb:466:in `initialize'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/actionmailer-3.0.8/lib/action_mailer/base.rb:450:in `new'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/actionmailer-3.0.8/lib/action_mailer/base.rb:450:in `method_missing'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/devise-1.4.5/lib/devise/models/confirmable.rb:50:in `send_confirmation_instructions'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/activesupport-3.0.8/lib/active_support/callbacks.rb:423:in `_run_create_callbacks'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/activerecord-3.0.8/lib/active_record/callbacks.rb:277:in `create'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/activerecord-3.0.8/lib/active_record/persistence.rb:250:in `create_or_update'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/activerecord-3.0.8/lib/active_record/callbacks.rb:273:in `create_or_update'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/activesupport-3.0.8/lib/active_support/callbacks.rb:419:in `_run_save_callbacks'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/activerecord-3.0.8/lib/active_record/callbacks.rb:273:in `create_or_update'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/activerecord-3.0.8/lib/active_record/persistence.rb:60:in `save!'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/activerecord-3.0.8/lib/active_record/validations.rb:49:in `save!'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/activerecord-3.0.8/lib/active_record/attribute_methods/dirty.rb:30:in `save!'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/activerecord-3.0.8/lib/active_record/transactions.rb:245:in `save!'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/activerecord-3.0.8/lib/active_record/transactions.rb:292:in `with_transaction_returning_status'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/activerecord-3.0.8/lib/active_record/connection_adapters/abstract/database_statements.rb:139:in `transaction'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/activerecord-3.0.8/lib/active_record/transactions.rb:207:in `transaction'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/activerecord-3.0.8/lib/active_record/transactions.rb:290:in `with_transaction_returning_status'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/activerecord-3.0.8/lib/active_record/transactions.rb:245:in `save!'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/activerecord-3.0.8/lib/active_record/validations.rb:34:in `create!'
/Users/haar/Dropbox/Websites/TenOutOfTen/db/seeds.rb:7
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/activesupport-3.0.8/lib/active_support/dependencies.rb:235:in `load'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/activesupport-3.0.8/lib/active_support/dependencies.rb:235:in `load'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/activesupport-3.0.8/lib/active_support/dependencies.rb:225:in `load_dependency'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/activesupport-3.0.8/lib/active_support/dependencies.rb:596:in `new_constants_in'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/activesupport-3.0.8/lib/active_support/dependencies.rb:225:in `load_dependency'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/activesupport-3.0.8/lib/active_support/dependencies.rb:235:in `load'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/activerecord-3.0.8/lib/active_record/railties/databases.rake:281
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/rake-0.9.2/lib/rake/task.rb:205:in `call'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/rake-0.9.2/lib/rake/task.rb:205:in `execute'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/rake-0.9.2/lib/rake/task.rb:200:in `each'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/rake-0.9.2/lib/rake/task.rb:200:in `execute'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/rake-0.9.2/lib/rake/task.rb:158:in `invoke_with_call_chain'
/Users/haar/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/rake-0.9.2/lib/rake/task.rb:176:in `invoke_prerequisites'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/rake-0.9.2/lib/rake/task.rb:174:in `each'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/rake-0.9.2/lib/rake/task.rb:174:in `invoke_prerequisites'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/rake-0.9.2/lib/rake/task.rb:157:in `invoke_with_call_chain'
/Users/haar/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/rake-0.9.2/lib/rake/task.rb:144:in `invoke'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/rake-0.9.2/lib/rake/application.rb:112:in `invoke_task'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/rake-0.9.2/lib/rake/application.rb:90:in `top_level'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/rake-0.9.2/lib/rake/application.rb:90:in `each'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/rake-0.9.2/lib/rake/application.rb:90:in `top_level'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/rake-0.9.2/lib/rake/application.rb:84:in `top_level'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/rake-0.9.2/lib/rake/application.rb:62:in `run'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/rake-0.9.2/lib/rake/application.rb:59:in `run'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/gems/rake-0.9.2/bin/rake:32
/Users/haar/.rvm/gems/ruby-1.8.7-p334/bin/rake:19:in `load'
/Users/haar/.rvm/gems/ruby-1.8.7-p334/bin/rake:19
Tasks: TOP => db:setup => db:seed
Any idea what's causing this and how to resolve it?
I have the following line included in my test environment, for the record:
config.action_mailer.default_url_options = { :host => "localhost:3000" }
Running on Ruby 1.8.7, Rails 3.0.8, with devise 1.4.5.
It simply turned out that when I ran rails generate devise:views, it generated incorrect paths when compared to the routes devise_for :user generated. It also generated some other issues, such as the user_confirmation_url pointing to #resource, as the first parameter; when it shouldn't have.
(I didn't want the question to be left unanswered, I'm unsure as to the typical etiquette. If I'm wrong in doing this, please let me know).
I also had the same issue just doing restart my server do the job for me and this error removed.
just do CTRL + c and then start your server using rails s
As an additional, if you're using STI with Devise models, as I am, you can check via the type attribute. So, my code looks like this:
<p><%= link_to 'Confirm my account', manager_confirmation_url(:confirmation_token => #resource.confirmation_token) if #resource.type == 'Manager' %></p>
<p><%= link_to 'Confirm my account', subscriber_confirmation_url(:confirmation_token => #resource.confirmation_token) if #resource.type == 'Subscriber' %></p>