简体   繁体   English

在Mac OS X Lion上具有Ruby on Rails 3.2.0的MAMP 2.0.1

[英]MAMP 2.0.1 with Ruby on Rails 3.2.0 on Mac OS X Lion

This has been asked before, but I couldn't find a newer result than 2010. A lot can change in two years. 之前曾有人问过这个问题,但我找不到比2010年更新的结果。两年内可能会有很多变化。 The fact that it hasn't been asked since, makes me think, that maybe I'm missing something. 从那以后一直没有人问过这个事实,这让我想,也许是我缺少了一些东西。

So. 所以。 Is there an easy way, to setup Ruby On Rails 3.2.0 to work With MAMP PRO on Mac OS X Lion ? 在Mac OS X Lion上设置Ruby On Rails 3.2.0以便与MAMP PRO一起使用是否有一种简单的方法?

I found the solution for work with PHP with MAMP 2.0.5 and RAILS with two databases different for each. 我找到了使用MAMP 2.0.5和RAILS的PHP的解决方案,每个数据库都有两个不同的数据库。 PHP uses mysql from MAMP and RAILS a other database installed via Homebrew. PHP使用MAMP中的mysql,并通过Homebrew安装另一个数据库。

I use mac os lion 10.7.3 我使用Mac OS Lion 10.7.3

I explain how I did 我解释一下我是怎么做的

1-The first step is delete all. 1-第一步是全部删除。 Delete MAMP, MAMP PRO, the folders in applications (be carefully with your projects if they are in the MAMP folder) and all the mysql servers that you have installed. 删除MAMP,MAMP PRO,应用程序中的文件夹(如果项目位于MAMP文件夹中,请谨慎对待它们)以及已安装的所有mysql服务器。 (visit this link for how remove mysql from mac osx lion http://johnmcostaiii.net/2011/removing-mysql-osx-lion/ ) (访问此链接,了解如何从mac osx lion http://johnmcostaiii.net/2011/removing-mysql-osx-lion/删除mysql)

2-Install the lattest version of Xcode (via App Store) 2-安装最新版本的Xcode(通过App Store)

3-Install homebrew (https://github.com/mxcl/homebrew/wiki/installation) 3-安装自制软件(https://github.com/mxcl/homebrew/wiki/installation)

4-Install rvm and ruby 1.9.3. 4-安装rvm和ruby 1.9.3。 Follow the steps of quick start guide (http://beginrescueend.com/) 遵循快速入门指南(http://beginrescueend.com/)的步骤

5-Open a terminal and install mysql via homebrew 5-打开终端并通过自制软件安装mysql

brew install mysql

Read the installations of mysql notes (on terminal) and follow the steps. 阅读mysql注释的安装(在终端上)并按照步骤进行。 (create alias, password, start and initialize database, etc) (创建别名,密码,启动和初始化数据库等)

6- Say at rvm that uses the ruby version 1.9.3 6-说在使用红宝石版本1.9.3的rvm

rvm use 1.9.3

7- If you want, you can create a gemsets (explained at rvm webpage) and use it 7-如果需要,可以创建一个宝石集(在rvm网页上说明)并使用它

rvm gemset create "gemset_name"

use 1.9.3@gemset_name

8- Install rails 8-安装滑轨

gem install rails

9 - Create a app with mysql gems 9-使用mysql gem创建应用

rails new name_app -d mysql

And it works! 而且有效!

10 - Install MAMP PRO 2.0.5 10-安装MAMP PRO 2.0.5

11 - Test with any PHP page with database 11-使用数据库测试任何PHP页面

And it works! 而且有效!

(After install and run MAMP, I created a vhosts for try if all work fine, but the vhosts don´t work properly. I spent 1 hour searching a solution, but the solution for me was restart the computer finally ... and ... ) (在安装并运行MAMP之后,我创建了一个虚拟主机,以尝试一切正常,但是这些虚拟主机无法正常工作。我花了1个小时来寻找解决方案,但是对我来说,解决方案是最终重新启动计算机...和。 ..)

I hope that help you! 希望对您有所帮助! I lost many hours looking for the solution 我浪费了很多时间寻找解决方案

(I followed this steps with changes: http://www.frederico-araujo.com/2011/07/30/installing-rails-on-os-x-lion-with-homebrew-rvm-and-mysql/ ) (我按照以下步骤进行了更改: http : //www.frederico-araujo.com/2011/07/30/installing-rails-on-os-x-lion-with-homebrew-rvm-and-mysql/

edit: everytime you open the console and work with rails you must type in the console 编辑:每次打开控制台并使用滑轨时,都必须在控制台中键入

rvm use 1.9.3@gemset_name

or create a file with this command and save in the folder of your rails app with name 或使用此命令创建文件,并使用以下名称保存在Rails应用程序的文件夹中

.rvmrc

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM