Rails 控制台无法在服务器上运行 [英] Rails console not working on server

查看:58
本文介绍了Rails 控制台无法在服务器上运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我通过 SSH 在 Capistrano 部署的 Current 文件夹中的服务器上运行 bundle exec rails console productionrails console production 时,我得到:

When I run bundle exec rails console production or rails console production via SSH on the server in the Current folder of the Capistrano deploy I get:

Usage:
     rails new APP_PATH [options]

Options:
    (...)

带有启动新应用程序的说明.在本地它有效.为什么我不能远程启动控制台?

with an explanation to start a new app. Locally it works. Why can't I start a console remotely?

推荐答案

我假设您从版本 3 更新到 rails 4 并且您的应用程序在 bin 目录.运行此命令以查看您的 Rails 版本:

I'm assuming that you updated to rails 4 from version 3 and your app can't find the executables in the bin directory. Run this to see your rails version:

$ rails -v

如果您的 rails 版本是 4 或更高版本,请尝试运行:

If your rails version is 4 or above, try running this:

$ rake rails:update:bin

<小时>

来源:Rails 4 发行说明

  • 您应用的可执行文件现在位于 bin/ 目录中.运行 rake rails:update:bin 以获取 bin/bundlebin/railsbin/rake.

6.1 Notable changes

  • Your app's executables now live in the bin/ dir. Run rake rails:update:bin to get bin/bundle, bin/rails, and bin/rake.

这篇关于Rails 控制台无法在服务器上运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆