Forum: Ruby does ruby have database/network support built in?

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.
5d8a5bba2317da6231774d4d1ddef1d8?d=identicon&s=25 Brian Yahn (yahn)
on 2006-03-25 18:35
      I've been using GM for 5 years now, and last year I started to
learn c++.  I had been working on an online gave for over 2 years, and I
started learning c++ specifically so I could have a faster server.  I
had the game finished in gml, but it was too slow to run so I figured it
couldn't be taht hard to write it in c++.  Well I was dead wrong.  I've
been trying to "translate" the server to c++ for over a year and all
I've managed is creating a program that can send text messages back and
forth.  I could have done that in GM in about 1 minute.

      Anyways I decided that if I ever want to finish this game, I
better find a different language for the server.  I found out about ruby
and it seems to be a lot like GM except it gives you control over
classes etc..  Which is basically what I was looking for all along.  But
what I'm really hopping for is that ruby has database/network support
built in.  So that I could just call a function like send(), rcv() and
wouldn't have to write a c++ dll for the network (kind of
couterporductive).  Database support is especially important.  Is there
any support for mysql in ruby?  I know about ruby on rails, but I'm not
making a web aplication, so I don't think thats what I'm looking for.  I
figured ruby probably had database support since ruby on rails does.
Can anyone tell me where I could find out about Ruby's database/network
support if it has any?
2d3ec3a83b4f8784d6853564fa0d2e77?d=identicon&s=25 Dido Sevilla (Guest)
on 2006-03-25 19:08
(Received via mailing list)
On 3/26/06, brian yahn <yahn15@hotmail.com> wrote:
> Is there
> any support for mysql in ruby?  I know about ruby on rails, but I'm not
> making a web aplication, so I don't think thats what I'm looking for.  I
> figured ruby probably had database support since ruby on rails does.
> Can anyone tell me where I could find out about Ruby's database/network
> support if it has any?

But of course...

http://www.tmtm.org/en/mysql/ruby/

However, you'll probably want to use that only indirectly, with this:

http://ruby-dbi.sourceforge.net/

so that if you ever for whatever reason want to stop using MySQL, you
can shift to something like Oracle, Postgresql, or whatever with
little trouble. ActiveRecord, the component of Rails that provides
database support, is of course available even if you aren't using
Rails itself, but I personally haven't tried to use it independently
of Rails myself. As for networking support, that's certainly available
within Ruby's standard library. Have a look at the net/ stuff in the
ruby-doc.org site for details on the API. There's a thing called
Distributed Ruby that makes remote method calls over a network so
simple as to be almost the same as local method calls.
E29eaefee1709918198c8a4f55c42667?d=identicon&s=25 anne001 (Guest)
on 2006-03-25 19:23
(Received via mailing list)
ruby can access databases,
a search on database should bring you some info
http://www.nabble.com/ruby-and-database-connection...
or http://www.kitebird.com/articles/ruby-mysql.html
also you can use activerecord without using rails.
http://www.nabble.com/ActiveRecord-or-OG--t1150557...
etc
You can write a web application without rails.

As for the web access I know it can be done. Doing a search on a ruby
wiki or on this list
will give you clues. for example ruby supports cgi whatever that is.
And someone posted recently about ruby and html...
3ab52dec8038c52a74f8bb2b462450f4?d=identicon&s=25 Chris Mayer (Guest)
on 2006-03-25 22:30
(Received via mailing list)
brian yahn wrote:
>       I've been using GM for 5 years now, and last year I started to
> learn c++.  I had been working on an online gave for over 2 years, and I
> started learning c++ specifically so I could have a faster server.  I
> had the game finished in gml, but it was too slow to run so I figured it
> couldn't be taht hard to write it in c++.  Well I was dead wrong.  I've
> been trying to "translate" the server to c++ for over a year and all
> I've managed is creating a program that can send text messages back and
> forth.  I could have done that in GM in about 1 minute.

It certainly shouldn't be hard at all to do in C++.

> figured ruby probably had database support since ruby on rails does.
> Can anyone tell me where I could find out about Ruby's database/network
> support if it has any?

There are network and database C++ libraries available, just as there
are in Ruby. I certainly have no idea why you felt you had to write a
DLL for the networking code in C++. Certainly sounds like the research
you are doing now in to Ruby would have been useful for you to do early
in your C++ life cycle.

That said, from the sound of your post, Ruby will most likely allow you
to achieve what you want more easily. Whether you get the speed increase
you want is probably going to depend on your implementation.
This topic is locked and can not be replied to.