The error tells you that the call in line 11 is wrong. In the code, it attempts to pass in 4 arguments, but the actual function requires no argument. You need to check on that line. Also, it seems that the line is calling line 95 in the code. I am guessing that line 95 is the function prototype (def ....) which should tell you exactly how the function should be called.
Taywin
Posting Maven
2,633 posts since Apr 2010
Reputation Points: 275
Solved Threads: 376
Skill Endorsements: 17
OK... Just downloaded the code and look at it. The error in line 95 occurs because it call the function generate_js_border_overlay. Then, the problem is actually from line 11 where it attempts to create mysql using mysql module. Do you have module mysql installed? The one under ruby library folder.
When ruby creates a definition, it also expect the same number of argument passing to the function. If it mismatches the number, ArgumentError exception will be thrown.
Using irb won't help in this case because you need 3 modules - rubygems, mysql, and geo_ruby. If you have them, try to type require 'mysql' in the irb to see if you have the gem installed correctly. By the way, do you have all those gems? Try 'gem -v' to see if you have ruby gem installed. Then try 'gem list --local' to see what you have. In your gem, you must have both mysql and geo_ruby gems.
That's all I can think of right now...
Taywin
Posting Maven
2,633 posts since Apr 2010
Reputation Points: 275
Solved Threads: 376
Skill Endorsements: 17
Hmm... I don't have the access to the code I have coded in Ruby that use another type of database connection class... Then you could hack the code and change it to another database connection class of your choice... Are you in hurry of this? I may not be able to get back until Monday for the code...
Taywin
Posting Maven
2,633 posts since Apr 2010
Reputation Points: 275
Solved Threads: 376
Skill Endorsements: 17
OK, I would want you try this...
# change the line 11
borderDB = Mysql::new('localhost', 'root', '', 'my_database')
# to
borderDB = Mysql.real_connect('localhost', 'root', '', 'my_database')
By the way, the script use 'root' user to access without password. If you have a password for 'root', you must give the password there.
Taywin
Posting Maven
2,633 posts since Apr 2010
Reputation Points: 275
Solved Threads: 376
Skill Endorsements: 17
Hmm... Do you have the MySQL server installed? You still need the real MySQL in your computer. Only gems won't actually work. Here is the API of the MySQL your script may need. I used it to do the work for storing certain stuff I search from the Internet to the database for me. I remember that using MySQL::new created certain problem and people would not use it anymore. The script you gave looks out-dated too. :(
Taywin
Posting Maven
2,633 posts since Apr 2010
Reputation Points: 275
Solved Threads: 376
Skill Endorsements: 17
I hope you get it to work. I just checked my Linux box and it doesn't have mysql gem in it; however, I can still use 'require mysql'. Yet, you may not need to uninstall the gem but rather install the MySQL to your computer. :)
Taywin
Posting Maven
2,633 posts since Apr 2010
Reputation Points: 275
Solved Threads: 376
Skill Endorsements: 17
If the installation includes the MySQL libraries that ruby is looking for, it should be able to find it. I am guessing that the way MAMP installs the MySQL is not the way ruby can see the library. You may try to reinstall MySQL and see how it work? :)
Taywin
Posting Maven
2,633 posts since Apr 2010
Reputation Points: 275
Solved Threads: 376
Skill Endorsements: 17