3

I am upgrading from Rails 4.1.5 to rails 6.1.3. I want to get the arguments when starting the rails server (port, binding, ...)

In my current APP I have an initializer that gets the ARGV array. In Rails 6 I tried exactly the same but did not get any ARGV elements (the ARGV is empty []).

I have followed this answers but without success.

What can I do to get the parameters? I am running the rails 6 APP using docker.

Thanks in advance!

UPDATE

I encountered this issue that fixed a bug in ARGV. Also I tried using ARGV in Rails 6.0.3.5 and it works. After this version it does not work.

  • Not a direct solution but rather a workaround: Gather the information you seek not from ARGV but from ENV and/or Rails config (which is setup based on ARGV and default values). – yoones Mar 03 '21 at 17:15
  • Thanks for the help. That's what I will gona do. But the migration would have been smoother if the ARGV option was still available (and I am migrating a lot of apps). – Ricardo Barreto Mar 05 '21 at 17:39

0 Answers0