【问题标题】:sending a command to heroku console向heroku控制台发送命令
【发布时间】:2012-04-25 11:45:01
【问题描述】:

向 Cedar 上的 heroku 控制台发送命令的正确方法是什么?

heroku console 2+2 适用于较旧的堆栈 - 它警告我在 cedar 上使用 heroku run console

当我跑步时

heroku run console 2+2

它会加载不需要的 "2+2" 环境并打开一个控制台。

Loading 2+2 environment (Rails 3.2.3)
irb(main):001:0> 

那么在 Cedar 上向 heroku 控制台发送命令的正确方法是什么?

【问题讨论】:

    标签: ruby-on-rails heroku cedar


    【解决方案1】:

    这不是最漂亮的解决方案,但通过管道输入命令确实有效。

    echo "2 + 2" | heroku run console
    

    查看the code,似乎没有(当前)内置方法可以做到这一点。

    【讨论】:

    • 是的,也找不到。没有其他解决方法吗?当我执行此操作时,我无法正常退出控制台,我必须停止该过程。谢谢你的回答
    • 我认为您可以使用heroku run:detached console 运行独立控制台,但我不是 100% 确定。
    猜你喜欢
    • 1970-01-01
    • 2012-08-14
    • 2017-12-08
    • 2020-03-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多