Where is RUBYOPT variable set? Follow
I'm trying to debug Ruby on Rails by InnteliJ IDEA on Windows 10. but I got a following error.
C:/Ruby26-x64/bin/ruby.exe -x "C:\Users\xxx\IdeaProjects\xxx\bin\bundle" exec C:\Ruby26-x64\bin\ruby.exe "C:\Users\xxx\.gem\ruby\2.6.0\gems\ruby-debug-ide-2.3.3\bin\rdebug-ide" --key-value --step-over-in-blocks --disable-int-handler --evaluation-timeout 10 --evaluation-control --time-limit 100 --memory-limit 0 --rubymine-protocol-extensions --port 53904 --host 0.0.0.0 --dispatcher-port 53905 -- "C:/Users/xxx/IdeaProjects/xxx/bin/rails" server -b 127.0.0.1 -p 3000 -e development
C:\Ruby26-x64\bin\ruby.exe: invalid switch in RUBYOPT: -a (RuntimeError)
'set' command shows only 'RUBYOPT=-Eutf-8' and I checked windows system environment variables.
There is no '-a' option. How can I remove '-a' option?
Please sign in to leave a comment.
Hello,
Could you please specify your RubyMine version and also attach a screenshot of the Run configuration. In addition, do you manage to run rails server manually from the Terminal?
I attached the screenshots. My version is IntelliJ IDEA 2021.3 (Ultimate Edition)(Build #IU-213.5744.223, built on November 27, 2021) with Ruby plugin.
I can run rails server mannually like this.






> rails.bat s
=> Booting Puma
=> Rails 5.2.6 application starting in development
=> Run `rails server -h` for more startup options
Please add the following to your Gemfile to avoid polling for changes:
gem 'wdm', '>= 0.1.0' if Gem.win_platform?
Please add the following to your Gemfile to avoid polling for changes:
gem 'wdm', '>= 0.1.0' if Gem.win_platform?
*** SIGUSR2 not implemented, signal based restart unavailable!
*** SIGUSR1 not implemented, signal based restart unavailable!
*** SIGHUP not implemented, signal based logs reopening unavailable!
Puma starting in single mode...
* Version 3.12.6 (ruby 2.6.7-p197), codename: Llamas in Pajamas
* Min threads: 5, max threads: 5
* Environment: development
* Listening on tcp://localhost:3000
Use Ctrl-C to stop
Could you please do the following:
1. create rubyopt.rb with the content below and put it to your project
2. create a copy of the Run configuration in question (that's near Save configuration action)
3. add to the field Ruby arguments
For example, in my case it'd look like
4. run the configuration and provide me with the output you get if there's any
I did it. but there is no output.
I created a new plain rails project. but it causes same error only when debuging.
I'm using ruby-debug-ide-2.3.3. Is it no problem?
No, it's not because this version is the latest one. Could you please try adding RUBYOPT as an environment variable to the Run configuration (for example `RUBYOPT=-Eutf-8`). How does it go in this case?