如何使用mysql安装Ruby on Rails并使其正常运行,逐步指南? [英] How to install Ruby on Rails with mysql and get it working, a step by step guide?

查看:84
本文介绍了如何使用mysql安装Ruby on Rails并使其正常运行,逐步指南?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

前一段时间,我设法使RoR在Windows XP上运行. 我一直在尝试使其在Windows 7上运行2天,但没有办法,总是有一个问题,无论我如何尝试,谷歌都无法回答.

Some time ago I managed to get RoR working on Windows XP. I've been trying to get it working on Windows 7 for 2 days but there's just no way, there's always a problem, one that google can't answer, no matter what I try.

有人可以给我指南或其他方法以使其在Windows 7或XP上运行吗?即使是Ubuntu,但我还是不想再经历那个迷宫.

Can someone give me a guide or something to get it working on Windows 7 or XP ? Even Ubuntu but I'd rather not go through that maze again.

我认为我将在虚拟机上安装Windows XP并从那里开始.

I figure I'm going to install Windows XP on a virtual machine and start from there.

我需要RoR和mysql-什么版本,从哪里下载它们以及我应该采取什么步骤?

I need RoR and mysql - what versions, where do I download them from and what steps do I take ?

请注意,如何在Rails 3.0.7上安装mysql2(版本< 0.3)?因为它会自动尝试超过0.3的操作,而这在Rails 3.0.7上不起作用,并且如果我尝试使用0.2.7的gemfile捆绑把戏,那么我不知道如何指定配置选项,如果我不这样做,那么它将不起作用不要给它mysql lib的位置并包含目录.

On a side note, how do you install mysql2 (version < 0.3) on rails 3.0.7 ? Because it automatically tries something over 0.3 which doesn't work on rails 3.0.7 and if I try the gemfile bundle trick with 0.2.7 I don't know how to specify configuration options and of course it doesn't work if I don't give it the location of mysql lib and include directories.

我还尝试使用rails 3.1 beta,一切运行顺利,直到启动服务器并且网站永远不会在localhost:3000上加载.

Also I tried using rails 3.1 beta and everything goes smoothly until I start the server and the website never loads on localhost:3000.

推荐答案

这基本上就是我要在Windows 7上安装的内容:

This is basically what I do to install on Windows 7:

  • Download and install latest mysql from http://dev.mysql.com/downloads/mysql/
  • Install Ruby http://rubyinstaller.org/downloads/ (check the box to update PATH)
  • Install Ruby Devkit http://rubyinstaller.org/downloads/ (for example extract to C:\DevKit)
  • Setup Devkit

cd [MY_DEVKIT_INSTALL_DIR]

cd [MY_DEVKIT_INSTALL_DIR]

ruby​​ dk.rb初始化

ruby dk.rb init

ruby​​ dk.rb安装

ruby dk.rb install

将mysql/bin安装中的libmysql.dll复制到C:\ Ruby192 \ bin

Copy libmysql.dll from your mysql/bin install to C:\Ruby192\bin

gem安装导轨

gem安装mysql2 -v 0.2.6

gem install mysql2 -v 0.2.6

使用新的my_test_app -d mysql

rails new my_test_app -d mysql

这篇关于如何使用mysql安装Ruby on Rails并使其正常运行,逐步指南?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆