Any reason why a simple update would work locally but not in production on heroku (the repos are identical, everything up to date)? In the logs below I can see the parameter to be updated is making it into the request, but somehow the sql output only updates updated at:
Video Update (3.1ms) UPDATE "videos" SET "updated_at" = $1 WHERE "videos"."id" = $2 [["updated_at", "2018-01-07 20:54:51.465131"], ["id", 85]]
In Development the exact same code produces in the dev server logs:
Video Update (0.7ms) UPDATE "videos" SET "imdb_id" = $1, "updated_at" = $2 WHERE "videos"."id" = $3 [["imdb_id", "566"], ["updated_at", "2018-01-07 20:09:28.366552"], ["id", 119]]
So an update is being made but without the parameter, even though the param is whitelisted and included in the request log. I'm not even sure what information to include with this question or where the problem is (rails, postgres, heroku).
My production log:
2018-01-07T20:54:51.408709+00:00 app[web.1]: I, [2018-01-07T20:54:51.408622 #4] INFO -- : [6fad6a5f-021f-46ec-93a8-de53735f66f1] Processing by VideosController#update as HTML
2018-01-07T20:54:51.408843+00:00 app[web.1]: I, [2018-01-07T20:54:51.408752 #4] INFO -- : [6fad6a5f-021f-46ec-93a8-de53735f66f1] Parameters: {"utf8"=>"✓", "authenticity_token"=>"NJR5RNVHisPn1rDbglvmEIE80fk3pZjEfZ0YqOpXKGldRLR2JitrJrGf/syXfMaO8AiMtvo7N/EJqM/ToLkSLQ==", "file"=>"", "video"=>{"title"=>"Coco", "description"=>"", "imdb_id"=>"777", "public"=>"true"}, "commit"=>"Update", "id"=>"85"}
2018-01-07T20:54:51.445716+00:00 app[web.1]: D, [2018-01-07T20:54:51.445569 #4] DEBUG -- : [6fad6a5f-021f-46ec-93a8-de53735f66f1] Video Load (7.6ms) SELECT "videos".* FROM "videos" WHERE "videos"."id" = $1 LIMIT $2 [["id", 85], ["LIMIT", 1]]
2018-01-07T20:54:51.448739+00:00 app[web.1]: D, [2018-01-07T20:54:51.448624 #4] DEBUG -- : [6fad6a5f-021f-46ec-93a8-de53735f66f1] User Load (1.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT $2 [["id", 7], ["LIMIT", 1]]
2018-01-07T20:54:51.451649+00:00 app[web.1]: D, [2018-01-07T20:54:51.451565 #4] DEBUG -- : [6fad6a5f-021f-46ec-93a8-de53735f66f1] (0.9ms) BEGIN
2018-01-07T20:54:51.459864+00:00 app[web.1]: D, [2018-01-07T20:54:51.459743 #4] DEBUG -- : [6fad6a5f-021f-46ec-93a8-de53735f66f1] User Load (5.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT $2 [["id", 7], ["LIMIT", 1]]
2018-01-07T20:54:51.485827+00:00 app[web.1]: D, [2018-01-07T20:54:51.485674 #4] DEBUG -- : [6fad6a5f-021f-46ec-93a8-de53735f66f1] Video Update (3.1ms) UPDATE "videos" SET "updated_at" = $1 WHERE "videos"."id" = $2 [["updated_at", "2018-01-07 20:54:51.465131"], ["id", 85]]
2018-01-07T20:54:51.490476+00:00 app[web.1]: D, [2018-01-07T20:54:51.490385 #4] DEBUG -- : [6fad6a5f-021f-46ec-93a8-de53735f66f1] (2.4ms) COMMIT
2018-01-07T20:54:51.491713+00:00 app[web.1]: I, [2018-01-07T20:54:51.491568 #4] INFO -- : [6fad6a5f-021f-46ec-93a8-de53735f66f1] Redirected to https://www.browzable.com/library
It worked after I restarted Heroku. Maybe it didn't restart after my migration.
have a working cart/checkout functionality on my app which works perfectly fine on localhost, but when I deploy to Heroku items don't get added to the cart when the "Add to Cart" button is clicked.
The Heroku logs show this for the error:
2017-05-19T21:12:00.506230+00:00 app[web.1]: Started POST "/order_items" for 68.225.227.137 at 2017-05-19 21:12:00 +0000
2017-05-19T21:12:00.508991+00:00 app[web.1]: Processing by OrderItemsController#create as JS
2017-05-19T21:12:00.511223+00:00 app[web.1]: User Load (0.8ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT 1 [["id", 1]]
2017-05-19T21:12:00.509041+00:00 app[web.1]: Parameters: {"utf8"=>"✓", "order_item"=>{"quantity"=>"1", "product_id"=>"2"}, "commit"=>"Add to Cart"}
2017-05-19T21:12:00.516450+00:00 app[web.1]: Product Load (0.7ms) SELECT "products".* FROM "products" WHERE "products"."active" = $1 AND "products"."id" = $2 LIMIT 1 [["active", "t"], ["id", 2]]
2017-05-19T21:12:00.513630+00:00 app[web.1]: (0.6ms) BEGIN
2017-05-19T21:12:00.531537+00:00 app[web.1]: SQL (12.8ms) INSERT INTO "orders" ("user_id", "subtotal", "created_at", "updated_at", "order_status_id") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["user_id", 1], ["subtotal", "499.0"], ["created_at", "2017-05-19 21:12:00.517193"], ["updated_at", "2017-05-19 21:12:00.517193"], ["order_status_id", 1]]
2017-05-19T21:12:00.532478+00:00 app[web.1]: (0.8ms) ROLLBACK
2017-05-19T21:12:00.533488+00:00 app[web.1]:
2017-05-19T21:12:00.532671+00:00 app[web.1]: Completed 500 Internal Server Error in 24ms (ActiveRecord: 15.8ms)
2017-05-19T21:12:00.533491+00:00 app[web.1]: DETAIL: Key (order_status_id)=(1) is not present in table "order_statuses".
2017-05-19T21:12:00.533490+00:00 app[web.1]: ActiveRecord::InvalidForeignKey (PG::ForeignKeyViolation: ERROR: insert or update on table "orders" violates foreign key constraint "fk_rails_7a22cf8b0e"
2017-05-19T21:12:00.533492+00:00 app[web.1]: : INSERT INTO "orders" ("user_id", "subtotal", "created_at", "updated_at", "order_status_id") VALUES ($1, $2, $3, $4, $5) RETURNING "id"):
2017-05-19T21:12:00.533493+00:00 app[web.1]: app/controllers/order_items_controller.rb:7:in `create'
2017-05-19T21:12:00.533494+00:00 app[web.1]:
2017-05-19T21:12:00.533495+00:00 app[web.1]:
2017-05-19T21:12:06.465383+00:00 heroku[router]: at=info method=POST path="/order_items" host=aloop-offroad.herokuapp.com request_id=b13e7b04-7ac0-44fe-b58f-a850ce4cd7e8 fwd="68.225.227.137" dyno=web.1 connect=0ms service=16ms status=500 bytes=1754 protocol=http
Can anyone see what's happening? I'm lost because I can't see anything that would work on localhost but not Heroku.
Your error is, boiled down, that you're trying to insert a record into orders with a value for order_status_id that violates a constraint. This is probably because you seeded your database locally with a few OrderStatus objects and hardcoded their ids into your code. Those records don't exist in your production database, though. You should probably update your code to pull the order status options from the database on request, and then create the relevant status records in your production database.
I am attempting to connect Amazon S3 to my site so to store user avatars. I expect users to be able to add an avatar to their profiles, but it seems that I am denied access. I've looked at and tried several solutions with no success:
Ruby Amazon S3 Access Denied when listing buckets
How to solve “Access Denied” with Heroku + Paperclip + S3 + ROR
Uploading to S3 With Paperclip
Error message:
AWS::S3::Errors::AccessDenied: Access Denied File "/app/app/controllers/profiles_controller.rb", line 13 in create
Full Trace:
2016-02-03T23:30:12.826846+00:00 app[web.1]: Rendered pages/home.html.erb within layouts/application (1.3ms)
2016-02-03T23:30:12.830420+00:00 app[web.1]: Completed 200 OK in 9ms (Views: 6.1ms | ActiveRecord: 1.2ms)
2016-02-03T23:30:12.821127+00:00 app[web.1]: Processing by PagesController#home as HTML
2016-02-03T23:30:12.830151+00:00 app[web.1]: Rendered layouts/_header.html.erb (0.9ms)
2016-02-03T23:30:12.824076+00:00 app[web.1]: Plan Load (0.5ms) SELECT "plans".* FROM "plans" WHERE "plans"."name" = 'mentee' LIMIT 1
2016-02-03T23:31:23.614411+00:00 app[web.1]: Processing by ProfilesController#create as HTML
2016-02-03T23:31:23.618346+00:00 app[web.1]: User Load (1.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = 32 ORDER BY "users"."id" ASC LIMIT 1
2016-02-03T23:31:23.621171+00:00 app[web.1]: CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT 1 [["id", "32"]]
2016-02-03T23:31:23.642828+00:00 app[web.1]: Command :: identify -format '%wx%h,%[exif:orientation]' '/tmp/907d62dfd370e834d14b2f9e69569f8f20160203-3-oy7ex6.jpg[0]' 2>/dev/null
2016-02-03T23:31:23.731583+00:00 app[web.1]: Command :: convert '/tmp/907d62dfd370e834d14b2f9e69569f8f20160203-3-oy7ex6.jpg[0]' -auto-orient -resize "300x300>" '/tmp/907d62dfd370e834d14b2f9e69569f8f20160203-3-oy7ex620160203-3-zkzzqj'
2016-02-03T23:31:23.610892+00:00 app[web.1]: Started POST "/users/32/profile" for 108.80.140.163 at 2016-02-03 23:31:23 +0000
2016-02-03T23:31:23.615000+00:00 app[web.1]: Parameters: {"utf8"=>"✓", "authenticity_token"=>"ArxGVYON7jf+nRR9HfMcpHWxSgk4uHIw7ELCnDaJhvc=", "profile"=>{"not_available"=>"0", "first_name"=>"Kim", "last_name"=>"Crayton", "avatar"=>#<ActionDispatch::Http::UploadedFile:0x007fe496024c48 #tempfile=#<Tempfile:/tmp/RackMultipart20160203-3-1nmybbz>, #original_filename="Kim Crayton.jpg", #content_type="image/jpeg", #headers="Content-Disposition: form-data; name=\"profile[avatar]\"; filename=\"Kim Crayton.jpg\"\r\nContent-Type: image/jpeg\r\n">, "contact_email"=>"kimmcrayton#gmail.com", "city"=>"Atlanta", "state"=>"GA", "country"=>"USA", "coding_languages"=>"HTML, CSS, JavaScript, Python", "bio"=>"I was an educator, writer, and researcher in another life who decided to dive into the coding end of the pool. I've learned the basics on my own and like most who want to swim in the Olympics, I need a good coach to get me to the next level.", "mentoring_needs"=>"To be able to level up my skill set to become employed as a Jr. Developer"}, "commit"=>"Update Profile", "user_id"=>"32"}
2016-02-03T23:31:23.620344+00:00 app[web.1]: User Load (0.8ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT 1 [["id", 32]]
2016-02-03T23:31:23.629345+00:00 app[web.1]: Command :: file -b --mime '/tmp/7ad9d08462a928e43510aef94b436bb820160203-3-1p8wtua.jpg'
2016-02-03T23:31:23.717450+00:00 app[web.1]: Command :: identify -format %m '/tmp/907d62dfd370e834d14b2f9e69569f8f20160203-3-oy7ex6.jpg[0]'
2016-02-03T23:31:24.346558+00:00 app[web.1]: Command :: file -b --mime '/tmp/907d62dfd370e834d14b2f9e69569f8f20160203-3-oy7ex620160203-3-zkzzqj'
2016-02-03T23:31:24.468671+00:00 app[web.1]: Command :: identify -format '%wx%h,%[exif:orientation]' '/tmp/907d62dfd370e834d14b2f9e69569f8f20160203-3-oy7ex6.jpg[0]' 2>/dev/null
2016-02-03T23:31:25.276211+00:00 app[web.1]: Command :: identify -format %m '/tmp/907d62dfd370e834d14b2f9e69569f8f20160203-3-oy7ex6.jpg[0]'
2016-02-03T23:31:25.356070+00:00 app[web.1]: Command :: convert '/tmp/907d62dfd370e834d14b2f9e69569f8f20160203-3-oy7ex6.jpg[0]' -auto-orient -resize "100x100>" '/tmp/907d62dfd370e834d14b2f9e69569f8f20160203-3-oy7ex620160203-3-6j3feu'
2016-02-03T23:31:25.933442+00:00 app[web.1]: Command :: file -b --mime '/tmp/907d62dfd370e834d14b2f9e69569f8f20160203-3-oy7ex620160203-3-6j3feu'
2016-02-03T23:31:25.968535+00:00 app[web.1]: (1.8ms) BEGIN
2016-02-03T23:31:26.011723+00:00 app[web.1]: SQL (1.9ms) INSERT INTO "profiles" ("avatar_content_type", "avatar_file_name", "avatar_file_size", "avatar_updated_at", "bio", "city", "coding_languages", "contact_email", "country", "created_at", "first_name", "last_name", "mentoring_needs", "state", "updated_at", "user_id") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16) RETURNING "id" [["avatar_content_type", "image/jpeg"], ["avatar_file_name", "Kim_Crayton.jpg"], ["avatar_file_size", 588778], ["avatar_updated_at", "2016-02-03 23:31:23.627122"], ["bio", "I was an educator, writer, and researcher in another life who decided to dive into the coding end of the pool. I've learned the basics on my own and like most who want to swim in the Olympics, I need a good coach to get me to the next level."], ["city", "Atlanta"], ["coding_languages", "HTML, CSS, JavaScript, Python"], ["contact_email", "kimmcrayton#gmail.com"], ["country", "USA"], ["created_at", "2016-02-03 23:31:26.002769"], ["first_name", "Kim"], ["last_name", "Crayton"], ["mentoring_needs", "To be able to level up my skill set to become employed as a Jr. Developer"], ["state", "GA"], ["updated_at", "2016-02-03 23:31:26.002769"], ["user_id", 32]]
2016-02-03T23:31:25.965320+00:00 app[web.1]: Profile Load (8.5ms) SELECT "profiles".* FROM "profiles" WHERE "profiles"."user_id" = $1 LIMIT 1 [["user_id", 32]]
2016-02-03T23:31:26.012791+00:00 app[web.1]: [paperclip] saving /profiles/avatars/000/000/024/original/Kim_Crayton.jpg
2016-02-03T23:31:25.972587+00:00 app[web.1]: Command :: file -b --mime '/tmp/7ad9d08462a928e43510aef94b436bb820160203-3-1fkobfh.jpg'
2016-02-03T23:31:26.192049+00:00 app[web.1]: [AWS S3 403 0.176059 0 retries] put_object(:acl=>:public_read,:bucket_name=>"BUCKET_NAME_VALUE",:content_length=>588778,:content_type=>"image/jpeg",:data=>Paperclip::UploadedFileAdapter: Kim Crayton.jpg,:key=>"profiles/avatars/000/000/024/original/Kim_Crayton.jpg") AWS::S3::Errors::AccessDenied Access Denied
2016-02-03T23:31:26.192052+00:00 app[web.1]:
2016-02-03T23:31:26.199059+00:00 app[web.1]: (5.4ms) ROLLBACK
2016-02-03T23:31:26.239693+00:00 app[web.1]: Completed 500 Internal Server Error in 2625ms
2016-02-03T23:31:26.278651+00:00 app[web.1]: [Rollbar] Scheduling payload
2016-02-03T23:31:26.278749+00:00 app[web.1]: [Rollbar] Sending payload
2016-02-03T23:31:26.255527+00:00 app[web.1]: [Rollbar] Reporting exception: Access Denied
2016-02-03T23:31:26.565131+00:00 heroku[router]: at=info method=POST path="/users/32/profile" host=www.jrdevmentoring.com request_id=39b4d6a4-de82-4746-bba2-15326511c36c fwd="108.80.140.163" dyno=web.1 connect=0ms service=5691ms status=500 bytes=1754
2016-02-03T23:31:26.556786+00:00 app[web.1]: [Rollbar] Success
2016-02-03T23:31:26.556867+00:00 app[web.1]: [Rollbar] Details: https://rollbar.com/instance/uuid?uuid=e2c97cca-326f-4501-a1ac-dabcedc8d047 (only available if report was successful)
2016-02-03T23:31:26.556955+00:00 app[web.1]: [Rollbar] Exception uuid saved in env: e2c97cca-326f-4501-a1ac-dabcedc8d047
2016-02-03T23:31:26.562072+00:00 app[web.1]:
2016-02-03T23:31:26.562074+00:00 app[web.1]: app/controllers/profiles_controller.rb:13:in `create'
2016-02-03T23:31:26.562075+00:00 app[web.1]:
2016-02-03T23:31:26.562074+00:00 app[web.1]: AWS::S3::Errors::AccessDenied (Access Denied):
2016-02-03T23:31:26.562075+00:00 app[web.1]:
2016-02-03T23:32:23.939135+00:00 heroku[router]: at=info method=GET path="/users/32/profile/new" host=www.jrdevmentoring.com request_id=a926abfc-e512-42cc-bcf0-b49f0e660051 fwd="108.80.140.163" dyno=web.1 connect=0ms service=22ms status=304 bytes=844
2016-02-03T23:32:23.921568+00:00 app[web.1]: Parameters: {"user_id"=>"32"}
2016-02-03T23:32:23.921563+00:00 app[web.1]: Processing by ProfilesController#new as HTML
2016-02-03T23:32:23.924214+00:00 app[web.1]: User Load (0.8ms) SELECT "users".* FROM "users" WHERE "users"."id" = 32 ORDER BY "users"."id" ASC LIMIT 1
2016-02-03T23:32:23.926869+00:00 app[web.1]: CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT 1 [["id", "32"]]
2016-02-03T23:32:23.934672+00:00 app[web.1]: Rendered profiles/_form.html.erb (5.2ms)
2016-02-03T23:32:23.934795+00:00 app[web.1]: Rendered profiles/new.html.erb within layouts/mentee_layout (5.5ms)
2016-02-03T23:32:23.935958+00:00 app[web.1]: Rendered layouts/_header.html.erb (0.4ms)
2016-02-03T23:32:23.919293+00:00 app[web.1]: Started GET "/users/32/profile/new" for 108.80.140.163 at 2016-02-03 23:32:23 +0000
2016-02-03T23:32:23.926294+00:00 app[web.1]: User Load (1.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT 1 [["id", 32]]
2016-02-03T23:32:23.936324+00:00 app[web.1]: Completed 200 OK in 15ms (Views: 8.2ms | ActiveRecord: 2.5ms)
2016-02-03T23:32:23.928924+00:00 app[web.1]: Plan Load (0.7ms) SELECT "plans".* FROM "plans" WHERE "plans"."id" = $1 LIMIT 1 [["id", 30]]
2016-02-03T23:32:24.067025+00:00 heroku[router]: at=info method=GET path="/assets/application-ccf1b63ef283bc859fc20d775228d578.js" host=www.jrdevmentoring.com request_id=fd39d73a-d506-4b69-ac11-042db1ca8cee fwd="108.80.140.163" dyno=web.1 connect=0ms service=16ms status=304 bytes=133
2016-02-03T23:32:24.051947+00:00 heroku[router]: at=info method=GET path="/assets/application-9750215382cdb39b0d4756e6b205dd25.css" host=www.jrdevmentoring.com request_id=7f1972d5-75f3-469c-9672-2d149981a9b9 fwd="108.80.140.163" dyno=web.1 connect=0ms service=8ms status=304 bytes=133
2016-02-03T23:32:28.231345+00:00 app[web.1]: User Load (0.6ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT 1 [["id", 32]]
2016-02-03T23:32:28.222520+00:00 app[web.1]: Started POST "/users/32/profile" for 108.80.140.163 at 2016-02-03 23:32:28 +0000
2016-02-03T23:32:28.367338+00:00 app[web.1]: Command :: identify -format %m '/tmp/907d62dfd370e834d14b2f9e69569f8f20160203-3-150cqxf.jpg[0]'
2016-02-03T23:32:28.240793+00:00 app[web.1]: Command :: file -b --mime '/tmp/7ad9d08462a928e43510aef94b436bb820160203-3-133toy1.jpg'
2016-02-03T23:32:28.225432+00:00 app[web.1]: Processing by ProfilesController#create as HTML
2016-02-03T23:32:28.225555+00:00 app[web.1]: Parameters: {"utf8"=>"✓", "authenticity_token"=>"ArxGVYON7jf+nRR9HfMcpHWxSgk4uHIw7ELCnDaJhvc=", "profile"=>{"not_available"=>"0", "first_name"=>"Kim", "last_name"=>"Crayton", "avatar"=>#<ActionDispatch::Http::UploadedFile:0x007fe496024c48 #tempfile=#<Tempfile:/tmp/RackMultipart20160203-3-spce1k>, #original_filename="Kim Crayton.jpg", #content_type="image/jpeg", #headers="Content-Disposition: form-data; name=\"profile[avatar]\"; filename=\"Kim Crayton.jpg\"\r\nContent-Type: image/jpeg\r\n">, "contact_email"=>"kimmcrayton#gmail.com", "city"=>"Atlanta", "state"=>"GA", "country"=>"USA", "coding_languages"=>"HTML, CSS, JavaScript, Python", "bio"=>"I was an educator, writer, and researcher in another life who decided to dive into the coding end of the pool. I've learned the basics on my own and like most who want to swim in the Olympics, I need a good coach to get me to the next level.", "mentoring_needs"=>"To be able to level up my skill set to become employed as a Jr. Developer"}, "commit"=>"Update Profile", "user_id"=>"32"}
2016-02-03T23:32:28.229747+00:00 app[web.1]: User Load (1.7ms) SELECT "users".* FROM "users" WHERE "users"."id" = 32 ORDER BY "users"."id" ASC LIMIT 1
2016-02-03T23:32:28.232006+00:00 app[web.1]: CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT 1 [["id", "32"]]
2016-02-03T23:32:28.411553+00:00 app[web.1]: Command :: convert '/tmp/907d62dfd370e834d14b2f9e69569f8f20160203-3-150cqxf.jpg[0]' -auto-orient -resize "300x300>" '/tmp/907d62dfd370e834d14b2f9e69569f8f20160203-3-150cqxf20160203-3-bep14i'
2016-02-03T23:32:28.254571+00:00 app[web.1]: Command :: identify -format '%wx%h,%[exif:orientation]' '/tmp/907d62dfd370e834d14b2f9e69569f8f20160203-3-150cqxf.jpg[0]' 2>/dev/null
2016-02-03T23:32:29.005396+00:00 app[web.1]: Command :: file -b --mime '/tmp/907d62dfd370e834d14b2f9e69569f8f20160203-3-150cqxf20160203-3-bep14i'
2016-02-03T23:32:29.215235+00:00 app[web.1]: Command :: identify -format %m '/tmp/907d62dfd370e834d14b2f9e69569f8f20160203-3-150cqxf.jpg[0]'
2016-02-03T23:32:29.042851+00:00 app[web.1]: Command :: identify -format '%wx%h,%[exif:orientation]' '/tmp/907d62dfd370e834d14b2f9e69569f8f20160203-3-150cqxf.jpg[0]' 2>/dev/null
2016-02-03T23:32:29.254140+00:00 app[web.1]: Command :: convert '/tmp/907d62dfd370e834d14b2f9e69569f8f20160203-3-150cqxf.jpg[0]' -auto-orient -resize "100x100>" '/tmp/907d62dfd370e834d14b2f9e69569f8f20160203-3-150cqxf20160203-3-18abmic'
2016-02-03T23:32:29.899670+00:00 app[web.1]: Command :: file -b --mime '/tmp/907d62dfd370e834d14b2f9e69569f8f20160203-3-150cqxf20160203-3-18abmic'
2016-02-03T23:32:29.934163+00:00 app[web.1]: SQL (1.0ms) INSERT INTO "profiles" ("avatar_content_type", "avatar_file_name", "avatar_file_size", "avatar_updated_at", "bio", "city", "coding_languages", "contact_email", "country", "created_at", "first_name", "last_name", "mentoring_needs", "state", "updated_at", "user_id") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16) RETURNING "id" [["avatar_content_type", "image/jpeg"], ["avatar_file_name", "Kim_Crayton.jpg"], ["avatar_file_size", 588778], ["avatar_updated_at", "2016-02-03 23:32:28.238610"], ["bio", "I was an educator, writer, and researcher in another life who decided to dive into the coding end of the pool. I've learned the basics on my own and like most who want to swim in the Olympics, I need a good coach to get me to the next level."], ["city", "Atlanta"], ["coding_languages", "HTML, CSS, JavaScript, Python"], ["contact_email", "kimmcrayton#gmail.com"], ["country", "USA"], ["created_at", "2016-02-03 23:32:29.931498"], ["first_name", "Kim"], ["last_name", "Crayton"], ["mentoring_needs", "To be able to level up my skill set to become employed as a Jr. Developer"], ["state", "GA"], ["updated_at", "2016-02-03 23:32:29.931498"], ["user_id", 32]]
2016-02-03T23:32:29.983370+00:00 app[web.1]: [AWS S3 403 0.044695 0 retries] put_object(:acl=>:public_read,:bucket_name=>"BUCKET_NAME_VALUE",:content_length=>588778,:content_type=>"image/jpeg",:data=>Paperclip::UploadedFileAdapter: Kim Crayton.jpg,:key=>"profiles/avatars/000/000/025/original/Kim_Crayton.jpg") AWS::S3::Errors::AccessDenied Access Denied
2016-02-03T23:32:29.989703+00:00 app[web.1]: [Rollbar] Reporting exception: Access Denied
2016-02-03T23:32:29.918738+00:00 app[web.1]: (3.9ms) BEGIN
2016-02-03T23:32:29.985462+00:00 app[web.1]: (1.0ms) ROLLBACK
2016-02-03T23:32:29.913438+00:00 app[web.1]: Profile Load (1.0ms) SELECT "profiles".* FROM "profiles" WHERE "profiles"."user_id" = $1 LIMIT 1 [["user_id", 32]]
2016-02-03T23:32:29.983374+00:00 app[web.1]:
2016-02-03T23:32:29.935107+00:00 app[web.1]: [paperclip] saving /profiles/avatars/000/000/025/original/Kim_Crayton.jpg
2016-02-03T23:32:29.920674+00:00 app[web.1]: Command :: file -b --mime '/tmp/7ad9d08462a928e43510aef94b436bb820160203-3-9amf8x.jpg'
2016-02-03T23:32:29.986839+00:00 app[web.1]: Completed 500 Internal Server Error in 1761ms
2016-02-03T23:32:30.038337+00:00 app[web.1]: [Rollbar] Sending payload
2016-02-03T23:32:30.035794+00:00 app[web.1]: [Rollbar] Scheduling payload
2016-02-03T23:32:30.297265+00:00 app[web.1]: [Rollbar] Success
2016-02-03T23:32:30.298549+00:00 app[web.1]: [Rollbar] Exception uuid saved in env: fe95e497-18b6-4711-8141-94789670b5ed
2016-02-03T23:32:30.312149+00:00 app[web.1]: app/controllers/profiles_controller.rb:13:in `create'
2016-02-03T23:32:30.312147+00:00 app[web.1]: AWS::S3::Errors::AccessDenied (Access Denied):
2016-02-03T23:32:30.298468+00:00 app[web.1]: [Rollbar] Details: https://rollbar.com/instance/uuid?uuid=fe95e497-18b6-4711-8141-94789670b5ed (only available if report was successful)
2016-02-03T23:32:30.312144+00:00 app[web.1]:
2016-02-03T23:32:30.312149+00:00 app[web.1]:
2016-02-03T23:32:30.312150+00:00 app[web.1]:
2016-02-03T23:32:30.317622+00:00 heroku[router]: at=info method=POST path="/users/32/profile" host=www.jrdevmentoring.com request_id=6930043a-4007-4c13-9a38-0cac82aac0b6 fwd="108.80.140.163" dyno=web.1 connect=0ms service=4641ms status=500 bytes=1754
2016-02-03T23:41:43.818611+00:00 heroku[router]: at=info method=GET path="/" host=www.jrdevmentoring.com request_id=05a31e30-d8d1-465e-9a0d-4a545668949a fwd="107.206.188.61" dyno=web.1 connect=0ms service=58ms status=200 bytes=3069
2016-02-03T23:41:43.800534+00:00 app[web.1]: Started GET "/" for 107.206.188.61 at 2016-02-03 23:41:43 +0000
2016-02-03T23:41:43.808750+00:00 app[web.1]: Plan Load (1.4ms) SELECT "plans".* FROM "plans" WHERE "plans"."name" = 'mentor' LIMIT 1
2016-02-03T23:41:43.815175+00:00 app[web.1]: Completed 200 OK in 9ms (Views: 4.7ms | ActiveRecord: 2.0ms)
2016-02-03T23:41:43.812975+00:00 app[web.1]: Rendered pages/home.html.erb within layouts/application (1.0ms)
2016-02-03T23:41:43.805782+00:00 app[web.1]: Processing by PagesController#home as HTML
2016-02-03T23:41:43.810095+00:00 app[web.1]: Plan Load (0.6ms) SELECT "plans".* FROM "plans" WHERE "plans"."name" = 'mentee' LIMIT 1
2016-02-03T23:41:43.814699+00:00 app[web.1]: Rendered layouts/_header.html.erb (0.5ms)
2016-02-03T23:41:44.007715+00:00 heroku[router]: at=info method=GET path="/assets/application-ccf1b63ef283bc859fc20d775228d578.js" host=www.jrdevmentoring.com request_id=8a323d54-7eb3-4f09-bbb2-cc1f245654bf fwd="107.206.188.61" dyno=web.1 connect=1ms service=20ms status=200 bytes=142105
2016-02-03T23:41:44.113132+00:00 heroku[router]: at=info method=GET path="/assets/application-9750215382cdb39b0d4756e6b205dd25.css" host=www.jrdevmentoring.com request_id=198cd717-23b5-413d-8903-9d5f944884e0 fwd="107.206.188.61" dyno=web.1 connect=0ms service=23ms status=200 bytes=114067
profiles_controller.rb
class ProfilesController < ApplicationController
before_action :authenticate_user!
before_action :only_current_user
def new
# form where a user can fill out their own profile.
#user = User.find( params[:user_id] )
#profile = Profile.new
end
def create
#user = User.find( params[:user_id] )
#profile = #user.build_profile(profile_params)
if #profile.save
flash[:success] = "Profile Updated!"
redirect_to user_path( #user )
else
flash[:danger] = "An error occurred and your profile has not been updated. You must complete all form fields."
render action: :new
end
end
def edit
#user = User.find( params[:user_id] )
#profile = #user.profile
end
def update
#user = User.find( params[:user_id] )
#profile = #user.profile
if #profile.update_attributes(profile_params)
flash[:success] = "Profile Updated!"
redirect_to user_path( params[:user_id] )
else
render action: :edit
end
end
private
def profile_params
params.require(:profile).permit(:not_available, :first_name, :last_name, :avatar, :contact_email, :city, :state, :country, :coding_languages, :bio, :mentoring_needs)
end
def only_current_user
#user = User.find( params[:user_id] )
redirect_to(root_url) unless #user == current_user
end
end
production.rb
config.paperclip_defaults = {
:storage => :s3,
:s3_credentials => {
:bucket => ENV['S3_BUCKET_NAME'],
:access_key_id => ENV['AWS_ACCESS_KEY_ID'],
:secret_access_key => ENV['AWS_SECRET_ACCESS_KEY']
}
}
profile.rb
class Profile < ActiveRecord::Base
belongs_to :user
validates :first_name, presence: true
validates :last_name, presence: true
validates :contact_email, presence: true
validates :bio, presence: true
validates :mentoring_needs, presence: true
validates_length_of :coding_languages, minimum: 1, maximum: 500
validates_length_of :bio, minimum: 1, maximum: 1000
validates_length_of :mentoring_needs, minimum: 1, maximum: 500
has_attached_file :avatar, :styles => { :medium => "300x300>", :thumb => "100x100>" }, :default_url => "/images/:style/missing.png"
validates_attachment_content_type :avatar, :content_type => /\Aimage\/.*\Z/
end
As noted in a comment by user taglia
You need to set your AWS credentials as config variables in heroku (basically environment variables). You can check if they are set with heroku config; if they are not set, you can add them with heroku config:set S3_BUCKET_NAME=something AWS_ACCESS_KEY_ID=whatever AWS_SECRET_ACCESS_KEY=something_secret. More info with heroku config --help
I had this same problem after AWS changed their policy to require an IAM user. I created the new IAM user and received new credentials for the IAM user, and after updating my app with the new credentials, I received this same error. I fixed it by going back to AWS, Services, IAM User, and creating a permission for the user to have AdministratorAccess.
I followed a tutorial and added messaging functionality in my rails app.
Yesterday, I deleted certain users. Now when I go to my messages link, I get this error message "We're sorry, but something went wrong. If you are the application owner check the logs for more information." which is usually displayed in case of errors.
I saw the log and found out that I must have deleted someone who has sent a message.
I think it's trying to retrieve message of a user that doesn't exist.
ActionView::Template::Error (undefined method `avatar' for nil:NilClass):
How can I solve this issue?
Could anyone please share how to delete all the messages and start fresh? Because the messages are not important.
How do I clear all the mailboxer tables and start fresh? Kindly help.
Here is the log.
2015-05-16T12:17:13.398640+00:00 app[web.1]: Rendered conversations/_participants.html.erb (17.3ms)
2015-05-16T12:17:13.407905+00:00 app[web.1]: CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT 1 [["id", 2225]]
2015-05-16T12:17:13.434486+00:00 app[web.1]: (16.2ms) SELECT COUNT(*) FROM "mailboxer_receipts" INNER JOIN "mailboxer_notifications" ON "mailboxer_notifications"."id" = "mailboxer_receipts"."notification_id" AND "mailboxer_notifications"."type" IN ('Mailboxer::Message') WHERE "mailboxer_notifications"."conversation_id" = 973 AND "mailboxer_receipts"."receiver_id" = $1 AND "mailboxer_receipts"."receiver_type" = $2 AND "mailboxer_receipts"."trashed" = 'f' AND "mailboxer_receipts"."is_read" = 'f' [["receiver_id", 1464], ["receiver_type", "User"]]
2015-05-16T12:17:13.453617+00:00 app[web.1]: Mailboxer::Receipt Load (1.1ms) SELECT "mailboxer_receipts".* FROM "mailboxer_receipts" WHERE "mailboxer_receipts"."notification_id" = $1 [["notification_id", 1209]]
2015-05-16T12:17:13.456255+00:00 app[web.1]: Rendered conversations/_participants.html.erb (20.5ms)
2015-05-16T12:17:13.474657+00:00 heroku[router]: at=info method=GET path="/conversations" host=www.abc.com request_id=991e2d24-c507-4e5f-9b50-5678e2e3aa2c fwd="160.3.94.130" dyno=web.1 connect=1ms service=276ms status=500 bytes=1786
2015-05-16T12:17:13.569003+00:00 heroku[router]: at=info method=GET path="/speak" host=www.abc.com request_id=c1a056f3-4431-4c90-84b8-01c285e606c1 fwd="122.174.14.148" dyno=web.2 connect=1ms service=37ms status=200 bytes=35624
2015-05-16T12:17:13.459247+00:00 app[web.1]: Mailboxer::Message Load (1.8ms) SELECT "mailboxer_notifications".* FROM "mailboxer_notifications" WHERE "mailboxer_notifications"."type" IN ('Mailboxer::Message') AND "mailboxer_notifications"."conversation_id" = $1 ORDER BY created_at DESC LIMIT 1 [["conversation_id", 782]]
2015-05-16T12:17:13.469138+00:00 app[web.1]: Rendered conversations/_conversation.html.erb (233.8ms)
2015-05-16T12:17:13.469485+00:00 app[web.1]: Rendered conversations/index.html.erb within layouts/application (249.4ms)
2015-05-16T12:17:13.469543+00:00 app[web.1]: Completed 500 Internal Server Error in 261ms
2015-05-16T12:17:13.473924+00:00 app[web.1]:
2015-05-16T12:17:13.473928+00:00 app[web.1]: ActionView::Template::Error (undefined method `avatar' for nil:NilClass):
2015-05-16T12:17:13.473930+00:00 app[web.1]: 16:
2015-05-16T12:17:13.473932+00:00 app[web.1]: 17: <span class="messageuser">
2015-05-16T12:17:13.473933+00:00 app[web.1]: 18: <%#= conversation.last_message.sender.name %>
2015-05-16T12:17:13.473936+00:00 app[web.1]: 19: <%= link_to image_tag(conversation.last_message.sender.avatar.url(:mini), class: 'img-rounded'), user_path(conversation.last_message.sender) %>
2015-05-16T12:17:13.473944+00:00 app[web.1]: 20: <%= link_to conversation.last_message.sender.name, user_path(conversation.last_message.sender) %>
2015-05-16T12:17:13.473946+00:00 app[web.1]: 21: </span>
2015-05-16T12:17:13.473948+00:00 app[web.1]: 22:
2015-05-16T12:17:13.473951+00:00 app[web.1]: app/views/conversations/_conversation.html.erb:19:in `_app_views_conversations__conversation_html_erb___2085506579815819501_69959535266760'
2015-05-16T12:17:13.473952+00:00 app[web.1]: app/views/conversations/index.html.erb:35:in `_app_views_conversations_index_html_erb___1748297580391940998_69959535151580'
2015-05-16T12:17:13.473954+00:00 app[web.1]:
2015-05-16T12:17:13.473957+00:00 app[web.1]:
2015-05-16T12:17:13.572052+00:00 app[web.1]: Started GET "/conversations" for 160.3.94.130 at 2015-05-16 12:17:13 +0000
2015-05-16T12:17:13.579974+00:00 app[web.1]: User Load (1.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT 1 [["id", 1464]]
2015-05-16T12:17:13.585203+00:00 app[web.1]: (0.9ms) SELECT COUNT(*) FROM "user_learnings" WHERE "user_learnings"."user_id" = $1 [["user_id", 1464]]
2015-05-16T12:17:13.637517+00:00 app[web.1]: (3.1ms) SELECT DISTINCT COUNT(DISTINCT "mailboxer_conversations"."id") FROM "mailboxer_conversations" INNER JOIN "mailboxer_notifications" ON "mailboxer_notifications"."conversation_id" = "mailboxer_conversations"."id" AND "mailboxer_notifications"."type" IN ('Mailboxer::Message') INNER JOIN "mailboxer_receipts" ON "mailboxer_receipts"."notification_id" = "mailboxer_notifications"."id" WHERE "mailboxer_notifications"."type" = 'Mailboxer::Message' AND "mailboxer_receipts"."receiver_id" = $1 AND "mailboxer_receipts"."receiver_type" = $2 AND "mailboxer_receipts"."mailbox_type" = $3 AND "mailboxer_receipts"."trashed" = 'f' AND "mailboxer_receipts"."deleted" = 'f' [["receiver_id", 1464], ["receiver_type", "User"], ["mailbox_type", "inbox"]]
2015-05-16T12:17:13.678884+00:00 app[web.1]: Mailboxer::Receipt Load (1.2ms) SELECT "mailboxer_receipts".* FROM "mailboxer_receipts" WHERE "mailboxer_receipts"."notification_id" = $1 [["notification_id", 1443]]
2015-05-16T12:17:13.698778+00:00 app[web.1]: User Load (4.5ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT 1 [["id", 1464]]
2015-05-16T12:17:13.464477+00:00 app[web.1]: User Load (1.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT 1 [["id", 1937]]
I grew impatient and destroyed them all.
irb(main):002:0> Mailboxer::Conversation.destroy_all
Now the errors are gone and I am able to send messages.
I didn't know how to delete the conversations of 800 users I deleted recently.
You are right. The application is calling methods on users that do not exist. For example:
```
<%= link_to conversation.last_message.sender.name...
(conversation.last_message) is saved, but sender does not exist.
If you want to start the database from scratch you can run (rake db:reset), that will drop create and migrate your database.
To solve the issue create a method that runs every time a user cancels or deletes his/her account, and that it deletes that user's conversations.
Try this is your console (rails c), it will delete the first user's conversations.
```
User.first.mailbox.conversations.each do |i| i.delete end
If you still want to show the conversation to the other user who did not canceled his account. You have to save that name somewhere else or show the user that the sender deleted his account.
```
<% if conversation.sender == null %>
<%= conversation.last_message %>
<p>User of this conversation deleted his/her account</p>
<%else%>
<%= conversation.last_message %>
<%= conversation.last_message.sender.name %>
<% end %>
Sounds like one unoptimized way to do it would be loop through on the model that has messaging functionality added to it with acts_as_messageable..like MyModel.each do |mod| mod.mailbox.conversations.destroy_all end
I am new to mailers in rails. I have deployed to heroku and the emails are sending and being received fine. The issue is that none of the mailers are rendering the views.
That was not always the case. I must have moved something vital to that connection and broke the connection. Can you tell me how to reconnect the views to the mailer?
I am on rails 3.2 and here is the information you may need to answer:
In the invitation model:
after_create do |invitation|
InvitationMailer.delay.invitation_email(self)
end
And in mailers:
class InvitationMailer < ActionMailer::Base
helper ActionView::Helpers::UrlHelper
default from: "noreply#lumeo.com"
def invitation_email(invite)
#invitation = invite
mail(to: invite.recipient_email,
subject: "Invitation",
:template_path => 'mailers/invitation_email')
end
end
And finally, the view is located at views/mailers:
You are invited to join our beta!
<%= link_to 'Sign Up', signup_with_token_url(#invitation.token) %>
This line is routed correctly and is working as I have tested it in the past, but the view is no longer rendered in the body of the email...
Dev Logs:
Started POST "/invitations" for 127.0.0.1 at 2012-11-04 17:00:22 -0800
Processing by InvitationsController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"SwmmoRObXNI5PoXYhGFc4zsqLulSJ4iq0v9VbcRBJ3E=", "invitation"=>{"recipient_email"=>"brian#labyrinth.com"}, "commit"=>"Send Invite"}
User Load (0.6ms) SELECT "users".* FROM "users" WHERE "users"."id" = 2 LIMIT 1
(0.2ms) BEGIN
User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'brian#labyrinth.com' LIMIT 1
(0.2ms) UPDATE "users" SET "invitation_limit" = 6, "updated_at" = '2012-11-05 01:00:22.236722' WHERE "users"."id" = 2
SQL (0.3ms) INSERT INTO "invitations" ("created_at", "recipient_email", "sender_id", "sent_at", "token", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 05 Nov 2012 01:00:22 UTC +00:00], ["recipient_email", "brian#labyrinth.com"], ["sender_id", 2], ["sent_at", nil], ["token", "650e4773e64a1120355e5392ecfea2fefb47dabf"], ["updated_at", Mon, 05 Nov 2012 01:00:22 UTC +00:00]]
Sent mail to brian#labyrinth.com (917ms)
Date: Sun, 04 Nov 2012 17:00:22 -0800
From: noreply#lumeo.com
To: brian#labyrinth.com
Message-ID: <50970fa63e33c_6673fd1a1035ae061987#Retina.local.mail>
Subject: Invitation
Mime-Version: 1.0
Content-Type: text/plain;
charset=UTF-8
Content-Transfer-Encoding: 7bit
(1.6ms) COMMIT
Redirected to http://localhost:3000/invitations
Completed 302 Found in 942ms (ActiveRecord: 3.3ms)
Started GET "/invitations" for 127.0.0.1 at 2012-11-04 17:00:23 -0800
Processing by InvitationsController#index as HTML
User Load (0.8ms) SELECT "users".* FROM "users" WHERE "users"."id" = 2 LIMIT 1
Invitation Load (0.3ms) SELECT "invitations".* FROM "invitations"
Rendered invitations/index.html.erb within layouts/application (1.5ms)
Rendered layouts/_stylesheets.html.erb (4.7ms)
Image Load (0.5ms) SELECT "images".* FROM "images" WHERE "images"."parent_id" = 2 AND "images"."parent_type" = 'User' LIMIT 1
Role Load (0.4ms) SELECT "roles".* FROM "roles" INNER JOIN "assignments" ON "roles"."id" = "assignments"."role_id" WHERE "assignments"."user_id" = 2
Rendered layouts/_header.html.erb (9.6ms)
Rendered layouts/_footer.html.erb (0.6ms)
Completed 200 OK in 31ms (Views: 26.4ms | ActiveRecord: 2.0ms)
Heroku Logs:
2012-11-05T01:09:21+00:00 app[web.2]: Started POST "/invitations" for 76.175.198.239 at 2012-11-05 01:09:21 +0000
2012-11-05T01:09:22+00:00 app[worker.1]: [Worker(host:4ba7555d-5659-4f95-a8fb-13326b458480 pid:2)] Starting job worker
2012-11-05T01:09:22+00:00 app[worker.1]: Starting the New Relic Agent.
2012-11-05T01:09:22+00:00 app[worker.1]: [Worker(host:4ba7555d-5659-4f95-a8fb-13326b458480 pid:2)] New Relic Ruby Agent Monitoring DJ worker host:4ba7555d-5659-4f95-a8fb-13326b458480 pid:2
2012-11-05T01:09:23+00:00 app[web.2]: Processing by InvitationsController#create as HTML
2012-11-05T01:09:23+00:00 app[web.2]: Parameters: {"utf8"=>"✓", "authenticity_token"=>"Utls4PaX/7TkwyZkhZnkm3pf8llGoX/j5LskL+9rO40=", "invitation"=>{"recipient_email"=>"brian#labyrinthvisuals.com"}, "commit"=>"Send Invite"}
2012-11-05T01:09:23+00:00 app[web.2]: User Load (1.6ms) SELECT "users".* FROM "users" WHERE "users"."id" = 4528 LIMIT 1
2012-11-05T01:09:23+00:00 app[web.2]: (3.2ms) BEGIN
2012-11-05T01:09:23+00:00 app[web.2]: User Load (3.4ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'brian#labyrinthvisuals.com' LIMIT 1
2012-11-05T01:09:23+00:00 app[web.2]: (0.8ms) UPDATE "users" SET "invitation_limit" = 90, "updated_at" = '2012-11-05 01:09:21.797013' WHERE "users"."id" = 4528
2012-11-05T01:09:23+00:00 app[web.2]: SQL (1.6ms) INSERT INTO "invitations" ("created_at", "recipient_email", "sender_id", "sent_at", "token", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 05 Nov 2012 01:09:21 UTC +00:00], ["recipient_email", "brian#labyrinthvisuals.com"], ["sender_id", 4528], ["sent_at", nil], ["token", "53e21931e3481036c9019f8245e518b5ce8343aa"], ["updated_at", Mon, 05 Nov 2012 01:09:21 UTC +00:00]]
2012-11-05T01:09:23+00:00 app[web.2]:
2012-11-05T01:09:23+00:00 app[web.2]: Sent mail to brian#labyrinthvisuals.com (886ms)
2012-11-05T01:09:23+00:00 app[web.2]: Date: Mon, 05 Nov 2012 01:09:22 +0000
2012-11-05T01:09:23+00:00 app[web.2]: From: noreply#lumeo.com
2012-11-05T01:09:23+00:00 app[web.2]: To: brian#labyrinthvisuals.com
2012-11-05T01:09:23+00:00 app[web.2]: Message-ID: <509711c25d54a_2fc899c84342#52b7b88c-4573-408e-8219-a12f9c4087fb.mail>
2012-11-05T01:09:23+00:00 app[web.2]: Subject: Invitation
2012-11-05T01:09:23+00:00 app[web.2]: Mime-Version: 1.0
2012-11-05T01:09:23+00:00 app[web.2]: Content-Type: text/plain;
2012-11-05T01:09:23+00:00 app[web.2]: charset=UTF-8
2012-11-05T01:09:23+00:00 app[web.2]: Content-Transfer-Encoding: 7bit
2012-11-05T01:09:23+00:00 app[web.2]:
2012-11-05T01:09:23+00:00 app[web.2]:
2012-11-05T01:09:23+00:00 heroku[router]: POST www.lumeo.com/invitations dyno=web.2 queue=0 wait=0ms service=1857ms status=302 bytes=98
2012-11-05T01:09:23+00:00 app[web.2]: (3.7ms) COMMIT
2012-11-05T01:09:23+00:00 app[web.2]: Redirected to http://www.lumeo.com/invitations
2012-11-05T01:09:23+00:00 app[web.2]: Completed 302 Found in 1543ms (ActiveRecord: 22.2ms)
2012-11-05T01:09:23+00:00 app[web.2]:
2012-11-05T01:09:23+00:00 app[web.2]:
2012-11-05T01:09:23+00:00 app[web.2]: Started GET "/invitations" for 76.175.198.239 at 2012-11-05 01:09:23 +0000
2012-11-05T01:09:24+00:00 heroku[router]: GET www.lumeo.com/invitations dyno=web.2 queue=0 wait=0ms service=727ms status=200 bytes=8052
2012-11-05T01:09:24+00:00 app[web.2]: Role Load (1.5ms) SELECT "roles".* FROM "roles" INNER JOIN "assignments" ON "roles"."id" = "assignments"."role_id" WHERE "assignments"."user_id" = 4528
2012-11-05T01:09:24+00:00 app[web.2]: Rendered layouts/_header.html.erb (544.9ms)
2012-11-05T01:09:24+00:00 app[web.2]: User Load (0.9ms) SELECT "users".* FROM "users" WHERE "users"."id" = 4528 LIMIT 1
2012-11-05T01:09:24+00:00 app[web.2]: Invitation Load (2.3ms) SELECT "invitations".* FROM "invitations"
2012-11-05T01:09:24+00:00 app[web.2]: Processing by InvitationsController#index as HTML
2012-11-05T01:09:24+00:00 app[web.2]: Rendered invitations/index.html.erb within layouts/application (4.8ms)
2012-11-05T01:09:24+00:00 app[web.2]: Rendered layouts/_stylesheets.html.erb (0.8ms)
2012-11-05T01:09:24+00:00 app[web.2]: Image Load (1.6ms) SELECT "images".* FROM "images" WHERE "images"."parent_id" = 4528 AND "images"."parent_type" = 'User' LIMIT 1
2012-11-05T01:09:24+00:00 app[web.2]: Rendered layouts/_footer.html.erb (1.3ms)
2012-11-05T01:09:24+00:00 app[web.2]: Completed 200 OK in 708ms (Views: 664.3ms | ActiveRecord: 39.2ms)
2012-11-05T01:09:24+00:00 app[web.1]: => Booting Thin
2012-11-05T01:09:24+00:00 app[web.1]: => Rails 3.2.3 application starting in production on http://0.0.0.0:59079
2012-11-05T01:09:24+00:00 app[web.1]: => Call with -d to detach
2012-11-05T01:09:24+00:00 app[web.1]: => Ctrl-C to shutdown server
2012-11-05T01:09:24+00:00 app[web.1]: ** [NewRelic][11/05/12 01:09:23 +0000 1a2f3028-d8e6-415a-889a-de99cac2c096 (2)] INFO : Dispatcher: thin
2012-11-05T01:09:24+00:00 app[web.1]: ** [NewRelic][11/05/12 01:09:23 +0000 1a2f3028-d8e6-415a-889a-de99cac2c096 (2)] INFO : Application: sharp-flower-5688
2012-11-05T01:09:24+00:00 app[web.1]: ** [NewRelic][11/05/12 01:09:23 +0000 1a2f3028-d8e6-415a-889a-de99cac2c096 (2)] INFO : New Relic Ruby Agent 3.4.1 Initialized: pid = 2
2012-11-05T01:09:24+00:00 app[web.1]: ** [NewRelic][11/05/12 01:09:24 +0000 1a2f3028-d8e6-415a-889a-de99cac2c096 (2)] INFO : NewRelic::Agent::Samplers::DelayedJobSampler sampler not available: No DJ worker present
2012-11-05T01:09:24+00:00 app[web.2]: Connected to NewRelic Service at collector-5.newrelic.com
2012-11-05T01:09:24+00:00 app[web.2]: ** [NewRelic][11/05/12 01:09:24 +0000 52b7b88c-4573-408e-8219-a12f9c4087fb (2)] INFO : Reporting performance data every 60 seconds.
Please help. These are some of the last things I need to do before I launch publicly...tomorrow...
The view will not render if the file name or path is incorrect.
In this case, you should have:
app/views/invitation_mailer/invitation_email.text.erb
and if you want html also:
app/views/invitation_mailer/invitation_email.html.erb
You shouldn't have to set :template_path