How Do I Correct mysql.rb Drivers? - mysql

For the last several days, I've been struggling to get ruby on rails to work on my mac. The main culprit is MySQL. Every time I fix one thing, another error shows up. I upgraded/downgraded MySQL to play nice with ruby, rail and gems, but nothing. My latest error is:
!!! The bundled mysql.rb driver has been removed from Rails 2.2. Please install the mysql gem and try again: gem install mysql.
/!\ FAILSAFE /!\ Wed Aug 05 21:09:23 -0700 2009
Status: 500 Internal Server Error
dlopen(/usr/local/lib/ruby/site_ruby/1.8/i686-darwin9.7.0/mysql.bundle, 9): Library not loaded: /usr/local/mysql/lib/libmysqlclient.16.dylib...
I don't have libmysqlclient.16.dylib; just *.15.dylib. Tried all the techniques, even installed or tried to install ruby-mysql-0.2.6 posted at tmtm.org
FYI: Last error prior to the one stated above had to do with authentication.
Appreciate any help.

Well, this question is a bit old already, but since I got here after getting the same error (but on LINUX), I would like to post my solution for future reference.
I simply had to install ruby-mysql.i686
yum install ruby-mysql.i686
Hope it helps somebody else in the future... tnx

Have you installed Xcode Developer tools? You can download it for free at http://developer.apple.com/.
Whenever I have issues with Ruby and MySQL, I never had Xcode installed. Could be wrong.

Answering my own question.
I don't know why and I don't know how, but took #Garrett's advice and re-installed Xcode. That didn't do anything. Went ahead and upgraded MySQL after that, which I had done before, and voilá! it worked. I'm guessing both re-installations finally got it working somehow. Weird!

Try using the below command . Provide the location of the mysql directory in your Mac .
sudo gem install mysql -- --with-mysql-dir= /usr/local/mysql
It looks like you haven't specified the location of mysql directory .
Good luck !

Related

Installing mysql through terminal

I am having some issues getting sql to work when trying to set my rails project. I have the latest version of both ruby and rails, the issue I believe lies within my terminal PATH. When typing gem install mysql, I get the following error:
ERROR: While executing gem ... (Errno::EACCES) Permission denied #
rb_sysopen -
/Users/myName/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/mysql-2.9.1/COPYING.
And when echoing my PATH I get the following description:
/Users/myName/.rbenv/shims:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
This is a messed up path, and yes I have specified the PATH I want in the .bash_profile. My desired path looks like this:
export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH" It just doesn't seem to work. Any ideas of what I am doing wrong? Running Sierra on a Macbook Pro 2015.
Thanks in advance for the help!
That error doesn't look like anything to do with your $PATH, which looks OK. It seems that you're trying to write to /Users/myName/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/mysql-2.9.1/COPYING but don't have permission. Maybe you installed something as root, and now root owns the gem files.
My guess is you need to fix the ownership of your .rbenv directory.
Try sudo chown -R myName /Users/myName/.rbenv, or if you want to be more rigorous, ls -l /Users/myName/.rbenv and see what the permissions look like before fixing whichever need it.
Managed to solve the issue with the help of this thread: brew install mysql on mac os. And with using my brain a bit more and installing the lated command tools... Hope this can help someone else who may have forgotten Xcodes part in it all.

Error with MySQL Instalattion in Centos 6.4

I'm trying to install MySQL in my CentOS 6.4 (X86_64) with the command:
"yum install mysql mysql-server"
And I'm having problems with the installation, the error presented is the following:
Check the error log in the following link http://pastie.org/10022423
Any Idea why this error ? thanks for you helps!
The problem is you already have a version of some MySQL packages installed that are from a different distribution/vendor than CentOS.
Since different people created the packages using different names and standards, yum does not know how to fix this situation.
You have libmysqlclient16-5.1.69-1.w6.x86_64 installed already providing the client libraries, but the CentOS package is mysql-libs. This package appears to be provided by "webtatic":
https://webtatic.com/packages/mysql55/
http://rpm.pbone.net/index.php3/stat/4/idpl/21966562/dir//com/libmysqlclient16-5.1.69-1.w6.x86_64.rpm.html
Likely you need to consider removing the libmysqlclient package and installing mysql-libs in it's place. That will probably remove some items because of dependencies, you might be able to get away with manually removing it with the rpm --nodeps -e, but it may also be the packages cannot have their dependency satisfied by mysql-libs so slightly risk move if you don't fully check everything first. This often works, though.
As an alternative looks like you can install the mysql server package from webtatic as well, based on their instructions here, that might be a less complex alternative if you are happy to continue relying on their repository:
https://webtatic.com/packages/mysql55/
As far that I know, that error will shows up when you attempt to install packages that already have been installed before. So, you probably should reinstall your mysql.
Source : https://www.centos.org/docs/5/html/5.1/Deployment_Guide/s3-rpm-conflicting-files.html

MySQL Ruby Gem installation error

I can't install the MySQL gem. I know this is a very common error but I have searched and tried everything I could. I have been trying to fix it for more than a week and I am very frustrated. I am working on Windows 7 64-bit machine.
I have tried this: http://blog.mmediasys.com/2011/07/07/installing-mysql-on-windows-7-x64-and-using-ruby-with-it/
And moving the libmysql.dll to the bin folder of the ruby installation and still no success.
I also tried 64 bit and 32 bit versions.
I would love to get this problem out of the way to actually start learning...
I will answer as fast as possible to provide any information you need.
Thank you very much, whoever solves it will be my hero!
EDIT: Here is the error I am getting. It is very common.
http://imgur.com/wx9rEJX
EDIT: FIXED
I ended up using:
gem install mysql2 --platform=ruby -- '--with-mysql-dir="C:\mysql-connector"'
And this time it worked! I hope this can help anyone with this problem.
Source

How to get NetBeans 7.4, Ruby and MySQL to play together (on Windows)

The tags say it all, really. This is a project that used to work on earlier versions, but not now. If you know the answer, just stop reading and tell me how.
An existing project is working fine on older releases of NetBeans and MySQL. I am just trying to get it working on the latest release of everything. Nothing fancy. Just plain vanilla Ruby on Rails on Windows/MySQL.
Clean install of Netbeans 7.4. No problems.
Clean full install of MySQL 5.5. No problems. Includes Java connector.
Clean install of ruby and rails from community: http://plugins.netbeans.org/plugin/38549. No problems.
Everything is working just fine.
Webrick starts and runs. Absolutely no surprises to this point.
I tried to gem install MySQL: it fails, but it is not unexpected. I have no interest in pursuing that line. Ditto for MySQL 2. It's always hard building native libraries on Windows.
I tried to gem install all/any of the following:
* activerecord-jdbc-adapter
* activerecord-jdbcmysql-adapter
* jdbc-mysql
They install just fine, but the end point is always the same:
cannot load com.mysql.jdbc.Driver.
I think I know what this means, but I have no idea how to fix it. Is it a classpath problem? Is it a bug? Is it an incompatibility just about to be fixed? Is it because I'm using Windows? Who knows? I can't think of anything else to try, and the forums are full of these errors with no solutions that seem to fit my problem.
I am not sure, but maybe the blog post Installing MySQL on Windows 7 x64 and using Ruby with it will help.

Mysql-dev for mac os

I'm installing sphinx for my macbook pro but I failed when I ran "sudo make", it generate the following error.
error: mysql.h: No such file or directory.
I navigate throw the web searching for a solution & the solution was to setup mysql-devel.
The new problem is that I can't find it for mac?? what shall I do?
You can use the Fink package management system to install mysql-dev. There is some getting started information here for fink. It may seem like a roundabout way to get things installed but in the long term it will pay dividends.
Good luck,
Chris