Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I install the mysql ruby gem under OS X 10.5.4

Tags:

mysql

ruby

gem

Here is the deal.

$ gem --version

1.1.0

$ sudo gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config

Bulk updating Gem source index for: http://gems.rubyforge.org/ ERROR: could not find mysql locally or in a repository

$ sudo gem update

Updating installed gems Bulk updating Gem source index for: http://gems.rubyforge.org/

Updating RedCloth ERROR: While executing gem ... (Gem::GemNotFoundException) could not find RedCloth locally or in a repository

I've tried this, this, this, this, and a ton of others.

None of them have worked for me. Is anyone else having this problem? If so what did you do to fix it that is not mentioned above?

like image 534
mk. Avatar asked Sep 03 '08 03:09

mk.


People also ask

How do I install a specific version of a ruby gem?

Use `gem install -v` You may already be familiar with gem install , but if you add the -v flag, you can specify the version of the gem to install. Using -v you can specify an exact version or use version comparators.

How do I download RubyGems?

Open up the 'Software Center' app from your launcher and type in `RubyGems` without quotes into the application search box at the top right, and press [enter]. RubyGems then can be installed by just clicking on the button labeled 'Install', thats it.

Where are RubyGems stored Mac?

By default, binaries installed by gem will be placed into: /usr/local/lib/ruby/gems/3.1. 0/bin You may want to add this to your PATH.

Does RubyGems come with Ruby?

Ruby comes with RubyGems by default since version 1.9, previous Ruby versions require RubyGems to be installed by hand.


2 Answers

First of all as Orion Edwards said make sure you have rubygems 1.2. Unfortunately,

gem update --system

did not work for me.

Instead I had to:

  1. Manually download rubygems-update-1.2.0 from rubyforge.
  2. $ sudo gem install /path/to/rubygems-update-1.2.0.gem
  3. $ update_rubygems

Now that I had rubygems 1.2 I ran

$ sudo gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config

Everything is working. Thanks Orion Edwards for steering me in the right direction.

like image 193
mk. Avatar answered Sep 21 '22 14:09

mk.


Step 1

gem update --system

It probably won't provide the fix itself, but You really want rubygems 1.2. It will save you about 8 days waiting as it doesn't need to do the 'Bulk updating 102304 gems' rubbish any more

It actually looks like it can't find the mysql gem at all, let alone download or install it. You're not behind a proxy server or something weird like that?

If it's something to do with your rubygems or the net, rather than mysql specifically, then the gem update --system should reveal it too

like image 37
Orion Edwards Avatar answered Sep 22 '22 14:09

Orion Edwards