【问题标题】:no permission to rake db migrate没有权限 rake db migrate
【发布时间】:2014-08-06 00:00:44
【问题描述】:

我正在尝试在数字海洋服务器上启动我的应用程序,并且我即将完成部署的最后步骤。 bundler 工作正常,我的 gem 已更新,但是当我运行时:

rake db:migrate

我收到以下错误:

/usr/local/rvm/gems/ruby-2.0.0-p451@global/gems/bundler-1.6.5/lib/bundler/definition.rb:259:in `rescue in lock': There was an error while trying to write to Gemfile.lock. It is likely that  (Bundler::InstallError)
you need to allow write permissions for the file at path: 
/home/rails/HandCo-op/Gemfile.lock
    from /usr/local/rvm/gems/ruby-2.0.0-p451@global/gems/bundler-1.6.5/lib/bundler/definition.rb:244:in `lock'
    from /usr/local/rvm/gems/ruby-2.0.0-p451@global/gems/bundler-1.6.5/lib/bundler/environment.rb:34:in `lock'
    from /usr/local/rvm/gems/ruby-2.0.0-p451@global/gems/bundler-1.6.5/lib/bundler/runtime.rb:44:in `setup'
    from /usr/local/rvm/gems/ruby-2.0.0-p451@global/gems/bundler-1.6.5/lib/bundler.rb:120:in `setup'
    from /usr/local/rvm/gems/ruby-2.0.0-p451@global/gems/rubygems-bundler-1.4.4/lib/rubygems-bundler/noexec.rb:94:in `setup'
    from /usr/local/rvm/gems/ruby-2.0.0-p451@global/gems/rubygems-bundler-1.4.4/lib/rubygems-bundler/noexec.rb:124:in `check'
    from /usr/local/rvm/gems/ruby-2.0.0-p451@global/gems/rubygems-bundler-1.4.4/lib/rubygems-bundler/noexec.rb:131:in `<top (required)>'
    from /usr/local/rvm/rubies/ruby-2.0.0-p451/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:135:in `require'
    from /usr/local/rvm/rubies/ruby-2.0.0-p451/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:135:in `rescue in require'
    from /usr/local/rvm/rubies/ruby-2.0.0-p451/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:144:in `require'
    from /usr/local/rvm/gems/ruby-2.0.0-p451@global/gems/rubygems-bundler-1.4.4/lib/rubygems_executable_plugin.rb:4:in `block in <top (required)>'
    from /usr/local/rvm/gems/ruby-2.0.0-p451@global/gems/executable-hooks-1.3.2/lib/executable-hooks/hooks.rb:50:in `call'
    from /usr/local/rvm/gems/ruby-2.0.0-p451@global/gems/executable-hooks-1.3.2/lib/executable-hooks/hooks.rb:50:in `block in run'
    from /usr/local/rvm/gems/ruby-2.0.0-p451@global/gems/executable-hooks-1.3.2/lib/executable-hooks/hooks.rb:49:in `each'
    from /usr/local/rvm/gems/ruby-2.0.0-p451@global/gems/executable-hooks-1.3.2/lib/executable-hooks/hooks.rb:49:in `run'
    from /usr/local/rvm/gems/ruby-2.0.0-p451/bin/ruby_executable_hooks:10:in `<main>'

我看到它希望我向 gemfile.lock 添加权限,我将在接下来进行研究。有人对这个问题有什么建议吗?感谢您的帮助!

【问题讨论】:

    标签: ruby-on-rails database deployment rake digital-ocean


    【解决方案1】:

    这是我用来解决问题的行,只要确保您位于应用程序目录之上或中!

    sudo chown -R $(whoami):$(whoami) myappfolder
    

    耶!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-09-29
      • 2011-06-05
      • 2014-03-15
      • 1970-01-01
      • 2016-09-10
      • 2013-05-21
      • 2012-04-23
      • 2014-01-26
      相关资源
      最近更新 更多