Help Me

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-forum.com/.

A) *twitch*
B) If you're used to PHP, probably the easiest way would be to use mod_ruby [http://www.modruby.net/en/\], 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). [http://httpd.apache.org/docs/2.2/urlmapping.html\] [http://httpd.apache.org/docs/2.2/mod/mod_proxy.html\] [http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html\]

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

···

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?

Hi,

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.

···

On Feb 20, 7:06 pm, Decky Fiyemonda <df_1...@yahoo.com> wrote:

--
Posted viahttp://www.ruby-forum.com/.

Rails is only one of many ways to create web applications in Ruby. It is
not required for web development.

···

On 2/20/07, manohar amrutkar <amrutkar.manohar@gmail.com> wrote:

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.

--
Avdi

manohar amrutkar wrote:

Hi,

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

···

On Feb 20, 7:06 pm, Decky Fiyemonda <df_1...@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.modruby.net/en/\], 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.

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.

···

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:

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

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-forum.com/.

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-forum.com/.

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

···

On Wed, 21 Feb 2007 03:34:30 +0100, Decky Fiyemonda <df_1412@yahoo.com> wrote:

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

--
Giles Bowkett
http://www.gilesgoatboy.org

http://gilesgoatboy.blogspot.com

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

. o 0 (Huh?)

David Vallner

···

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.

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

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:

···

On 2/21/07, David Vallner <david@vallner.net> wrote:

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:
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?

--
Giles Bowkett
http://www.gilesgoatboy.org

http://gilesgoatboy.blogspot.com