Unsure where rails error is stemming from (ActiveStorage)
up vote
0
down vote
favorite
I recently made the switch from paperclip to activestorage. It was a generally painless conversion, except when I go to create new users on my app, I get this error:

Part of the server log indicating error:
(0.6ms) BEGIN
User Exists (5.0ms) SELECT 1 AS one FROM "users" WHERE LOWER("users"."email") = LOWER($1) LIMIT $2 [["email", "billz@billz.com"], ["LIMIT", 1]]
User Create (7.9ms) INSERT INTO "users" ("name", "email", "created_at", "updated_at", "password_digest", "occupation", "location", "twitter", "linkedin", "github", "first_name", "last_name") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12) RETURNING "id" [["name", "billzboi"], ["email", "billz@billz.com"], ["created_at", "2018-11-18 01:24:48.907102"], ["updated_at", "2018-11-18 01:24:48.907102"], ["password_digest", "$2a$10$kHluW818Ro8S8po6VrGke.LjR2qUYvBMg/4v/YCeV1ap3E1ybGHWC"], ["occupation", ""], ["location", ""], ["twitter", ""], ["linkedin", ""], ["github", ""], ["first_name", "Billy"], ["last_name", "billz"]]
ActiveStorage::Attachment Create (1.8ms) INSERT INTO "active_storage_attachments" ("name", "record_type", "record_id", "blob_id", "created_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["name", "photo"], ["record_type", "User"], ["record_id", 22], ["blob_id", 7], ["created_at", "2018-11-18 01:24:48.918588"]]
(0.6ms) ROLLBACK
Completed 500 Internal Server Error in 479ms (ActiveRecord: 76.6ms)
NoMethodError (undefined method `photo?' for #<User:0x007f9c04284770>
Did you mean? photo
photo=):
app/controllers/users_controller.rb:31:in `create'
ActiveStorage::Blob Load (6.0ms) SELECT "active_storage_blobs".* FROM "active_storage_blobs" WHERE "active_storage_blobs"."id" = $1 LIMIT $2 [["id", 6], ["LIMIT", 1]]
[ActiveJob] [ActiveStorage::PurgeJob] [14eed28d-12ad-46f8-aee1-21b315e6268b] Performing ActiveStorage::PurgeJob (Job ID: 14eed28d-12ad-46f8-aee1-21b315e6268b) from Async(default) with arguments: #<GlobalID:0x007f9c05474278 @uri=#<URI::GID gid://spitball/ActiveStorage::Blob/6>>
ActiveStorage::Blob Load (28.9ms) SELECT "active_storage_blobs".* FROM "active_storage_blobs" WHERE "active_storage_blobs"."id" = $1 LIMIT $2 [["id", 6], ["LIMIT", 1]]
[ActiveJob] [ActiveStorage::AnalyzeJob] [7ebac64f-92eb-435e-9431-17dcd3c1465a] Performing ActiveStorage::AnalyzeJob (Job ID: 7ebac64f-92eb-435e-9431-17dcd3c1465a) from Async(default) with arguments: #<GlobalID:0x007f9c009a7178 @uri=#<URI::GID gid://spitball/ActiveStorage::Blob/6>>
[ActiveJob] [ActiveStorage::PurgeJob] [14eed28d-12ad-46f8-aee1-21b315e6268b] Disk Storage (0.2ms) Deleted file from key: pz1QmK2yL4s6YAfqoZein1nv
[ActiveJob] [ActiveStorage::PurgeJob] [14eed28d-12ad-46f8-aee1-21b315e6268b] Disk Storage (0.2ms) Deleted files by key prefix: variants/pz1QmK2yL4s6YAfqoZein1nv/
[ActiveJob] [ActiveStorage::PurgeJob] [14eed28d-12ad-46f8-aee1-21b315e6268b] (2.0ms) BEGIN
[ActiveJob] [ActiveStorage::AnalyzeJob] [7ebac64f-92eb-435e-9431-17dcd3c1465a] Error performing ActiveStorage::AnalyzeJob (Job ID: 7ebac64f-92eb-435e-9431-17dcd3c1465a) from Async(default) in 963.11ms: Errno::ENOENT (No such file or directory @ rb_sysopen - /Users/iThompkins/Desktop/Side Hustle/Spitball/Spitball_app/storage/pz/1Q/pz1QmK2yL4s6YAfqoZein1nv):
/Users/iThompkins/.rvm/gems/ruby-2.4.1/gems/activestorage-5.2.0/lib/active_storage/service/disk_service.rb:28:in `initialize'
/Users/iThompkins/.rvm/gems/ruby-2.4.1/gems/activestorage-5.2.0/lib/active_storage/service/disk_service.rb:28:in `open'
/Users/iThompkins/.rvm/gems/ruby-2.4.1/gems/activestorage-5.2.0/lib/active_storage/service/disk_service.rb:28:in `block in download'
/Users/iThompkins/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.0/lib/active_support/notifications.rb:170:in `instrument'
And the action being called
def create
@user = User.new(user_params)
@user.photo.attach(params[:user][:photo])
if @user.save
UserMailer.welcome_email(@user).deliver_now
log_in @user
flash[:success] = "Welcome to Our Beta!"
redirect_to @user
else
render 'new'
end
end
The user model uses the method 'has_one_attached' from active storage and takes ':photo' as a parameter. I can't tell where '.photo?' is being called so I can't resolve the error.
ruby-on-rails rails-activestorage
add a comment |
up vote
0
down vote
favorite
I recently made the switch from paperclip to activestorage. It was a generally painless conversion, except when I go to create new users on my app, I get this error:

Part of the server log indicating error:
(0.6ms) BEGIN
User Exists (5.0ms) SELECT 1 AS one FROM "users" WHERE LOWER("users"."email") = LOWER($1) LIMIT $2 [["email", "billz@billz.com"], ["LIMIT", 1]]
User Create (7.9ms) INSERT INTO "users" ("name", "email", "created_at", "updated_at", "password_digest", "occupation", "location", "twitter", "linkedin", "github", "first_name", "last_name") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12) RETURNING "id" [["name", "billzboi"], ["email", "billz@billz.com"], ["created_at", "2018-11-18 01:24:48.907102"], ["updated_at", "2018-11-18 01:24:48.907102"], ["password_digest", "$2a$10$kHluW818Ro8S8po6VrGke.LjR2qUYvBMg/4v/YCeV1ap3E1ybGHWC"], ["occupation", ""], ["location", ""], ["twitter", ""], ["linkedin", ""], ["github", ""], ["first_name", "Billy"], ["last_name", "billz"]]
ActiveStorage::Attachment Create (1.8ms) INSERT INTO "active_storage_attachments" ("name", "record_type", "record_id", "blob_id", "created_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["name", "photo"], ["record_type", "User"], ["record_id", 22], ["blob_id", 7], ["created_at", "2018-11-18 01:24:48.918588"]]
(0.6ms) ROLLBACK
Completed 500 Internal Server Error in 479ms (ActiveRecord: 76.6ms)
NoMethodError (undefined method `photo?' for #<User:0x007f9c04284770>
Did you mean? photo
photo=):
app/controllers/users_controller.rb:31:in `create'
ActiveStorage::Blob Load (6.0ms) SELECT "active_storage_blobs".* FROM "active_storage_blobs" WHERE "active_storage_blobs"."id" = $1 LIMIT $2 [["id", 6], ["LIMIT", 1]]
[ActiveJob] [ActiveStorage::PurgeJob] [14eed28d-12ad-46f8-aee1-21b315e6268b] Performing ActiveStorage::PurgeJob (Job ID: 14eed28d-12ad-46f8-aee1-21b315e6268b) from Async(default) with arguments: #<GlobalID:0x007f9c05474278 @uri=#<URI::GID gid://spitball/ActiveStorage::Blob/6>>
ActiveStorage::Blob Load (28.9ms) SELECT "active_storage_blobs".* FROM "active_storage_blobs" WHERE "active_storage_blobs"."id" = $1 LIMIT $2 [["id", 6], ["LIMIT", 1]]
[ActiveJob] [ActiveStorage::AnalyzeJob] [7ebac64f-92eb-435e-9431-17dcd3c1465a] Performing ActiveStorage::AnalyzeJob (Job ID: 7ebac64f-92eb-435e-9431-17dcd3c1465a) from Async(default) with arguments: #<GlobalID:0x007f9c009a7178 @uri=#<URI::GID gid://spitball/ActiveStorage::Blob/6>>
[ActiveJob] [ActiveStorage::PurgeJob] [14eed28d-12ad-46f8-aee1-21b315e6268b] Disk Storage (0.2ms) Deleted file from key: pz1QmK2yL4s6YAfqoZein1nv
[ActiveJob] [ActiveStorage::PurgeJob] [14eed28d-12ad-46f8-aee1-21b315e6268b] Disk Storage (0.2ms) Deleted files by key prefix: variants/pz1QmK2yL4s6YAfqoZein1nv/
[ActiveJob] [ActiveStorage::PurgeJob] [14eed28d-12ad-46f8-aee1-21b315e6268b] (2.0ms) BEGIN
[ActiveJob] [ActiveStorage::AnalyzeJob] [7ebac64f-92eb-435e-9431-17dcd3c1465a] Error performing ActiveStorage::AnalyzeJob (Job ID: 7ebac64f-92eb-435e-9431-17dcd3c1465a) from Async(default) in 963.11ms: Errno::ENOENT (No such file or directory @ rb_sysopen - /Users/iThompkins/Desktop/Side Hustle/Spitball/Spitball_app/storage/pz/1Q/pz1QmK2yL4s6YAfqoZein1nv):
/Users/iThompkins/.rvm/gems/ruby-2.4.1/gems/activestorage-5.2.0/lib/active_storage/service/disk_service.rb:28:in `initialize'
/Users/iThompkins/.rvm/gems/ruby-2.4.1/gems/activestorage-5.2.0/lib/active_storage/service/disk_service.rb:28:in `open'
/Users/iThompkins/.rvm/gems/ruby-2.4.1/gems/activestorage-5.2.0/lib/active_storage/service/disk_service.rb:28:in `block in download'
/Users/iThompkins/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.0/lib/active_support/notifications.rb:170:in `instrument'
And the action being called
def create
@user = User.new(user_params)
@user.photo.attach(params[:user][:photo])
if @user.save
UserMailer.welcome_email(@user).deliver_now
log_in @user
flash[:success] = "Welcome to Our Beta!"
redirect_to @user
else
render 'new'
end
end
The user model uses the method 'has_one_attached' from active storage and takes ':photo' as a parameter. I can't tell where '.photo?' is being called so I can't resolve the error.
ruby-on-rails rails-activestorage
What's in the "Application Trace"? Maybe you have aphoto?call that should bephoto.attached?somewhere in the validations.
– mu is too short
Nov 18 at 6:21
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I recently made the switch from paperclip to activestorage. It was a generally painless conversion, except when I go to create new users on my app, I get this error:

Part of the server log indicating error:
(0.6ms) BEGIN
User Exists (5.0ms) SELECT 1 AS one FROM "users" WHERE LOWER("users"."email") = LOWER($1) LIMIT $2 [["email", "billz@billz.com"], ["LIMIT", 1]]
User Create (7.9ms) INSERT INTO "users" ("name", "email", "created_at", "updated_at", "password_digest", "occupation", "location", "twitter", "linkedin", "github", "first_name", "last_name") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12) RETURNING "id" [["name", "billzboi"], ["email", "billz@billz.com"], ["created_at", "2018-11-18 01:24:48.907102"], ["updated_at", "2018-11-18 01:24:48.907102"], ["password_digest", "$2a$10$kHluW818Ro8S8po6VrGke.LjR2qUYvBMg/4v/YCeV1ap3E1ybGHWC"], ["occupation", ""], ["location", ""], ["twitter", ""], ["linkedin", ""], ["github", ""], ["first_name", "Billy"], ["last_name", "billz"]]
ActiveStorage::Attachment Create (1.8ms) INSERT INTO "active_storage_attachments" ("name", "record_type", "record_id", "blob_id", "created_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["name", "photo"], ["record_type", "User"], ["record_id", 22], ["blob_id", 7], ["created_at", "2018-11-18 01:24:48.918588"]]
(0.6ms) ROLLBACK
Completed 500 Internal Server Error in 479ms (ActiveRecord: 76.6ms)
NoMethodError (undefined method `photo?' for #<User:0x007f9c04284770>
Did you mean? photo
photo=):
app/controllers/users_controller.rb:31:in `create'
ActiveStorage::Blob Load (6.0ms) SELECT "active_storage_blobs".* FROM "active_storage_blobs" WHERE "active_storage_blobs"."id" = $1 LIMIT $2 [["id", 6], ["LIMIT", 1]]
[ActiveJob] [ActiveStorage::PurgeJob] [14eed28d-12ad-46f8-aee1-21b315e6268b] Performing ActiveStorage::PurgeJob (Job ID: 14eed28d-12ad-46f8-aee1-21b315e6268b) from Async(default) with arguments: #<GlobalID:0x007f9c05474278 @uri=#<URI::GID gid://spitball/ActiveStorage::Blob/6>>
ActiveStorage::Blob Load (28.9ms) SELECT "active_storage_blobs".* FROM "active_storage_blobs" WHERE "active_storage_blobs"."id" = $1 LIMIT $2 [["id", 6], ["LIMIT", 1]]
[ActiveJob] [ActiveStorage::AnalyzeJob] [7ebac64f-92eb-435e-9431-17dcd3c1465a] Performing ActiveStorage::AnalyzeJob (Job ID: 7ebac64f-92eb-435e-9431-17dcd3c1465a) from Async(default) with arguments: #<GlobalID:0x007f9c009a7178 @uri=#<URI::GID gid://spitball/ActiveStorage::Blob/6>>
[ActiveJob] [ActiveStorage::PurgeJob] [14eed28d-12ad-46f8-aee1-21b315e6268b] Disk Storage (0.2ms) Deleted file from key: pz1QmK2yL4s6YAfqoZein1nv
[ActiveJob] [ActiveStorage::PurgeJob] [14eed28d-12ad-46f8-aee1-21b315e6268b] Disk Storage (0.2ms) Deleted files by key prefix: variants/pz1QmK2yL4s6YAfqoZein1nv/
[ActiveJob] [ActiveStorage::PurgeJob] [14eed28d-12ad-46f8-aee1-21b315e6268b] (2.0ms) BEGIN
[ActiveJob] [ActiveStorage::AnalyzeJob] [7ebac64f-92eb-435e-9431-17dcd3c1465a] Error performing ActiveStorage::AnalyzeJob (Job ID: 7ebac64f-92eb-435e-9431-17dcd3c1465a) from Async(default) in 963.11ms: Errno::ENOENT (No such file or directory @ rb_sysopen - /Users/iThompkins/Desktop/Side Hustle/Spitball/Spitball_app/storage/pz/1Q/pz1QmK2yL4s6YAfqoZein1nv):
/Users/iThompkins/.rvm/gems/ruby-2.4.1/gems/activestorage-5.2.0/lib/active_storage/service/disk_service.rb:28:in `initialize'
/Users/iThompkins/.rvm/gems/ruby-2.4.1/gems/activestorage-5.2.0/lib/active_storage/service/disk_service.rb:28:in `open'
/Users/iThompkins/.rvm/gems/ruby-2.4.1/gems/activestorage-5.2.0/lib/active_storage/service/disk_service.rb:28:in `block in download'
/Users/iThompkins/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.0/lib/active_support/notifications.rb:170:in `instrument'
And the action being called
def create
@user = User.new(user_params)
@user.photo.attach(params[:user][:photo])
if @user.save
UserMailer.welcome_email(@user).deliver_now
log_in @user
flash[:success] = "Welcome to Our Beta!"
redirect_to @user
else
render 'new'
end
end
The user model uses the method 'has_one_attached' from active storage and takes ':photo' as a parameter. I can't tell where '.photo?' is being called so I can't resolve the error.
ruby-on-rails rails-activestorage
I recently made the switch from paperclip to activestorage. It was a generally painless conversion, except when I go to create new users on my app, I get this error:

Part of the server log indicating error:
(0.6ms) BEGIN
User Exists (5.0ms) SELECT 1 AS one FROM "users" WHERE LOWER("users"."email") = LOWER($1) LIMIT $2 [["email", "billz@billz.com"], ["LIMIT", 1]]
User Create (7.9ms) INSERT INTO "users" ("name", "email", "created_at", "updated_at", "password_digest", "occupation", "location", "twitter", "linkedin", "github", "first_name", "last_name") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12) RETURNING "id" [["name", "billzboi"], ["email", "billz@billz.com"], ["created_at", "2018-11-18 01:24:48.907102"], ["updated_at", "2018-11-18 01:24:48.907102"], ["password_digest", "$2a$10$kHluW818Ro8S8po6VrGke.LjR2qUYvBMg/4v/YCeV1ap3E1ybGHWC"], ["occupation", ""], ["location", ""], ["twitter", ""], ["linkedin", ""], ["github", ""], ["first_name", "Billy"], ["last_name", "billz"]]
ActiveStorage::Attachment Create (1.8ms) INSERT INTO "active_storage_attachments" ("name", "record_type", "record_id", "blob_id", "created_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["name", "photo"], ["record_type", "User"], ["record_id", 22], ["blob_id", 7], ["created_at", "2018-11-18 01:24:48.918588"]]
(0.6ms) ROLLBACK
Completed 500 Internal Server Error in 479ms (ActiveRecord: 76.6ms)
NoMethodError (undefined method `photo?' for #<User:0x007f9c04284770>
Did you mean? photo
photo=):
app/controllers/users_controller.rb:31:in `create'
ActiveStorage::Blob Load (6.0ms) SELECT "active_storage_blobs".* FROM "active_storage_blobs" WHERE "active_storage_blobs"."id" = $1 LIMIT $2 [["id", 6], ["LIMIT", 1]]
[ActiveJob] [ActiveStorage::PurgeJob] [14eed28d-12ad-46f8-aee1-21b315e6268b] Performing ActiveStorage::PurgeJob (Job ID: 14eed28d-12ad-46f8-aee1-21b315e6268b) from Async(default) with arguments: #<GlobalID:0x007f9c05474278 @uri=#<URI::GID gid://spitball/ActiveStorage::Blob/6>>
ActiveStorage::Blob Load (28.9ms) SELECT "active_storage_blobs".* FROM "active_storage_blobs" WHERE "active_storage_blobs"."id" = $1 LIMIT $2 [["id", 6], ["LIMIT", 1]]
[ActiveJob] [ActiveStorage::AnalyzeJob] [7ebac64f-92eb-435e-9431-17dcd3c1465a] Performing ActiveStorage::AnalyzeJob (Job ID: 7ebac64f-92eb-435e-9431-17dcd3c1465a) from Async(default) with arguments: #<GlobalID:0x007f9c009a7178 @uri=#<URI::GID gid://spitball/ActiveStorage::Blob/6>>
[ActiveJob] [ActiveStorage::PurgeJob] [14eed28d-12ad-46f8-aee1-21b315e6268b] Disk Storage (0.2ms) Deleted file from key: pz1QmK2yL4s6YAfqoZein1nv
[ActiveJob] [ActiveStorage::PurgeJob] [14eed28d-12ad-46f8-aee1-21b315e6268b] Disk Storage (0.2ms) Deleted files by key prefix: variants/pz1QmK2yL4s6YAfqoZein1nv/
[ActiveJob] [ActiveStorage::PurgeJob] [14eed28d-12ad-46f8-aee1-21b315e6268b] (2.0ms) BEGIN
[ActiveJob] [ActiveStorage::AnalyzeJob] [7ebac64f-92eb-435e-9431-17dcd3c1465a] Error performing ActiveStorage::AnalyzeJob (Job ID: 7ebac64f-92eb-435e-9431-17dcd3c1465a) from Async(default) in 963.11ms: Errno::ENOENT (No such file or directory @ rb_sysopen - /Users/iThompkins/Desktop/Side Hustle/Spitball/Spitball_app/storage/pz/1Q/pz1QmK2yL4s6YAfqoZein1nv):
/Users/iThompkins/.rvm/gems/ruby-2.4.1/gems/activestorage-5.2.0/lib/active_storage/service/disk_service.rb:28:in `initialize'
/Users/iThompkins/.rvm/gems/ruby-2.4.1/gems/activestorage-5.2.0/lib/active_storage/service/disk_service.rb:28:in `open'
/Users/iThompkins/.rvm/gems/ruby-2.4.1/gems/activestorage-5.2.0/lib/active_storage/service/disk_service.rb:28:in `block in download'
/Users/iThompkins/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.0/lib/active_support/notifications.rb:170:in `instrument'
And the action being called
def create
@user = User.new(user_params)
@user.photo.attach(params[:user][:photo])
if @user.save
UserMailer.welcome_email(@user).deliver_now
log_in @user
flash[:success] = "Welcome to Our Beta!"
redirect_to @user
else
render 'new'
end
end
The user model uses the method 'has_one_attached' from active storage and takes ':photo' as a parameter. I can't tell where '.photo?' is being called so I can't resolve the error.
ruby-on-rails rails-activestorage
ruby-on-rails rails-activestorage
asked Nov 18 at 1:33
iThompkins
226
226
What's in the "Application Trace"? Maybe you have aphoto?call that should bephoto.attached?somewhere in the validations.
– mu is too short
Nov 18 at 6:21
add a comment |
What's in the "Application Trace"? Maybe you have aphoto?call that should bephoto.attached?somewhere in the validations.
– mu is too short
Nov 18 at 6:21
What's in the "Application Trace"? Maybe you have a
photo? call that should be photo.attached? somewhere in the validations.– mu is too short
Nov 18 at 6:21
What's in the "Application Trace"? Maybe you have a
photo? call that should be photo.attached? somewhere in the validations.– mu is too short
Nov 18 at 6:21
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53357143%2funsure-where-rails-error-is-stemming-from-activestorage%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
What's in the "Application Trace"? Maybe you have a
photo?call that should bephoto.attached?somewhere in the validations.– mu is too short
Nov 18 at 6:21