简体   繁体   English

创建新的rails应用程序时权限被拒绝

[英]Permission denied when creating new rails app

I'm getting a permission denied when attempting to create a new rails app - and I'm at a bit of a loss as to why. 在尝试创建一个新的rails应用程序时,我获得了许可被拒绝 - 而且我有点不知道为什么。 I installed Ruby 1.9.3 (I'm aware Mac OSX Lion ships with ruby, but an older version). 我安装了Ruby 1.9.3(我知道Mac OSX Lion附带了ruby,但是旧版本)。 When installing, I did not have to sudo. 安装时,我没有sudo。

Also, when installing rails, I did not sudo the gem install either. 另外,在安装rails时,我也没有sudo gem安装。

It appears the only way I can create a new rails app is to sudo the comment though. 似乎我可以创建一个新的rails应用程序的唯一方法是sudo评论。 Here is the trace of the error: 以下是错误的痕迹:

Brians-MacBook-Air:Sites bkosborne$ rails new blog
      create  
/Users/bkosborne/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/fileutils.rb:247:in `mkdir': Permission denied - /Users/bkosborne/Sites/blog (Errno::EACCES)
    from /Users/bkosborne/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/fileutils.rb:247:in `fu_mkdir'
    from /Users/bkosborne/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/fileutils.rb:221:in `block (2 levels) in mkdir_p'
    from /Users/bkosborne/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/fileutils.rb:219:in `reverse_each'
    from /Users/bkosborne/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/fileutils.rb:219:in `block in mkdir_p'
    from /Users/bkosborne/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/fileutils.rb:205:in `each'
    from /Users/bkosborne/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/fileutils.rb:205:in `mkdir_p'
    from /Users/bkosborne/.rvm/gems/ruby-1.9.3-p125/gems/thor-0.14.6/lib/thor/actions/empty_directory.rb:51:in `block in invoke!'
    from /Users/bkosborne/.rvm/gems/ruby-1.9.3-p125/gems/thor-0.14.6/lib/thor/actions/empty_directory.rb:114:in `call'
    from /Users/bkosborne/.rvm/gems/ruby-1.9.3-p125/gems/thor-0.14.6/lib/thor/actions/empty_directory.rb:114:in `invoke_with_conflict_check'
    from /Users/bkosborne/.rvm/gems/ruby-1.9.3-p125/gems/thor-0.14.6/lib/thor/actions/empty_directory.rb:50:in `invoke!'
    from /Users/bkosborne/.rvm/gems/ruby-1.9.3-p125/gems/thor-0.14.6/lib/thor/actions.rb:95:in `action'
    from /Users/bkosborne/.rvm/gems/ruby-1.9.3-p125/gems/thor-0.14.6/lib/thor/actions/empty_directory.rb:15:in `empty_directory'
    from /Users/bkosborne/.rvm/gems/ruby-1.9.3-p125/gems/railties-3.2.1/lib/rails/generators/app_base.rb:103:in `create_root'
    from (eval):1:in `create_root'
    from /Users/bkosborne/.rvm/gems/ruby-1.9.3-p125/gems/thor-0.14.6/lib/thor/task.rb:22:in `run'
    from /Users/bkosborne/.rvm/gems/ruby-1.9.3-p125/gems/thor-0.14.6/lib/thor/invocation.rb:118:in `invoke_task'
    from /Users/bkosborne/.rvm/gems/ruby-1.9.3-p125/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `block in invoke_all'
    from /Users/bkosborne/.rvm/gems/ruby-1.9.3-p125/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `each'
    from /Users/bkosborne/.rvm/gems/ruby-1.9.3-p125/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `map'
    from /Users/bkosborne/.rvm/gems/ruby-1.9.3-p125/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `invoke_all'
    from /Users/bkosborne/.rvm/gems/ruby-1.9.3-p125/gems/thor-0.14.6/lib/thor/group.rb:226:in `dispatch'
    from /Users/bkosborne/.rvm/gems/ruby-1.9.3-p125/gems/thor-0.14.6/lib/thor/base.rb:389:in `start'
    from /Users/bkosborne/.rvm/gems/ruby-1.9.3-p125/gems/railties-3.2.1/lib/rails/commands/application.rb:38:in `<top (required)>'
    from /Users/bkosborne/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /Users/bkosborne/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /Users/bkosborne/.rvm/gems/ruby-1.9.3-p125/gems/railties-3.2.1/lib/rails/cli.rb:15:in `<top (required)>'
    from /Users/bkosborne/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /Users/bkosborne/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /Users/bkosborne/.rvm/gems/ruby-1.9.3-p125/gems/railties-3.2.1/bin/rails:7:in `<top (required)>'
    from /Users/bkosborne/.rvm/gems/ruby-1.9.3-p125/bin/rails:19:in `load'
    from /Users/bkosborne/.rvm/gems/ruby-1.9.3-p125/bin/rails:19:in `<main>'

/Users/bkosborne/Sites/ doesn't exist or you don't have write permissions into that directory. / Users / bkosborne / Sites /不存在或您没有对该目录的写入权限。 chown the directory to yourself or chmod it so that you can write into it. 将目录chown给自己或chmod它,以便您可以写入它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM