简体   繁体   中英

ERB files not working in EasyPHP

I have installed EasyPHP 16.1 with Ruby and tested with Ruby files (.rb) and they are working. So Ruby is properly installed in EasyPHP. However the embedded ruby files (.erb) do not work in EasyPHP. For example out put of following erb file is something as given below.

Ruby File (.erb)

<h1>This is a test</h1>
<%= puts "Content-type: text/html"%>
<%= puts "Ruby example"%>
<% puts "#{10*5}"%>
%>

Result (as displayed in browser)

Click here to see what gets displayed in browser

That's not how it works.

Erb is a templating language and you'll need Ruby code to load the template, compile it and render it to the user. You cannot just server an .erb file and expect it to work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM