illegal switch in RUBYOPT: -F (RUNTIMEERROR)

1,184 views
Skip to first unread message

dedicateditman

unread,
Oct 3, 2012, 3:36:37 PM10/3/12
to rubyin...@googlegroups.com
Am using Ruby187, Bundler-1.2.0 gem and a rails 2.3.5 app.

When i try bundle exec mongrel_rails start, I get this error on the command line: ruby.exe: illegal switch in RUBYOPT: -F (RuntimeError).
From the little research i have made i realised it has to do with spaces in paths to app directory or ruby install directory. My app is in a in program files on drive c:/ and it has to be there for security reasons. so is my ruby install path.

What is this error all about and how can I solve?
what is RUBYOPT?
what are the switches and what do they mean?
Thanks.

Justin Baker

unread,
Oct 3, 2012, 5:51:30 PM10/3/12
to rubyin...@googlegroups.com
On Wed, Oct 3, 2012 at 2:36 PM, dedicateditman <dedicat...@gmail.com> wrote:
Am using Ruby187, Bundler-1.2.0 gem and a rails 2.3.5 app.

When i try bundle exec mongrel_rails start, I get this error on the command line: ruby.exe: illegal switch in RUBYOPT: -F (RuntimeError).
From the little research i have made i realised it has to do with spaces in paths to app directory or ruby install directory. My app is in a in program files on drive c:/ and it has to be there for security reasons. so is my ruby install path.

There are literally no other options?

Developing in `Program Files` can be extremely hard. If you have security concerns it may be impossible to run/develop in `Program Files`.
 
What is this error all about and how can I solve?
what is RUBYOPT?
what are the switches and what do they mean?
Thanks.

RUBYOPT is an environment variable that you can set to cause every invocation of `ruby` to be started with those options. In this case, it's probably the space in `Program Files` that is causing your problems. The space in the directory is causing the latter part of the directory, starting with "Files", to be parsed as a separate entity. Which is why you're getting the illegal switch of `F`. I don't know if this is actually fixable.

All of that aside, `Program Files` is designed to be extremely "Read-Only". Most importantly "CREATOR OWNER" doesn't have any access to the folders in `Program Files`, so writing temporary files of any kind will require full elevation. I would never suggest this because of the security implications.

Sorry if I wasn't helpful; likewise I don't know I can help you. It may be helpful to know more about the environment though. Especially things like "Which version of Windows?"

Justin

dedicateditman

unread,
Oct 4, 2012, 9:43:59 AM10/4/12
to rubyin...@googlegroups.com
Thanks for the reply.

I tried this solution but still not working.

http://stackoverflow.com/questions/6375063/bundle-exec-rspec-spec-invalid-switch-in-rubyopt-f-runtimeerror

Also I want to know if I can install Ruby and my App to the Windows folder. Either on win xp or 7 or 8.

The app is going to be hosted locally and i just cant afford to install the whole rails app and ruby to drive C which seems to be the way ruby works.
Reply all
Reply to author
Forward
0 new messages