[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

mysql-ruby installation - extconf.rb:33: uninitialized constant CPP (NameError

Mark

1/19/2005 11:38:00 PM

Hi all,
I am trying to install mysql-ruby-2.4.4 on my Fedora Core 3 with ruby
1.8.2 (2004-12-25) [i686-linux] (gcc (GCC) 3.4.2 20041017 (Red Hat
3.4.2-6.fc3)). Following the instructions at
http://tmtm.org/en/m... I got the following scenario:

[mark@localhost mysql-ruby-2.4.4]$ ruby extconf.rb
checking for mysql_query() in -lmysqlclient... yes
checking for mysql.h... no
checking for mysql/mysql.h... yes
creating Makefile
extconf.rb:33: uninitialized constant CPP (NameError)

As you can see I get the error at line 33. Looking at that line I see
the assignment:
cpp = Config::expand sprintf(CPP, $CPPFLAGS, $CFLAGS, '')

Here my very limited understanding ends. How can I solve this issue,
there is probably some problem related to the compiler but I don't now
what to do to solve it. Please advice if you can.

I tried also to install ruby-mysql-0.2.5 and it was installed
succesfull. But when I tried the test.rb I got the following error:

[root@localhost ruby-mysql-0.2.5]# ruby test.rb localhost myusername
mypassword
connect............../mysql.rb:453:in `read': Client does not support
authentication protocol requested by server; consider upgrading MySQL
client (Mysql::Error)
from ./mysql.rb:130:in `real_connect'
from ./mysql.rb:91:in `initialize'
from ./mysql.rb:1085:in `new'
from ./mysql.rb:1085:in `connect'
from ./t/00connect.rb:1
from test.rb:23:in `load'
from test.rb:23
from test.rb:19:in `each'
from test.rb:19
I have the latest stable version of MySQL: 4.1.9.
Could you help also on this point?

What's wrong with my attempts to let MySQL and Ruby happily communicate?

Thanks in advance,
Mark

Inviato da www.mynewsgate.net
9 Answers

Joao Pedrosa

1/19/2005 11:46:00 PM

0

Hi,

> What's wrong with my attempts to let MySQL and Ruby happily communicate?

There is a known issue with the latest version of MySQL, because they
changed something in the client that broke many libraries that before
one of the latest versions of the 4.1x series used to work fine.

Basically, I made some changes to the MySQL server which would allow
the old connection type to occur, but I would rather wait for someone
with the right instructions.

You need to append a line to your my.ini that reads like
'old-password' or something like that. Then you need to restart the
MySQL server and then create a new login and password which you will
use to connect to it. That's how I solved it, at least. Anyone with a
saving link? :-)

Cheers,
Joao


Mark

1/20/2005 10:21:00 AM

0

Thanks Joao.
I don't really want to modify MySQL because of Ruby. If my web
application runs on a shared hosting and I don't have a so low level
access to MySQL, I am kind of screwed. Is there any plan for updating
ruby-mysql?

Regarding postgreSQL access modules, the latest releases were in 2003.
Is the ruby community really interested in DB access? How do you do guys?
I wish ruby was like python from this viewpoint... batteries included.
Access to databases is something so required, like string handling, it
must be included or at least very very easily installable. (for
postgres) 2003 and no other updates, jeez...

So, this is also my answer to the post "Best ways to accelerate Ruby's
popularity": make access to databases damn easy, at least for the main
one: MySQL, PostgreSQL, Firebird, SQLite, Oracle, Ms SQL Server,
etc...etc...

I am very discouraged. The python book is tempting me. :-(((

No flame, troll or whatsoever intended.
Thanks for any comment.

Mark

Inviato da www.mynewsgate.net

Michael Neumann

1/20/2005 11:48:00 AM

0

Mark wrote:
> Thanks Joao.
> I don't really want to modify MySQL because of Ruby. If my web
> application runs on a shared hosting and I don't have a so low level
> access to MySQL, I am kind of screwed. Is there any plan for updating
> ruby-mysql?
>
> Regarding postgreSQL access modules, the latest releases were in 2003.
> Is the ruby community really interested in DB access? How do you do guys?
> I wish ruby was like python from this viewpoint... batteries included.
> Access to databases is something so required, like string handling, it
> must be included or at least very very easily installable. (for
> postgres) 2003 and no other updates, jeez...

Latest release of my postgres-pr (pure Ruby version) was in 2005. But
sure, you can't compare it to the C interface in terms of speed and
probably reliability. Maybe there was no further release of the C
interface, because it's just complete (no bugs, so why change it?).

Regards,

Michael


Joao Pedrosa

1/20/2005 12:17:00 PM

0

Hi,

On Thu, 20 Jan 2005 19:21:00 +0900, Mark <8904invalid@mynewsgate.net> wrote:
> Thanks Joao.
> I don't really want to modify MySQL because of Ruby. If my web
> application runs on a shared hosting and I don't have a so low level
> access to MySQL, I am kind of screwed. Is there any plan for updating
> ruby-mysql?

The MySQL change affects many languages and libraries, not only Ruby.

> Regarding postgreSQL access modules, the latest releases were in 2003.
> Is the ruby community really interested in DB access? How do you do guys?
> I wish ruby was like python from this viewpoint... batteries included.
> Access to databases is something so required, like string handling, it
> must be included or at least very very easily installable. (for
> postgres) 2003 and no other updates, jeez...

With just one tweaking I was able to compile/install the postgres
driver on Ruby 1.9 from the CVS and access PostgreSQL 8.0 on another
computer.

> So, this is also my answer to the post "Best ways to accelerate Ruby's
> popularity": make access to databases damn easy, at least for the main
> one: MySQL, PostgreSQL, Firebird, SQLite, Oracle, Ms SQL Server,
> etc...etc...

I'm creating my own interface to MySQL, PostgreSQL, Firebird and
SQLite. So I'm able to connect to these four reasonably well. Also, I
can connect to Firebird using the ODBC driver on Windows and on Linux,
so any database with a supported ODBC driver can be accessed just
fine, I suppose.

> I am very discouraged. The python book is tempting me. :-(((

At least I don't consider Python any better in this regard. I like the
Ruby drivers very much.

> No flame, troll or whatsoever intended.
> Thanks for any comment.

No problem. It's just that most Ruby users don't care about binary
packages, so you end up having to learn how to tweak the setup and
install scripts when the need comes, so the library can get installed
successfully. On Windows, it's good to have some compiler handy. MinGW
and the Microsoft compiler are available in free downloads. See:
http://www.rubygarden.org/ruby?Windo...

> Mark
>
> Inviato da www.mynewsgate.net

Cheers,
Joao


Joao Pedrosa

1/20/2005 12:22:00 PM

0

Hi Mark,

On Thu, 20 Jan 2005 19:21:00 +0900, Mark <8904invalid@mynewsgate.net> wrote:
> Thanks Joao.
> I don't really want to modify MySQL because of Ruby. If my web
> application runs on a shared hosting and I don't have a so low level
> access to MySQL, I am kind of screwed. Is there any plan for updating
> ruby-mysql?

I almost forgot. Don't worry about the shared hosts, they usually have
some old version of MySQL installed. :-)

Cheers,
Joao


Mark

1/20/2005 3:45:00 PM

0

Thanks guys,
some help with the error 33 there?

Thank you,
Mark

Inviato da www.mynewsgate.net

Joao Pedrosa

1/20/2005 4:28:00 PM

0

Hi,

On Fri, 21 Jan 2005 00:40:59 +0900, Mark <8904invalid@mynewsgate.net> wrote:
> Thanks guys,
> some help with the error 33 there?

The line number 33 is not the same line in my extconf.rb. I just
compiled this module just fine on Ubuntu - Hoary.

Maybe you could download this package if you haven't done so:
http://tmtm.org/mysql/ruby/mysql-ruby-2....

It's the same that I just tried.

Keep us informed if it still does not work.

My env:
dewd@heaven:~ $ mysql --version
mysql Ver 14.7 Distrib 4.1.8a, for pc-linux-gnu (i386)

dewd@heaven:~ $ ruby -v
ruby 1.9.0 (2005-01-15) [i686-linux]

Cheers,
Joao


Mark

1/21/2005 10:00:00 AM

0

THANK YOU SO MUCH.
I installed the new version and it works greatly.
I installed ruby-mysql as well, and it works even if the test.rb fails.

This is great!
What's the advantage to use ruby-mysql over mysql-ruby?

Mark

Inviato da www.mynewsgate.net

Joao Pedrosa

1/21/2005 11:35:00 AM

0

Hi,

> What's the advantage to use ruby-mysql over mysql-ruby?

mysql-ruby is supposed to be two times faster than ruby-mysql, at
least in the Rails web-framework.

Cheers,
Joao