rails / rails-dev-box

A virtual machine for Ruby on Rails core development
MIT License
2.05k stars 580 forks source link

`rails` directory us mounted with `root` as an owner #182

Open charlie-wasp opened 3 years ago

charlie-wasp commented 3 years ago

Hi! Just checked out this repo recently and got this issue: after me cloning the rails repo, as described in README, I got all files mounted with owner root

vagrant@rails-dev-box:/vagrant/rails$ ls -l
total 308
drwxr-xr-x 1 root root    576 Mar 11 11:25 actioncable
drwxr-xr-x 1 root root    448 Mar 11 11:25 actionmailbox
drwxr-xr-x 1 root root    320 Mar 11 11:25 actionmailer
drwxr-xr-x 1 root root    320 Mar 11 11:25 actionpack
drwxr-xr-x 1 root root    448 Mar 11 11:25 actiontext
drwxr-xr-x 1 root root    544 Mar 11 11:25 actionview
drwxr-xr-x 1 root root    320 Mar 11 11:25 activejob
drwxr-xr-x 1 root root    320 Mar 11 11:25 activemodel
drwxr-xr-x 1 root root    416 Mar 11 11:25 activerecord
drwxr-xr-x 1 root root    576 Mar 11 11:25 activestorage
drwxr-xr-x 1 root root    352 Mar 11 11:25 activesupport
-rw-r--r-- 1 root root    266 Mar 11 11:25 Brewfile
drwxr-xr-x 1 root root     96 Mar 11 11:25 ci
-rw-r--r-- 1 root root    291 Mar 11 11:25 CODE_OF_CONDUCT.md
-rw-r--r-- 1 root root   3781 Mar 11 11:25 CONTRIBUTING.md
-rw-r--r-- 1 root root   4602 Mar 11 11:25 Gemfile
-rw-r--r-- 1 root root  15656 Mar 11 11:25 Gemfile.lock
drwxr-xr-x 1 root root    352 Mar 11 11:25 guides
-rw-r--r-- 1 root root   1073 Mar 11 11:25 MIT-LICENSE
-rw-r--r-- 1 root root    170 Mar 11 11:25 package.json
-rw-r--r-- 1 root root   1780 Mar 11 11:25 rails.gemspec
-rw-r--r-- 1 root root     12 Mar 11 11:25 RAILS_VERSION
drwxr-xr-x 1 root root    416 Mar 11 11:25 railties
-rw-r--r-- 1 root root   2049 Mar 11 11:25 Rakefile
-rw-r--r-- 1 root root   4938 Mar 11 11:25 README.md
-rw-r--r-- 1 root root   7469 Mar 11 11:25 RELEASING_RAILS.md
drwxr-xr-x 1 root root    128 Mar 11 11:25 tasks
drwxr-xr-x 1 root root    256 Mar 11 11:25 tools
-rw-r--r-- 1 root root    339 Mar 11 11:25 version.rb
-rw-r--r-- 1 root root 236863 Mar 11 11:25 yarn.lock

Is it behaviour expected? I got a lot of failing tests due to various EACCESSerrors. For example:

vagrant@rails-dev-box:/vagrant/rails$ cd activerecord/
vagrant@rails-dev-box:/vagrant/rails/activerecord$ bin/test test/cases/enum_test.rb
Traceback (most recent call last):
        25: from bin/test:11:in `<main>'
        24: from bin/test:11:in `require_relative'
        23: from /vagrant/rails/tools/test.rb:18:in `<top (required)>'
        22: from /vagrant/rails/railties/lib/rails/test_unit/runner.rb:39:in `run'
        21: from /vagrant/rails/railties/lib/rails/test_unit/runner.rb:50:in `load_tests'
        20: from /vagrant/rails/railties/lib/rails/test_unit/runner.rb:50:in `each'
        19: from /vagrant/rails/railties/lib/rails/test_unit/runner.rb:50:in `block in load_tests'
        18: from /vagrant/rails/railties/lib/rails/test_unit/runner.rb:50:in `require'
        17: from /vagrant/rails/activerecord/test/cases/enum_test.rb:3:in `<top (required)>'
        16: from /vagrant/rails/activerecord/test/cases/enum_test.rb:3:in `require'
        15: from /vagrant/rails/activerecord/test/cases/helper.rb:27:in `<top (required)>'
        14: from /vagrant/rails/activerecord/test/support/connection.rb:23:in `connect'
        13: from /vagrant/rails/activerecord/test/support/connection.rb:11:in `connection_name'
        12: from /vagrant/rails/activerecord/test/support/config.rb:10:in `config'
        11: from /vagrant/rails/activerecord/test/support/config.rb:20:in `read_config'
        10: from /usr/lib/ruby/2.7.0/fileutils.rb:429:in `cp'
         9: from /usr/lib/ruby/2.7.0/fileutils.rb:1587:in `fu_each_src_dest'
         8: from /usr/lib/ruby/2.7.0/fileutils.rb:1605:in `fu_each_src_dest0'
         7: from /usr/lib/ruby/2.7.0/fileutils.rb:1589:in `block in fu_each_src_dest'
         6: from /usr/lib/ruby/2.7.0/fileutils.rb:430:in `block in cp'
         5: from /usr/lib/ruby/2.7.0/fileutils.rb:511:in `copy_file'
         4: from /usr/lib/ruby/2.7.0/fileutils.rb:1414:in `copy_file'
         3: from /usr/lib/ruby/2.7.0/fileutils.rb:1414:in `open'
         2: from /usr/lib/ruby/2.7.0/fileutils.rb:1415:in `block in copy_file'
         1: from /usr/lib/ruby/2.7.0/fileutils.rb:1415:in `open'
/usr/lib/ruby/2.7.0/fileutils.rb:1415:in `initialize': Permission denied @ rb_sysopen - /vagrant/rails/activerecord/test/config.yml (Errno::EACCES)

Am I doing something wrong here? Or am I missing something?

yahonda commented 10 months ago

I attempt to reproduce this issue and clone Rails repo files are owned by vagrant as expected.