【问题标题】:Second Day in RoR, Having Trouble with Running Server在 RoR 的第二天,无法运行服务器
【发布时间】:2012-04-11 07:24:20
【问题描述】:

我在 Lion 上运行,10.7.3,Ruby 版本 1.9.3-p125 和最新版本的 Xcode。

当我尝试启动我的服务器时,我收到以下错误:

在可用的 gem 中找不到 gem 'rails (= 3.1.0) ruby​​' 这台机器。运行 bundle install 来安装缺失的 gem。

所以我尝试运行 bundle install 并收到以下错误:

Bundler could not find compatible versions for gem "actionpack":   In
snapshot (Gemfile.lock):
    actionpack (3.1.0.rc4)   In Gemfile:
    meta_search (= 1.1.0) ruby depends on
      actionpack (~> 3.1.0) ruby

Running `bundle update` will rebuild your snapshot from scratch, using
only the gems in your Gemfile, which may resolve the conflict.

然后我尝试运行捆绑更新,但收到以下错误:

安装mysql2(0.3.11)时出错,Bundler不能 继续。确保gem install mysql2 -v '0.3.11' 成功 在捆绑之前。

我已经完全被困了几个小时了......有人知道如何解决这个问题吗?

【问题讨论】:

  • 问题是你无法安装gem mysql2。你在运行gem install mysql2 -v '0.3.11' 时得到了什么?
  • 我收到以下错误:“由于某种原因,可能缺少必要的库和/或头文件,无法创建 Makefile。请查看 mkmf.log 文件了解更多详细信息。您可能需要配置选项。 "所以我检查了日志,发现:1个错误生成。检查的程序是: /* begin / 1: #include "ruby.h" 2: 3: /*top*/ 4: int main() {return 0;} 5: int t() { void (( *易失性 p)()); p = (void (()()))mysql_query;返回0; } /* 结束 */
  • 问题已解决:brew install mysql.更新和重新安装的包和服务器现在可以工作了。
  • 您可能希望将您的解决方案添加为答案并接受它以关闭此问题。
  • 你更新了什么?自制?捆绑器?

标签: ruby-on-rails ruby gemfile


【解决方案1】:

问题已解决:brew install mysql。更新和重新安装的包和服务器现在可以工作了。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-09-30
    • 2014-07-31
    • 2020-12-09
    相关资源
    最近更新 更多