From: Paul Scholes Date: 2011-09-27T22:09:35+09:00 Subject: Ruby mysql gem works but I see an exception when I execute the script with debug option using -d $DEBUG. --001517592bfc88be9704adebfc79 Content-Type: text/plain; charset=ISO-8859-1 Hello, I have got some CGI scripts. I use mysql connection and queries in these scripts. After seeing some anomalies in the scripts I wanted to execute them using ruby debug options. Here, below, a small test script that shows the problem. Without debug options, there is nothing, no error, I can connect to database and run queries but when I use debug option ( -d $DEBUG ) it throws an exception. Interesting thing is, even there is exception, it works, it connects to database. It is fresh Ubuntu 11.04 install. Details are below. Any idea ? What is the problem ? How can I fix it ? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *rvm -v:* rvm 1.8.4 by Wayne E. Seguin (wayneeseguin@gmail.com) [ https://rvm.beginrescueend.com/] *ruby -v:* ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-linux] *gem -v:* 1.8.10 *gem list:* * LOCAL GEMS * mysql (2.8.1) mysql2 (0.3.7) rake (0.9.2) *ruby dbtest.rb:* 14701920 *ruby -d $DEBUG dbtest.rb:* Exception `LoadError' at /home/mehmet/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36 - no such file to load -- mysql 11340120 *more dbtest.rb:* #!/home/mehmet/.rvm/rubies/ruby-1.9.2-p290/bin/ruby require 'rubygems' require 'mysql' connection = Mysql.new("localhost", "root", "deneme123", "mymarket") puts connection.object_id ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Cheers, --- --001517592bfc88be9704adebfc79--