开发者

Ruby/JRuby Conflict - Invalid switch in RUBYOPT -F {RuntimeError}

开发者 https://www.devze.com 2023-03-28 14:30 出处:网络
I have an installer made with NSIS that at a certain point runs the following 3 commands: ... SetOutPath \"$INSTDIR\\Application\"

I have an installer made with NSIS that at a certain point runs the following 3 commands:

...
SetOutPath "$INSTDIR\Application"
nsExec::ExecToLog "jruby -S bundle exec rake db:create RAILS_ENV=production"
nsEx开发者_运维百科ec::ExecToLog "jruby -S bundle exec rake db:migrate RAILS_ENV=production"
nsExec::ExecToLog "jruby -S bundle exec rake db:seed RAILS_ENV=production"  
...

The installer packs JRuby with all the necessary gems already installed and it adds JRuby to Path enviroment variable before executing any jruby command.

The problem appears when I try to run my installer on a machine that has Ruby installed: when the installer gets to execute the above commands, it fails, returning some error like: C:\Ruby192\bin\ruby.exe invalid switch in RUBYOPT -F (RuntimeError)

I have checked the Path environment variable, and it looks pretty much like this:

C:\Ruby192\bin; ... ;C:\Program Files (x86)\MyApplication\JRuby\jruby-1.6.3\bin

My guess is that there is some kind of conflict between Ruby and JRuby. But I cannot figure out how to solve the problem. Any help would be much appreciated.

Thank you.


Have you considered using RVM: http://beginrescueend.com/. Then you have have both ruby and jruby running without conflicting each other.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号