How to get rvm running inside fcgi?

2019-07-20 00:22发布

I had a rails 2.3 application running on apache + fcgi, and I am migrating it to rails 3.1 + rvm (+ apache + fcgi).

I am now blocked at fcgi <-> rvm.

I tried putting #!/usr/local/bin/rvm 1.9.2@rails31 exec rubyinside my public/dispatch.fcgi.

Running /usr/local/bin/rvm use 1.9.2@rails31 exec ruby /some_path/current/public/dispatch.fcgi from my command line works fine, but the apache log shows:

ERROR: Unrecognized command line argument(s): '/some_path/current/public/dispatch.fcgi ' ( see: 'rvm usage' )

Any idea of what is going on ? How should configure things to make this work ?

Thanks for your answers.

1条回答
叛逆
2楼-- · 2019-07-20 00:24

Haven't tried myself but how about something like

#!/usr/bin/env /usr/local/bin/ruby-1.9.2-p180

following the instructions at How to use RVM installs of Ruby in shell & CGI scripts? (If you have RVM installed locally at user directory, the path would be something like ~/.rvm/bin/...

查看更多
登录 后发表回答