2008-09-03 50 views
7

這是交易。如何在OS X 10.5.4下安裝mysql ruby​​ gem

$寶石--version

1.1.0

$ sudo的創業板安裝MySQL的 - --with-mysql的-配置=在/ usr /本地/ MySQL的/斌/ mysql_config

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

$ sudo的寶石更新

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

我試過thisthisthisthis,和其他許多人。

他們都沒有爲我工作。有其他人有這個問題嗎?如果是的話你做了什麼來解決上面沒有提到的問題?

回答

3

步驟1

gem update --system 

它可能不會提供修復本身,而是你真的的RubyGems 1.2。它可以爲你節省大約8天的時間,因爲它不需要做大量更新102304寶石的垃圾

它實際上看起來好像根本找不到mysql gem,更不用說下載或安裝它。你不是在代理服務器的後面,或者是這樣的奇怪嗎?

如果它的東西與你的RubyGems或淨,而不是專門的mysql,那麼創業板更新--system應揭露太

0

你的系統上有不同Ruby版本?如果你正在運行Darwin提供的ruby二進制文件,但是在/ usr/local下安裝了ruby gems,那麼你會得到這樣的錯誤。即使你已經用ruby指向/ usr/local,如果你的shell的$ PATH沒有正確解析正確的ruby二進制文件,那麼gem命令可能會失敗。另外,如果/ usr/local/bin位於路徑中的/ usr/bin之後,那麼gem將使用/ usr/bin/ruby​​從/Library/Ruby/Gems/1.8/gems/加載gems。您可能希望將/usr/lib/ruby/gems/1.8/gems鏈接到/Library/Ruby/Gems/1.8/gems/以防止出現這種情況。

6

首先,Orion Edwards說確保你有rubygems 1.2。不幸的是,

gem update --system

沒有爲我工作。

相反,我只好:

  1. 手動從RubyForge下載的rubygems-update-1.2.0
  2. $ sudo的創業板安裝/path/to/rubygems-update-1.2.0.gem
  3. $ update_rubygems

既然有了RubyGems的1.2我跑

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

一切工作。感謝Orion Edwards將我引向正確的方向。

0

瑞安格魯夫的回答一個blog post

sudo env ARCHFLAGS="-arch i386" gem install mysql -- \ 
    --with-mysql-dir=/usr/local/mysql --with-mysql-lib=/usr/local/mysql/lib \ 
    --with-mysql-include=/usr/local/mysql/include 
0

安裝XCode的解決了這個問題對我來說。

這是因爲它包含make和gcc工具,它們是gem所必需的。