How to get rid of errors while creating a new rail

2019-08-01 05:23发布

问题:

When I create a new rails application on my NTFS partition I receive a bunch of errors. Though, with the same configuration I do not get any error when I create the project in my home directory which sits on a ext4 formatted partition.
Here is what I get.

$ rails new project
      create  
      create  README
      create  Rakefile
      [...]
      create  public/index.html
      create  public/robots.txt
      create  script
      create  script/rails
/home/user/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/fileutils.rb:1323:in `chmod': Operation not permitted - /media/ntfs/project/script (Errno::EPERM)
    from /home/john/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/fileutils.rb:1323:in `chmod'
    from /home/john/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/fileutils.rb:996:in `block (2 levels) in chmod_R'
    from /home/john/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/fileutils.rb:1433:in `preorder_traverse'
    from /home/john/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/fileutils.rb:994:in `block in chmod_R'
    from /home/john/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/fileutils.rb:993:in `each'
    from /home/john/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/fileutils.rb:993:in `chmod_R'
    from /home/john/.rvm/gems/ruby-1.9.3-p0/gems/thor-0.14.6/lib/thor/actions/file_manipulation.rb:132:in `chmod'
    from /home/john/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.1.3/lib/rails/generators/rails/app/app_generator.rb:17:in `chmod'
    from /home/john/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.1.3/lib/rails/generators/rails/app/app_generator.rb:106:in `script'
    from /home/john/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.1.3/lib/rails/generators/app_base.rb:96:in `build'
    from /home/john/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.1.3/lib/rails/generators/rails/app/app_generator.rb:210:in `create_script_files'
    from /home/john/.rvm/gems/ruby-1.9.3-p0/gems/thor-0.14.6/lib/thor/task.rb:22:in `run'
    from /home/john/.rvm/gems/ruby-1.9.3-p0/gems/thor-0.14.6/lib/thor/invocation.rb:118:in `invoke_task'
    from /home/john/.rvm/gems/ruby-1.9.3-p0/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `block in invoke_all'
    from /home/john/.rvm/gems/ruby-1.9.3-p0/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `each'
    from /home/john/.rvm/gems/ruby-1.9.3-p0/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `map'
    from /home/john/.rvm/gems/ruby-1.9.3-p0/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `invoke_all'
    from /home/john/.rvm/gems/ruby-1.9.3-p0/gems/thor-0.14.6/lib/thor/group.rb:226:in `dispatch'
    from /home/john/.rvm/gems/ruby-1.9.3-p0/gems/thor-0.14.6/lib/thor/base.rb:389:in `start'
    from /home/john/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.1.3/lib/rails/commands/application.rb:31:in `<top (required)>'
    from /home/john/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
    from /home/john/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
    from /home/john/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.1.3/lib/rails/cli.rb:15:in `<top (required)>'
    from /home/john/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
    from /home/john/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
    from /home/john/.rvm/gems/ruby-1.9.3-p0/gems/rails-3.1.3/bin/rails:7:in `<top (required)>'
    from /home/john/.rvm/gems/ruby-1.9.3-p0/bin/rails:19:in `load'
    from /home/john/.rvm/gems/ruby-1.9.3-p0/bin/rails:19:in `<main>'

I installed rails 3.1.3 via rvm.

$ rvm list
rvm rubies
=> ruby-1.9.3-p0 [ x86_64 ]
   ruby-1.9.2-p290 [ x86_64 ]
   ruby-1.9.2-p180 [ x86_64 ]

This is my general configuration.

$ rails -v
Rails 3.1.3
$ ruby -v
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux]
$ rvm -v
rvm 1.9.2
$ bundle -v
Bundler version 1.0.21
$ gem -v
1.8.11

I work with Ubuntu 10.10.