我 rake 时出现段错误 (Ruby on Rails)

发布于 2024-10-09 18:17:26 字数 1271 浏览 2 评论 0原文

编辑:这是解决方案(以防下面链接的线程消失):

  1. 安装 ruby​​ 1.8.6(从 1.8.7 开始)
  2. gem install Rails -v=2.3.8 (和之前一样)
  3. gem install mysql (版本 2.8.1, 和之前一样)
  4. http://instantrails.rubyforge.org/svn/trunk/InstantRails-win/InstantRails/mysql/bin/libmySQL.dll 并将其存放在 Ruby186/bin 中。 (之前,我从 Mysql/bin 复制了 libmysql.dll 文件。)

当我尝试使用为 mysql (不是 sqlite3)配置的 database.yml 文件进行 rake db:migrate 时,出现以下段错误错误:

C:/Ruby187/lib/ruby/1.8/benchmark.rb:306: [BUG] 分段错误 ruby 1.8.7 (2010-12-23 patchlevel 330) [i386-mingw32]

我已经看过这个线程: Ruby on Rails Rake 错误并且没有看到任何帮助。*** 看来我的 Rails 应用程序配置正确,因为当我运行 rake db:create< /code>,rails 成功创建了database.yml 中为开发环境指定的mysql 模式(或返回“模式已存在”消息)。

我猜想我的 mysql 配置不正确,但 rake db:create 可以在它上面工作的事实让我不这么认为。我已经在另外三台机器上成功设置了rails和mysql(一起工作);我不知道这个有什么问题。

红宝石 v.1.8.7 - Rails v.2.3.8 - Mysql v. 5.1.54

***发布该帖子的用户表示,他通过 aptana 上的帖子解决了该问题。然而,该帖子的链接指向主页,因此答案线程似乎已被移动或删除。

EDIT: Here's the solution (in case the thread linked to below disappears):

  1. Install ruby 1.8.6 (down from 1.8.7)
  2. gem install rails -v=2.3.8 (same as before)
  3. gem install mysql (version 2.8.1, same as before)
  4. Download libmysql.dll from http://instantrails.rubyforge.org/svn/trunk/InstantRails-win/InstantRails/mysql/bin/libmySQL.dll and deposit it in Ruby186/bin. (Before, I had copied over the libmysql.dll file from Mysql/bin.)

When I attempt rake db:migrate with the database.yml file configured for mysql (not sqlite3) I get the following segfault error:

C:/Ruby187/lib/ruby/1.8/benchmark.rb:306: [BUG] Segmentation fault
ruby 1.8.7 (2010-12-23 patchlevel 330) [i386-mingw32]

I have already looked at this thread: Ruby on Rails Rake Error and don't see any help there.*** It appears that my rails app is configured correctly because when I run rake db:create, rails successfully creates the mysql schema dictated for the development environment in database.yml (or returns a "schema already exists" message).

I'd guess I had mysql configured incorrectly, but the fact that rake db:create works on it makes me think otherwise. I have successfully set up rails and mysql (working together) on three other machines; I don't know what the problem is on this one.

Ruby v. 1.8.7 -
Rails v. 2.3.8 -
Mysql v. 5.1.54

***The user who posted that thread indicated that he solved the problem thanks to a post on aptana. The link to that post, however, points to the home page, so the answer thread appears to have either been moved or removed.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

时光沙漏 2024-10-16 18:17:26

我发现最后一步使用 instantrails dll 解决了我在 Win 7 x64 上的问题,无需更改 ruby​​ 或 Rails 版本。

ruby -v
ruby 1.9.2p290 (2011-07-09) [i386-mingw32]

rails -v
Rails 3.2.0

gem search mysql
mysql (2.8.1 x86-mingw32)

I found that the last step, using the instantrails dll, solved my problem on Win 7 x64 without my having to change ruby or rails versions.

ruby -v
ruby 1.9.2p290 (2011-07-09) [i386-mingw32]

rails -v
Rails 3.2.0

gem search mysql
mysql (2.8.1 x86-mingw32)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文