Topic: [OK] I can't see rhtml pages

Hello all,

I'm trying to embed ruby code in HTML pages but when I try to open them in my Web browser they are available for download only. The following document in the FAQ says that ruby is supported by default:

http://faq.tuxfamily.org/WebArea/En#Supported_languages

Is it possible or not to use ruby in WebAreas?

Best regards and thanks in advance,

Re: [OK] I can't see rhtml pages

baridesano wrote:

Hello all,

I'm trying to embed ruby code in HTML pages but when I try to open them in my Web browser they are available for download only. The following document in the FAQ says that ruby is supported by default:

http://faq.tuxfamily.org/WebArea/En#Supported_languages

Is it possible or not to use ruby in WebAreas?

Hey, you are the first one to use ruby on TuxFamily. I added ruby and eruby and configured default handlers for those.

hack.tuxfamily.org-web/htdocs$ cat helloworld.rb
#!/usr/bin/ruby
puts "Content-Type: text/plain\n\n"
puts "Hello World"

http://hack.tuxfamily.org/helloworld.rb


hack.tuxfamily.org-web/htdocs$ cat helloworld.rhtml
#!/usr/bin/eruby
Hello World

http://hack.tuxfamily.org/helloworld.rhtml


Sylvain

Re: [OK] I can't see rhtml pages

Thank you for that, gradator :)

I'm getting an Internal Server Error:

http://gnsenespanol.tuxfamily.org/prueba.rhtml

I tested the same file in the server of my local machine and it works OK.

Any help with this issue is very welcome.

Cheers,

Re: [OK] I can't see rhtml pages

baridesano wrote:

Thank you for that, gradator :)

I'm getting an Internal Server Error: http://gnsenespanol.tuxfamily.org/prueba.rhtml
I tested the same file in the server of my local machine and it works OK.

Any help with this issue is very welcome.

I added the shebang and chmod'ed +x it.

Sylvain

Re: [OK] I can't see rhtml pages

gradator wrote:

I added the shebang and chmod'ed +x it.

Sylvain

Thank you very much!

Re: [OK] I can't see rhtml pages

Hi,

baridesano wrote:

Thank you very much!

You are welcome ;)

I modified today how scripts are executed, please read the FAQ ;-)

http://faq.tuxfamily.org/WebArea/En#How … h_handlers

Basically, you don't need anymore to chmod +x and to add the shebang to them. .rb files are executed through ruby and .rhtml files through eruby without considering the shebang. For those who still need the consideration of the shebang (like perl -w or such things), they can modify the default behavior through .htaccess files ;-)


Sylvain