estani
estani

Reputation: 26467

how can options be passed to rails console in heroku

While trying to pass options to rails console in Heroku the following error is shown:

> 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)

This is needed as a workaround for IRB multiline support that breaks when pasting long lines.

Upvotes: 2

Views: 560

Answers (1)

estani
estani

Reputation: 26467

The trick is to pass all the parameters to heroku run as a single one:

heroku run "rails console -- --nomultiline"

Upvotes: 6

Related Questions