Home>

I have created a page that shows the current_user profile by defining my own controller and action.
I got an error like this when I clicked on My Page for a menu item.
However, once the page was displayed successfully, another error was displayed for some reason this time.

<% = attachment_image_tag @user,: profile_image, fallback: "no-image-icon_person.jpg", class: "profile_image is-rounded"%>Is pointed out as the error part.


Showing /Users/yuto/join_app_sample/app/views/mypage/profile.html.erb where line # 2 raised:

Refile.secret_key was not set.

Please add the following to your Refile configuration and restart your application:

Refile.secret_key = '2fc916e09a10d652ab60c87046eee3ed79a0a17452c1646a565edbad45fc670e5419c9c5ef04675e5c7fa49b08066ecc6970b82cc445244955450e3b30a9c731'

Extracted source (around line # 2):
__<% = attachment_image_tag @user,: profile_image, fallback: "no-image-icon_person.jpg", class: "profile_image is-rounded"%>__
<% = @ user.username%>
<% = @ user.profile%>


**<% = attachment_image_tag @user,: profile_image, fallback: "no-image-icon_person.jpg", class: "profile_image is-rounded"%>**
<% = @ user.username%>
<% = @ user.profile%>
<% = link_to "edit", edit_user_path (@user), class: "button is-primary"%>


<% = attachment_image_tag @user,: profile_image, fallback: "no-image-icon_person.jpg", class: "profile_image is-rounded"%>
<% = @ user.username%>
<% = @ user.profile%>
<% = link_to "edit", edit_user_path (@user), class: "button is-primary"%>


routes.rb

class UsersController
  • Answer # 1

    Error message (translated directly in parentheses)

    Refile.secret_key was not set. (Refile.secret_key was not set)
    Please add the following to your Refile configuration and restart your application: (Add the following code to your Refile configuration and restart your application)
    Refile.secret_key = '2fc916e09a10d652ab60c87046eee3ed79a0a17452c1646a565edbad45fc670e5419c9c5ef04675e5c7fa49b08066ecc6970b82cc445244955450e3b30a9c731'

    Have you tried modifying or restarting the Refile configuration according to?