# ONLamp tutorial install issue (mysql gem)

**URL:** <https://www.ruby-forum.com/t/onlamp-tutorial-install-issue-mysql-gem/101971>\
**Category:** Ruby\
**Created:** [February 7, 2006, 11:18am UTC](https://www.ruby-forum.com/t/onlamp-tutorial-install-issue-mysql-gem/101971 "2006-02-07T11:18:59Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [February 7, 2006, 11:18am UTC](https://www.ruby-forum.com/t/onlamp-tutorial-install-issue-mysql-gem/101971/1 "2006-02-07T11:18:59Z")

</div>

Hi all,  
I have downloaded and installed Ruby on Rails and started on the  
ONLamp tutorial (cookbook), all went well and RoR installed OK. My  
installation of MySql gem file failed with error:  
ERROR: Error installing gem mysql[.gem]: ERROR: Failed to build gem  
native extension.  
Gem files will remain installed in  
C:/ruby/lib/ruby/gems/1.8/gems/mysql-2.7 for inspection.  
ruby extconf.rb install mysql\nchecking for mysql\_query() in  
mysqlclient.lib… no  
checking for main() in m.lib… yes  
checking for mysql\_query() in mysqlclient.lib… no  
checking for main() in z.lib… no  
checking for mysql\_query() in mysqlclient.lib… no  
checking for main() in socket.lib… no  
checking for mysql\_query() in mysqlclient.lib… no  
checking for main() in nsl.lib… no  
checking for mysql\_query() in mysqlclient.lib… no

Background info:  
Windows XP  
Ruby 1.8.4 installed OK  
MySQL 2.7 gem  
MySQL 5.0.18 installed OK (I created tables, inserted data, all  
OK) directory is C:\ent\mysql  
Ruby on Rails 1.0 installed OK

After installing MySQL from installer, I noticed that MySQL did not  
install a /lib and /include directories. I then downloaded the zip  
version of MySQL which contained these diectories and added them, all  
to no avail - I still get the error above.

BTW I have dowloaded the gem file and run it from a ‘temp’ directory. I  
have tried running ruby extconf.rb with various options, all with not  
luck

Any ideas ?  
( I am going to download InstantRails and try that - whilst I am a big  
fan of Ruby this whole RoR install/demo process needs more polishing)

If i have missed anything out, I am happy to give more details.

Regards,  
Serge

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [February 7, 2006, 4:46pm UTC](https://www.ruby-forum.com/t/onlamp-tutorial-install-issue-mysql-gem/101971/2 "2006-02-07T16:46:55Z")

</div>

There is a known bug that causes this to happen of Fedora core 4. I  
can’t remember the exact method to fix it or the exact link of the  
tutorial on how to fix it, but you can google it. I know the solution  
is on [ocforums.com](http://ocforums.com)

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [February 7, 2006, 5:33pm UTC](https://www.ruby-forum.com/t/onlamp-tutorial-install-issue-mysql-gem/101971/3 "2006-02-07T17:33:06Z")

</div>

You don’t need to install the MySQL gem at all (at least not for going  
through the tutorial). Rails comes with a pure-Ruby interface to MySQL  
that works just find for development (and even low volume production).  
The gem just gives you a faster C-based version of the driver.

Also, you might want to consider trying Instant Rails and its “port”  
of the ONLamp tutorial to be Instant Rails specific:

[http://instantrails.rubyforge.org/](http://instantrails.rubyforge.org/)

Curt

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [February 11, 2006, 3:03am UTC](https://www.ruby-forum.com/t/onlamp-tutorial-install-issue-mysql-gem/101971/4 "2006-02-11T03:03:29Z")

</div>

Thanks,  
I am not sure what the problem, but I downloaded RADRuby Eclipse  
plugin and recreated the tutorial, and it worked fine. I will  
investigate to see what the problem was.

I appreciate all the prompt responses to my question.

Regards,  
Serge

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [February 12, 2006, 10:14pm UTC](https://www.ruby-forum.com/t/onlamp-tutorial-install-issue-mysql-gem/101971/5 "2006-02-12T22:14:30Z")

</div>

I’m trying to use the unnormalize method of the Text class in the  
REXML module to un-escape some XML, but I’m getting this error:

/usr/local/lib/ruby/1.8/rexml/text.rb:304:in `unnormalize': private method`gsub!’ called for #REXML::Text:0x10aeb80 (NoMethodError)

The code for the unnormalize method looks like this:

def Text::unnormalize( string, doctype=nil, filter=nil, illegal=nil )  
rv = string.clone  
rv.gsub!( /\r\n?/, “\n” )  
…

Any ideas as to why Ruby thinks gsub! is private, and why I can’t  
call the method?

Thanks,  
Christian

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [February 12, 2006, 10:03pm UTC](https://www.ruby-forum.com/t/onlamp-tutorial-install-issue-mysql-gem/101971/6 "2006-02-12T22:03:50Z")

</div>

mysqlclient.lib was not found  
it comes with mysql or development packages (in some linux distros)

just install any of these, and if it still wont compile, you’ll have to  
set some parameters (–with-mysql=/path/to/mysql, or something)

Meião

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [February 13, 2006, 5:16am UTC](https://www.ruby-forum.com/t/onlamp-tutorial-install-issue-mysql-gem/101971/7 "2006-02-13T05:16:52Z")

</div>

For those interested, I was passing in an instance of Text rather  
than a string. Oops. Calling to\_s solved the problem.

Christian

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [February 13, 2006, 5:32am UTC](https://www.ruby-forum.com/t/onlamp-tutorial-install-issue-mysql-gem/101971/8 "2006-02-13T05:32:23Z")

</div>

DÅ?a Pondelok 13 FebruÃ¡r 2006 05:16 Christian Cantrell napÃ­sal:

> For those interested, I was passing in an instance of Text rather  
> than a string. Oops. Calling to\_s solved the problem.
> 
> Christian

Weird. I’d say a Text XML node would be coercible to a String without  
much  
problems. I say hint the REXML people to have Text implement to\_str?

David V.
