Home>

I will ask you the first question.
I have studied at a programming school for about 3 months.
When I try to make my own service and do rails new and then rails s, an error occurs.

For the time being, I would like to know how to solve the error that is occurring now.
Thank you.

[First] After "rails s"

Webpacker configuration file not found /Users/username/projects/filename/config/webpacker.yml. Please run rails webpacker:install Error: No such file or directory @ rb_sysopen-/Users/username/projects/filename /config/webpacker .yml (RuntimeError)


I got this error, so I typed:

rails webpacker:install


If i do, you will get the following error:

[Second] After "rails webpacker:install"

Yarn not installed.Please download and install Yarn from https://yarnpkg.com/lang/en/docs/install/


I got this error, so I typed:

brew install yarn


If i do, you will get the following error:

[Third] After "brew install yarn"

Error: Permission denied @ dir_s_mkdir-/private/tmp/homebrew20200722-28292-9dgqhj


It is said that there is a problem with authority, so when I check the authority status, it is as follows.

drwxr-xr-x 22 username staff 704 7 21 15:41.
drwxr-xr-x 28 username staff 896 7 21 15:37 ..
drwxr-xr-x 7 username staff 224 7 21 15:37 .git
-rw-r--r-- 1 username staff 766 7 21 15:37 .gitignore
-rw-r--r-- 1 username staff 6 7 21 15:37 .ruby-version
-rw-r--r-- 1 username staff 1965 7 21 15:37 Gemfile
-rw-r--r-- 1 username staff 5511 7 21 15:41 Gemfile.lock
-rw-r--r-- 1 username staff 374 7 21 15:37 README.md
-rw-r--r-- 1 username staff 227 7 21 15:37 Rakefile
drwxr-xr-x 11 username staff 352 7 21 15:37 app
drwxr-xr-x 8 username staff 256 7 21 15:41 bin
drwxr-xr-x 16 username staff 512 7 21 15:37 config
-rw-r--r-- 1 username staff 130 7 21 15:37 config.ru
drwxr-xr-x 3 username staff 96 7 21 15:37 db
drwxr-xr-x 4 username staff 128 7 21 15:37 lib
drwxr-xr-x 4 username staff 128 7 21 16:23 log
-rw-r--r-- 1 username staff 220 7 21 15:37 package.json
drwxr-xr-x 9 username staff 288 7 21 15:37 public
drwxr-xr-x 3 username staff 96 7 21 15:37 storage
drwxr-xr-x 12 username staff 384 7 21 15:37 test
drwxr-xr-x 7 username staff 224 7 21 16:23 tmp
drwxr-xr-x 3 username staff 96 7 21 15:37 vendor


When I checked various questions and articles, the answer is that the username is often "root", so I can change it to my own username, so I checked the permissions, but all my usernames It has become.

Therefore, I am struggling because I do not know the future solution.

Thanks for your response.

Supplementary information (FW/tool ​​version, etc.)

ProductName: Mac OS X
ProductVersion: 10.14.6
Ruby 2.5.1
Rails 6.0.3.2

  • Answer # 1

    From the conclusion, I solved it.

    ls -ld /private /private/tmp


    When I checked the permissions of /private/tmp with, the result was as follows.

    drwxr-xr-x 6 root wheel 192 8 23 2019 /private
    drwxr-xr-x 16 _mysql _mysql 512 7 22 15:14 /private/tmp


    Originally, _mysql should be root, but I do not know why, but it was like this.

    Therefore, I typed the following.

    sudo chmod 1777 /private/tmp


    Then, the following changes were made.

    drwxr-xr-x 6 root wheel 192 8 23 2019 /private
    drwxrwxrwt 16 root wheel 512 7 22 15:14 /private/tmp


    After that, as a result of typing the command in the procedure described in the question content, it worked properly and the error was successfully removed.

    Thank you for your reply! !!