刚开始ROR Lynda教程,在尝试执行rails服务器时出错

时间:2011-06-14 14:58:25

标签: mysql ruby-on-rails gem

刚刚启动ROR Lynda教程,尝试在终端中执行rails服务器时出错。

ROR新手。密切关注教程并安装所有必要的宝石和文件。创建一个简单的CMS。但是我遇到了以下错误。

$ rails server
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /Library/Ruby/Gems/1.8/gems/bundler-1.0.10/lib/bundler/shared_helpers.rb:3.
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /Library/Ruby/Gems/1.8/gems/bundler-1.0.10/lib/bundler/source.rb:162.
NOTE: Gem::SourceIndex#each is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#each called from /Library/Ruby/Gems/1.8/gems/bundler-1.0.10/lib/bundler/source.rb:162.
Could not find gem 'mysql2 (~> 0.2.6)' in any of the gem sources listed in your Gemfile.

我已经安装了MySQL服务器版本5.5.13。我有Rails版本3.我安装了MySQL(0.3.2)gem文件。任何帮助,将不胜感激。感谢

2 个答案:

答案 0 :(得分:1)

解决此问题的最佳方法是运行

gem pristine --all

这会重建宝石,应该为你解决错误。

答案 1 :(得分:0)

从错误中我发现很可能你的设置不对。您应该进行“捆绑检查”以查看是否已满足所有依赖项,我确信它们没有。如果你还没有完成'捆绑安装',你需要这样做,如果你已经这样做了,那么问题是捆绑器无法安装mysql2 gem版本0.2.6(必须在某处提到要么你在Gemfile中,要么以某种方式在Gemfile.lock中,以防你从其他地方得到它。所以你要么捆绑安装会修复它,如果没有,那么你应该做一个'捆绑更新mysql2'