Akash Pinnaka
Akash Pinnaka

Reputation: 475

Can't create Rails app mounted NTFS partition

When I am trying to create a rails app in /dos partition in linux mint 18.1, it is throwing the following error

/home/akash/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/fileutils.rb:1345:in `chmod': Operation not permitted @ chmod_internal - /dos/projects/rails/little_farmers_family_daycare/bin (Errno::EPERM)
        from /home/akash/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/fileutils.rb:1345:in `chmod'
        from /home/akash/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/fileutils.rb:1026:in `block (2 levels) in chmod_R'
        from /home/akash/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/fileutils.rb:1478:in `preorder_traverse'
        from /home/akash/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/fileutils.rb:1024:in `block in chmod_R'
        from /home/akash/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/fileutils.rb:1023:in `each'
        from /home/akash/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/fileutils.rb:1023:in `chmod_R'
        from /home/akash/.rvm/gems/ruby-2.3.0/gems/thor-0.19.4/lib/thor/actions/file_manipulation.rb:137:in `chmod'
        from /home/akash/.rvm/gems/ruby-2.3.0/gems/railties-5.0.1/lib/rails/generators/rails/app/app_generator.rb:17:in `chmod'
        from /home/akash/.rvm/gems/ruby-2.3.0/gems/railties-5.0.1/lib/rails/generators/rails/app/app_generator.rb:70:in `bin'
        from /home/akash/.rvm/gems/ruby-2.3.0/gems/railties-5.0.1/lib/rails/generators/app_base.rb:147:in `build'
        from /home/akash/.rvm/gems/ruby-2.3.0/gems/railties-5.0.1/lib/rails/generators/rails/app/app_generator.rb:217:in `create_bin_files'
        from /home/akash/.rvm/gems/ruby-2.3.0/gems/thor-0.19.4/lib/thor/command.rb:27:in `run'
        from /home/akash/.rvm/gems/ruby-2.3.0/gems/thor-0.19.4/lib/thor/invocation.rb:126:in `invoke_command'
        from /home/akash/.rvm/gems/ruby-2.3.0/gems/thor-0.19.4/lib/thor/invocation.rb:133:in `block in invoke_all'
        from /home/akash/.rvm/gems/ruby-2.3.0/gems/thor-0.19.4/lib/thor/invocation.rb:133:in `each'
        from /home/akash/.rvm/gems/ruby-2.3.0/gems/thor-0.19.4/lib/thor/invocation.rb:133:in `map'
        from /home/akash/.rvm/gems/ruby-2.3.0/gems/thor-0.19.4/lib/thor/invocation.rb:133:in `invoke_all'
        from /home/akash/.rvm/gems/ruby-2.3.0/gems/thor-0.19.4/lib/thor/group.rb:232:in `dispatch'
        from /home/akash/.rvm/gems/ruby-2.3.0/gems/thor-0.19.4/lib/thor/base.rb:444:in `start'
        from /home/akash/.rvm/gems/ruby-2.3.0/gems/railties-5.0.1/lib/rails/commands/application.rb:17:in `<top (required)>'
        from /home/akash/.rvm/rubies/ruby-2.3.0/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
        from /home/akash/.rvm/rubies/ruby-2.3.0/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
        from /home/akash/.rvm/gems/ruby-2.3.0/gems/railties-5.0.1/lib/rails/cli.rb:14:in `<top (required)>'
        from /home/akash/.rvm/rubies/ruby-2.3.0/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
        from /home/akash/.rvm/rubies/ruby-2.3.0/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
        from /home/akash/.rvm/gems/ruby-2.3.0/gems/railties-5.0.1/exe/rails:9:in `<top (required)>'
        from /home/akash/.rvm/gems/ruby-2.3.0/bin/rails:22:in `load'
        from /home/akash/.rvm/gems/ruby-2.3.0/bin/rails:22:in `<main>'
        from /home/akash/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `eval'
        from /home/akash/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `<main>'

When I opened

/home/akash/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/fileutils.rb:1345

the code in the 1345th line is

def chmod(mode)
  if symlink?
    File.lchmod mode, path() if have_lchmod?
  else
    File.chmod mode, path() #1345th line
  end
end

I couldn't understand the above code. Please help me

Note: Creating rails app in ext4 partition is working fine. I am using ruby -2.4.0, rails -5.0.1

Upvotes: 0

Views: 95

Answers (1)

Vishwas Nahar
Vishwas Nahar

Reputation: 418

chmod(mode_int, file_name, ... ) 

Changes permission bits on the named file to the bit pattern represented by mode_int. Actual effects are operating system dependent. On Unix systems, see chmod for details. Returns the number of files processed.

You statically give permission

 File.chmod(0604, '/path/to/file') 

rbenv install 2.3.0

Or you can find all files and directories that you might not have write access to by

find `rbenv root`/versions ! -perm -u+w

chmod

Upvotes: 1

Related Questions