Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > no such file to load -- mysql (LoadError)

Reply
Thread Tools

no such file to load -- mysql (LoadError)

 
 
Ani T.
Guest
Posts: n/a
 
      11-09-2010
Hi! I am new to Ruby and just installed RadRails and also did gem
install mysql and specifiled the path as
C:\Ruby\lib\ruby\gems\1.8\gems\mysql-2.7.3-x86-mswin32\ext
when i run the following:

require 'mysql'
if __FILE__ == $0
# TODO Generated stub
print "Hello\n"
end

I am getting the following error
test1.rb:4:in `require': no such file to load -- mysql (LoadError)
from test1.rb:4

Can someone please help? I've looked at available posts and could not
find a solution... have been trying to find a solution to this
problem for 2 days but not getting anywhere. Any help is much
appreciated.

Thanks.
Ani

--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
 
Ryan Davis
Guest
Posts: n/a
 
      11-09-2010

On Nov 8, 2010, at 19:52 , Ani T. wrote:

> Hi! I am new to Ruby and just installed RadRails and also did gem
> install mysql and specifiled the path as
> C:\Ruby\lib\ruby\gems\1.8\gems\mysql-2.7.3-x86-mswin32\ext
> when i run the following:
>=20
> require 'mysql'
> if __FILE__ =3D=3D $0
> # TODO Generated stub
> print "Hello\n"
> end
>=20
> I am getting the following error
> test1.rb:4:in `require': no such file to load -- mysql (LoadError)
> from test1.rb:4


You're running 1.8 so you need to add "require 'rubygems'" before your =
"require 'mysql'" line.


 
Reply With Quote
 
 
 
 
Ani T.
Guest
Posts: n/a
 
      11-09-2010
Hi Ryan, Thanks for your post.

I inserted "require 'rubygems'" and am now getting the following error:
C:/ruby/lib/ruby/gems/1.8/gems/mysql-2.7.3-x86-mswin32/ext/mysql.so:
126: The specified module could not be found. -
C:/ruby/lib/ruby/gems/1.8/gems/mysql-2.7.3-x86-mswin32/ext/mysql.so
(LoadError)
from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in
`require'
from test1.rb:4

I checked the locatins above and the mysql.so and custom_require.rb
files exist...not sure why it is giving the error...thanks in advance
for your help. I've attached screenshots incase it is helpful.

Ani

Attachments:
http://www.ruby-forum.com/attachment/5324/1-ruby.JPG
http://www.ruby-forum.com/attachment/5325/2-ruby.JPG
http://www.ruby-forum.com/attachment/5326/3-ruby.JPG
http://www.ruby-forum.com/attachment/5327/4-ruby.jpg


--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
Michael Brooks
Guest
Posts: n/a
 
      11-09-2010
"Ani T." <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi Ryan, Thanks for your post.
>
> I inserted "require 'rubygems'" and am now getting the following error:
> C:/ruby/lib/ruby/gems/1.8/gems/mysql-2.7.3-x86-mswin32/ext/mysql.so:
> 126: The specified module could not be found. -
> C:/ruby/lib/ruby/gems/1.8/gems/mysql-2.7.3-x86-mswin32/ext/mysql.so
> (LoadError)
> from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in
> `require'
> from test1.rb:4
>
> I checked the locatins above and the mysql.so and custom_require.rb
> files exist...not sure why it is giving the error...thanks in advance
> for your help. I've attached screenshots incase it is helpful.
>
> Ani


Hello Ani:

This might not make a difference but is the location of the "libmySQL.dll"
file (usually the mysql/bin folder) in your systems $PATH environment
variable. I haven't tried using MYSQL with Ruby but recently on Windows
Vista 64 when developing with Delphi XE I've noticed that the mysql dll
needs to be in the $PATH variable. In the old days I could drop that dll
into the application folder but that doesn't seem to work for me anymore so
you might be experiencing the same thing.

Michael

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
sequel problem: no such file to load -- mysql (LoadError) Michael Andreasen Ruby 7 09-22-2007 07:30 PM
"mysql.h: No such file or directory" when building MySQL-python francescomoi@europe.com Python 2 05-11-2005 03:12 PM
DBD:mysql doesn't read mysql option file /etc/my.cnf file JL Perl 0 01-28-2005 03:19 AM
Getting error: ..."in 'require': No such file to load -- socket (LoadError) Ruby Ruby Ruby 0 04-22-2004 12:34 PM



Advertisments