【问题标题】:Rails console on a vps returns 'rails new' usagevps 上的 Rails 控制台返回“rails new”使用情况
【发布时间】:2015-07-05 05:57:48
【问题描述】:

我在gorails tutorial 之后部署了我的应用程序。我似乎无法在当前文件夹中运行 rails 控制台。

这行得通!

$ RAILS_ENV=production bundle exec rake db:seed

这不是

$ RAILS_ENV=production bundle exec rails console

上面的命令返回'rails new'的用法。

注意:我正在尝试在当前文件夹中运行这些命令。

【问题讨论】:

    标签: ruby-on-rails deployment capistrano3 bin


    【解决方案1】:

    尝试在您的服务器上运行它:

    RAILS_ENV=production bundle exec rake rails:update:bin
    

    那就试试

    RAILS_ENV=production bundle exec rails console
    

    永久解决方案:

    第一步之后。

    将您的 bin 文件夹复制到共享文件夹。

    然后在您的 capistrano 中,将 bin 文件夹设置为 linked_dirs。

    set :linked_dirs, %w{bin log tmp/backup tmp/pids tmp/cache tmp/sockets vendor/bundle}
    

    然后再次部署。

    因此,更新后的 bin 文件夹将始终从共享文件夹提供,您无需每次都更新 bin。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-11-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-07-25
      • 1970-01-01
      相关资源
      最近更新 更多