【问题标题】:how can options be passed to rails console in heroku如何将选项传递给heroku中的rails控制台
【发布时间】:2021-11-15 17:20:35
【问题描述】:

在 Heroku 中尝试将选项传递给 rails console 时,显示以下错误:

> heroku run rails console -- --nomultiline
Running rails console "-- --nomultiline" on ⬢ the-app... up, run.512 (Standard-1X)
Traceback (most recent call last):
...
/app/vendor/bundle/ruby/2.7.0/gems/railties-6.1.4/lib/rails/commands/console/console_command.rb:95:in `perform': wrong number of arguments (given 1, expected 0) (ArgumentError)
...
/app/vendor/bundle/ruby/2.7.0/gems/thor-1.1.0/lib/thor/base.rb:525:in `handle_argument_error': ERROR: "rails console" was called with arguments ["-- --nomultiline"] (Thor::InvocationError)

这是 IRB 多行支持在粘贴长行时中断的解决方法。

【问题讨论】:

    标签: ruby-on-rails heroku irb


    【解决方案1】:

    诀窍是将所有参数作为一个单独的参数传递给heroku run:

    heroku run "rails console -- --nomultiline"
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-05-05
      • 1970-01-01
      • 1970-01-01
      • 2017-03-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多