Hi everyone iam new here but iam not in ruby.
How to make Web page with Ruby, and is ruby can run along with PHP?
Hi everyone iam new here but iam not in ruby.
How to make Web page with Ruby, and is ruby can run along with PHP?
Hi,
On Feb 20, 7:06 pm, Decky F. [email protected] wrote:
Hi everyone iam new here but iam not in ruby.
Welcome to Ruby Community.
How to make Web page with Ruby, and is ruby can run along with PHP?
You go through the book Agile Development with Rails by Dave T.
and David Hansson.
Rails is framework which is required for web development and you need
to install it along with Ruby.
ie. Ruby on Rails.
No Ruby runs seperately. Ruby is used on Rails for Web D…
On Tue, 20 Feb 2007 15:06:21 +0100, Decky F. [email protected]
wrote:
Hi everyone iam new here but iam not in ruby.
How to make Web page with Ruby, and is ruby can run along with PHP?
A) twitch
B) If you’re used to PHP, probably the easiest way would be to use
mod_ruby [modruby.net], or WEBrick
[http://www.webrick.org/]. The latter site has some code in the “HTTP
server” section that should get you started. I think[1] WEBrick by
default
will handle files with the extension .rhtml as ERB files, which are the
closest you’ll get to the way PHP works - the basic difference is that
you
write <% your_code_here %> instead of <?php ... ?>.
I’ve never installed mod_ruby, so someone else (e.g. Google) can give
you
a step-by-step walkthrough through the process. Stating what operating
system you use would help if you decide to go that way.
C) Depends on how you define “run along with”. If you use mod_ruby (more
complicated to install), you can run both the languages with one Apache
server, probably depending on the file extension. This is where WEBrick
is
more complicated, because it will be a Ruby-specific server independent
of
your Apache. But it’s possible (and fairly easy once you understand the
principles) to set up Apache so that it asks a running WEBrick to handle
your .rhtml files, using either mod_proxy (if all your .rhtml files are
in
a single directory you’re serving with WEBrick), or mod_rewrite (this is
a
more complicated solution, where you’ll have both Apache or WEBrick
serve
the same directory, but only tell Apache to turn to WEBrick for the ones
whose filenames end in .rhtml).
[Mapping URLs to Filesystem Locations - Apache HTTP Server Version 2.2]
[mod_proxy - Apache HTTP Server Version 2.2]
[mod_rewrite - Apache HTTP Server Version 2.2]
There are many, many other ways to make Ruby-based websites, but I think
these are the easiest to get you going given that you mention PHP and
based on an uneducated guess of mine at your current level of
competence.
(I’m sure others will chime in describing those.)
David V.
On 2/20/07, manohar amrutkar [email protected] wrote:
You go through the book Agile Development with Rails by Dave T.
and David Hansson.
Rails is framework which is required for web development and you need
to install it along with Ruby.
ie. Ruby on Rails.No Ruby runs seperately. Ruby is used on Rails for Web D…
Rails is only one of many ways to create web applications in Ruby. It
is
not required for web development.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
manohar amrutkar wrote:
–
Posted viahttp://www.ruby-forum.com/.
As was mentioned earlier, mod_ruby for apache will allow ruby scripts to
be run from a browser. There is also eRuby, and many other solutions.
RoR is most definitely not the only solution for Ruby web development.
Lincoln Anderson
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFF2w8VR8wmeqHdtdcRAi+pAKCbYswNerITIJffa9XLaYOxCX6wzQCgi+Ao
dz5xc5n2pOpBQlL/3/iB9ho=
=0/5f
-----END PGP SIGNATURE-----
On Tue, Feb 20, 2007 at 11:28:24PM +0900, David V. wrote:
B) If you’re used to PHP, probably the easiest way would be to use
mod_ruby [modruby.net], or WEBrick
[http://www.webrick.org/]. The latter site has some code in the “HTTP
server” section that should get you started. I think[1] WEBrick by default
will handle files with the extension .rhtml as ERB files, which are the
closest you’ll get to the way PHP works - the basic difference is that you
write <% your_code_here %> instead of <?php ... ?>.
If you’re using a shared hosting account, you may be able to set up
eruby via the cgi-bin directory. The procedure goes something like
this:
mkdir ~/eruby
cd ~/eruby
wget http://www.modruby.net/archive/eruby-1.0.5.tar.gz
tar -xzf eruby-1.0.5.tar.gz
cd eruby-1.0.5
./configure.rb
make
make install
cp eruby ~/public_html/cgi-bin/eruby
cd ~/public_html/cgi-bin
chmod 755 eruby
Then, you have to edit your ~/.htaccess file to add MIME type
association for your files. For instance, add these two lines to be
able to create .rhtml files similarly to how you’d use .php files:
AddType application/x-httpd-eruby .rhtml
Action application/x-httpd-eruby /cgi-bin/eruby
Then this code in a hello_world.rhtml file would print out “Hello,
world!” in the browser of anyone opening that page:
<%
puts “Hello, world!”
%>
Normally, of course, you’d want to actually include normal webpage
stuff, like html tags, page title, stylesheets, and so on – just as you
would with PHP. This all assumes you have shell access on the shared
hosting account, however – which you certainly do not have on certain
low-quality webhosts such as GoDaddy.
Hint about webhosts: Never use one that does not provide SSH, or at
least SFTP, access. With standard FTP, you’re essentially broadcasting
your username and password to anyone with the desire to listen in.
the same directory, but only tell Apache to turn to WEBrick for the ones
whose filenames end in .rhtml).
I have no idea what was meant by “run along with” in this context,
either. Both will run on the same server, but mixing both in one file
is unlikely to yield positive results. For instance, trying to embed
output from the above example hello_world.rhtml in a PHP file with the
following code:
. . . results in the source code of the .rhtml file being sent to the
browser, rather than being executed on the server so that “Hello,
world!” would be sent to the browser.
Thaks Everyone, i will (or i have?) try it.
…
…
Hey it is not run properly, i have some problem,
some time, a prompt in particular computer did not recognize “make”
or “install” command. why, and how to solve it?
even it recognize “make” or “install” command it always error in
compuilation progress so i still cannot install it, again, why and how
to solve it?
if mod_ruby or eruby run with apache server are those need real
apache, cant i use apache in PHPTriad?
Oh yeah i forgot to add some thing, the problem are same if i try to
install a gem, i put a command $gem instal something --option, and the
propmt say, “error while executing gem command” or something like that
On 2/20/07, Decky F. [email protected] wrote:
Oh yeah i forgot to add some thing, the problem are same if i try to
install a gem, i put a command $gem instal something --option, and the
propmt say, “error while executing gem command” or something like that
These are really questions for the Rails list. Go to Google and search
for “google groups ruby on rails.” They’ll help you much better than
we can.
On Wed, 21 Feb 2007 10:12:57 +0100, Giles B. [email protected]
wrote:
On 2/20/07, Decky F. [email protected] wrote:
Oh yeah i forgot to add some thing, the problem are same if i try to
install a gem, i put a command $gem instal something --option, and the
propmt say, “error while executing gem command” or something like thatThese are really questions for the Rails list.
. o 0 (Huh?)
David V.
On Wed, 21 Feb 2007 03:34:30 +0100, Decky F. [email protected]
wrote:
- some time, a prompt in particular computer did not recognize “make”
or “install” command. why, and how to solve it?
What are you trying to install, what operating system, do you have the
“make” and “install” programs on the computer?
- even it recognize “make” or “install” command it always error in
compuilation progress so i still cannot install it, again, why and how
to solve it?
Same as above.
- if mod_ruby or eruby run with apache server are those need real
apache, cant i use apache in PHPTriad?
Apache is apache is apache. I have no idea what PHPTriad is, but I doubt
they built Apache without support for extension modules. (Since that
would
make it difficult to run mod_php). So: it should work fine.
David V.
On Wed, 21 Feb 2007 03:38:24 +0100, Decky F. [email protected]
wrote:
Oh yeah i forgot to add some thing, the problem are same if i try to
install a gem, i put a command $gem instal something --option, and the
propmt say, “error while executing gem command” or something like that
How did you install Ruby? Did you install rubygems? -WHAT- error while
executing gem command happened? (It’s sort of hard to do a diagnosis on
“something like that”. Copy / paste is your friend.)
David vallner
On 2/21/07, David V. [email protected] wrote:
On Wed, 21 Feb 2007 10:12:57 +0100, Giles B. [email protected] wrote:
On 2/20/07, Decky F. [email protected] wrote:
Oh yeah i forgot to add some thing, the problem are same if i try to
install a gem, i put a command $gem instal something --option, and the
propmt say, “error while executing gem command” or something like thatThese are really questions for the Rails list.
. o 0 (Huh?)
Sorry, that was more accurate for the first post in the thread (by the
same poster) than it was for the one I actually responded to.
First post:
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs