【问题标题】:Rails App "Permission Denied" error when installing refinerycms安装refinerycms时出现Rails App“Permission Denied”错误
【发布时间】:2013-05-04 05:05:34
【问题描述】:

在尝试安装 rails 应用程序炼油厂时,我不断收到以下错误:

ESL@new-host-2 ~$ refinerycms /Application/MAMP/htdocs/goodwatching
      create  
/usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/fileutils.rb:247:in `mkdir': Permission denied - /Application (Errno::EACCES)
    from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/fileutils.rb:247:in `fu_mkdir'
    from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/fileutils.rb:221:in `block (2 levels) in mkdir_p'
    from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/fileutils.rb:219:in `reverse_each'
    from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/fileutils.rb:219:in `block in mkdir_p'
    from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/fileutils.rb:205:in `each'
    from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/fileutils.rb:205:in `mkdir_p'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/thor-0.16.0/lib/thor/actions/empty_directory.rb:51:in `block in invoke!'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/thor-0.16.0/lib/thor/actions/empty_directory.rb:133:in `call'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/thor-0.16.0/lib/thor/actions/empty_directory.rb:133:in `invoke_with_conflict_check'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/thor-0.16.0/lib/thor/actions/empty_directory.rb:50:in `invoke!'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/thor-0.16.0/lib/thor/actions.rb:95:in `action'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/thor-0.16.0/lib/thor/actions/empty_directory.rb:15:in `empty_directory'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.13/lib/rails/generators/app_base.rb:103:in `create_root'
    from (eval):1:in `create_root'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/thor-0.16.0/lib/thor/task.rb:27:in `run'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/thor-0.16.0/lib/thor/invocation.rb:120:in `invoke_task'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `block in invoke_all'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `each'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `map'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `invoke_all'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/thor-0.16.0/lib/thor/group.rb:238:in `dispatch'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/thor-0.16.0/lib/thor/base.rb:425:in `start'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/refinerycms-2.0.10/bin/refinerycms:30:in `<top (required)>'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/bin/refinerycms:23:in `load'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/bin/refinerycms:23:in `<main>'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `eval'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `<main>'

我见过几个类似的问题,但解决方法似乎总是目标目录不存在或归根用户所有。我检查过,我的目录存在,归我所有,权限为 755。

更新

我尝试了很多东西,所以我不能 100% 确定这是否相关,但我更新了 rvm,然后我能够从原始 /goodwatching 目录中运行 refinercyms goodwatching。但是现在我在运行它时多次得到这个:

NoMethodError: private method `open' called for Gem::Package:Class
An error occured while installing rake (10.0.4), and Bundler cannot continue.
Make sure that `gem install rake -v '10.0.4'` succeeds before bundling.

当我运行gem install rake -v '10.0.4' 时,它确实成功了,但之后我立即再次收到相同的错误。

【问题讨论】:

    标签: ruby-on-rails ruby rubygems refinerycms


    【解决方案1】:

    尝试使用 sudo

    sudo refinerycms /Application/MAMP/htdocs/goodwatching
    

    更新

    尝试删除 Gemfile.lock

    然后

    sudo gem update --system
    sudo gem install bundler
    sudo bundle install
    

    【讨论】:

    • 我试过了,但没有用。但我确实取得了一些进展(请参阅上面的更新)。
    • 您是否尝试运行“mkdir /Application/MAMP/htdocs/goodwatching/test”?输出是什么?
    • 我看到/goowatching/Gemfile 是吗?
    • @Emerson 不,它是 .lock 之一。从您的应用程序根路径运行“ls -lh”
    • 它不存在。应该吗?
    猜你喜欢
    • 2014-07-31
    • 2017-12-06
    • 1970-01-01
    • 2016-02-12
    • 1970-01-01
    • 1970-01-01
    • 2017-11-29
    • 2018-04-25
    相关资源
    最近更新 更多