Forum: Ruby Help Me

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
01d6f2c2e7a784478c030d6ee0563de8?d=identicon&s=25 Decky Fiyemonda (1412)
on 2007-02-20 15:06
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?
430ea1cba106cc65b7687d66e9df4f06?d=identicon&s=25 David Vallner (Guest)
on 2007-02-20 15:29
(Received via mailing list)
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.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
994fce1423e104ecd59fad58e740115f?d=identicon&s=25 manohar amrutkar (Guest)
on 2007-02-20 15:40
(Received via mailing list)
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.
4dea430d31b993abaf41cd9b54f8128d?d=identicon&s=25 Avdi Grimm (Guest)
on 2007-02-20 15:47
(Received via mailing list)
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.



Rails is only one of many ways to create web applications in Ruby.  It
is
not required for web development.
29b25ecfc0229634cd39f4d7b2f4727d?d=identicon&s=25 Lincoln Anderson (Guest)
on 2007-02-20 16:10
(Received via mailing list)
-----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-----
Fd22ee3cfc7dac283ce8e451af324f7d?d=identicon&s=25 Chad Perrin (Guest)
on 2007-02-20 16:31
(Received via mailing list)
On Tue, Feb 20, 2007 at 11:28:24PM +0900, David Vallner wrote:
> 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.

> 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.
01d6f2c2e7a784478c030d6ee0563de8?d=identicon&s=25 Decky Fiyemonda (1412)
on 2007-02-21 03:34
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?
01d6f2c2e7a784478c030d6ee0563de8?d=identicon&s=25 Decky Fiyemonda (1412)
on 2007-02-21 03:38
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
Ce8b03e5750097942c58e12b46724312?d=identicon&s=25 Giles Bowkett (Guest)
on 2007-02-21 10:14
(Received via mailing list)
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.
430ea1cba106cc65b7687d66e9df4f06?d=identicon&s=25 David Vallner (Guest)
on 2007-02-21 10:26
(Received via mailing list)
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
430ea1cba106cc65b7687d66e9df4f06?d=identicon&s=25 David Vallner (Guest)
on 2007-02-21 10:29
(Received via mailing list)
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
430ea1cba106cc65b7687d66e9df4f06?d=identicon&s=25 David Vallner (Guest)
on 2007-02-21 10:30
(Received via mailing list)
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
Ce8b03e5750097942c58e12b46724312?d=identicon&s=25 Giles Bowkett (Guest)
on 2007-02-26 01:44
(Received via mailing list)
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:
> >> 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:
This topic is locked and can not be replied to.