[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Decky Fiyemonda

2/20/2007 2:06:00 PM

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?

--
Posted via http://www.ruby-....

14 Answers

David Vallner

2/20/2007 2:28:00 PM

0

On Tue, 20 Feb 2007 15:06:21 +0100, Decky Fiyemonda <df_1412@yahoo.com>
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 [http://www.modru...], or WEBrick
[http://www.we...]. 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).
[http://httpd.apache.org/docs/2.2/urlma...]
[http://httpd.apache.org/docs/2.2/mod/mod_...]
[http://httpd.apache.org/docs/2.2/mod/mod_re...]

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 Vallner

manohar amrutkar

2/20/2007 2:38:00 PM

0

Hi,


On Feb 20, 7:06 pm, Decky Fiyemonda <df_1...@yahoo.com> 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 Thomas
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 Development.



> --
> Posted viahttp://www.ruby-....



Lincoln Anderson

2/20/2007 3:09:00 PM

0

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

manohar amrutkar wrote:
> Hi,
>
>
> On Feb 20, 7:06 pm, Decky Fiyemonda <df_1...@yahoo.com> 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 Thomas
> 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 Development.
>
>
>
>> --
>> Posted viahttp://www.ruby-....
>
>
>
>
>

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....

iD8DBQFF2w8VR8wmeqHdtdcRAi+pAKCbYswNerITIJffa9XLaYOxCX6wzQCgi+Ao
dz5xc5n2pOpBQlL/3/iB9ho=
=0/5f
-----END PGP SIGNATURE-----

Chad Perrin

2/20/2007 3:31:00 PM

0

On Tue, Feb 20, 2007 at 11:28:24PM +0900, David Vallner wrote:
> On Tue, 20 Feb 2007 15:06:21 +0100, Decky Fiyemonda <df_1412@yahoo.com>
> 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 [http://www.modru...], or WEBrick
> [http://www.we...]. 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....
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.

>
> 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).

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:

<?php
include('hello_world.rhtml');
?>

. . 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.

--
CCD CopyWrite Chad Perrin [ http://ccd.ap... ]
Amazon.com interview candidate: "When C++ is your
hammer, everything starts to look like your thumb."

Decky Fiyemonda

2/21/2007 2:35:00 AM

0

Thaks Everyone, i will (or i have?) try it.
.....
.....

Hey it is not run properly, i have some problem,

1. some time, a prompt in particular computer did not recognize "make"
or "install" command. why, and how to solve it?

2. 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?

3. if mod_ruby or eruby run with apache server are those need real
apache, cant i use apache in PHPTriad?

--
Posted via http://www.ruby-....

Decky Fiyemonda

2/21/2007 2:38:00 AM

0

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

--
Posted via http://www.ruby-....

Giles Bowkett

2/21/2007 9:13:00 AM

0

On 2/20/07, Decky Fiyemonda <df_1412@yahoo.com> 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.

--
Giles Bowkett
http://www.gilesg...
http://gilesbowkett.bl...
http://gilesgoatboy.bl...

David Vallner

2/21/2007 9:25:00 AM

0

On Wed, 21 Feb 2007 10:12:57 +0100, Giles Bowkett <gilesb@gmail.com> wrote:

> On 2/20/07, Decky Fiyemonda <df_1412@yahoo.com> 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.

o 0 (Huh?)

David Vallner

David Vallner

2/21/2007 9:28:00 AM

0

On Wed, 21 Feb 2007 03:34:30 +0100, Decky Fiyemonda <df_1412@yahoo.com>
wrote:
> 1. 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?

> 2. 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.

> 3. 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 Vallner


David Vallner

2/21/2007 9:30:00 AM

0

On Wed, 21 Feb 2007 03:38:24 +0100, Decky Fiyemonda <df_1412@yahoo.com>
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