English 中文(简体)
如何执行LAMP网络应用的Ruby
原标题:How to execute Ruby Script from LAMP Web Application
  • 时间:2012-01-14 12:54:09
  •  标签:
  • ruby
  • lamp

I have installed rvm (mutiuser option) and ruby using "rvm install" on my test server running Ubuntu. If I log in and execute "ruby test.rb", the script runs correctly. But If I execute it using "exec" from my php code, I get an error.

If I "su www-data" and try to execute the script then I get the same error, so I guess the question is how to get "www-data" to have the correct environment to execute Ruby scripts. I ve already tried adding "www-data" to "rvm" group and doesn t work. If I give the full path to Ruby bin, then the script executes, but fails when requiring gems.

我也试图执行一个.子,即阴道线是“rvm使用废墟-xxx”,第二行是“reby test.rb” , does干。

我是否应当使用“吸收目标安装”安装Rub?

感谢很多。

最佳回答

Hm,我不知道多用户版本,但如果你使用单一用户版本,你可以像用户那样使用文字:

/bin/su - postgres -c "/path/to/backup_db.sh /tmp/test"

问题回答

暂无回答




相关问题
Ruby parser in Java

The project I m doing is written in Java and parsers source code files. (Java src up to now). Now I d like to enable parsing Ruby code as well. Therefore I am looking for a parser in Java that parses ...

rails collection_select vs. select

collection_select and select Rails helpers: Which one should I use? I can t see a difference in both ways. Both helpers take a collection and generates options tags inside a select tag. Is there a ...

RubyCAS-Client question: Rails

I ve installed RubyCAS-Client version 2.1.0 as a plugin within a rails app. It s working, but I d like to remove the ?ticket= in the url. Is this possible?

Ordering a hash to xml: Rails

I m building an xml document from a hash. The xml attributes need to be in order. How can this be accomplished? hash.to_xml

multiple ruby extension modules under one directory

Can sources for discrete ruby extension modules live in the same directory, controlled by the same extconf.rb script? Background: I ve a project with two extension modules, foo.so and bar.so which ...

Text Editor for Ruby-on-Rails

guys which text editor is good for Rubyonrails? i m using Windows and i was using E-Texteditor but its not free n its expired now can anyone plese tell me any free texteditor? n which one is best an ...

热门标签