当我尝试在linux mint 18.1中的/ dos分区中创建rails应用程序时,它会抛出以下错误
/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>'
当我打开时
/home/akash/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/fileutils.rb:1345
第1345行的代码是
def chmod(mode)
if symlink?
File.lchmod mode, path() if have_lchmod?
else
File.chmod mode, path() #1345th line
end
end
我无法理解上面的代码。请帮帮我
注意:在ext4分区中创建rails app工作正常。我在用 ruby -2.4.0,rails -5.0.1
答案 0 :(得分:1)
chmod(mode_int, file_name, ... )
将指定文件上的权限位更改为mode_int表示的位模式。实际效果取决于操作系统。在Unix系统上,请参阅chmod了解详细信息。返回处理的文件数。
您静静地授予权限
File.chmod(0604, '/path/to/file')
rbenv install 2.3.0
或者您可以通过
找到您可能没有写入权限的所有文件和目录find `rbenv root`/versions ! -perm -u+w