In this article, I read "Creating a Ruby on Rails Development Environment on Mac OS X" and sorted it out following his steps. The content is basically the same, and some images are added. If you want to see the original content, please refer to the blog of the repair team here.
To install Ruby on Rails on Mac, you must first install mamp, which is a package of Apache, MySQL, and PHP. The installation process is very simple. You can directly double-click the installation package to open the installation interface.
Drag the mamp folder to the Applications folder and you will have mamp installed. There is also an mamp control. wdgt in the installation folder. Double-click this file to install the mamp control in the dashboard, so that you can control the mamp startup and stop from the dashboard.
There are not many items that mamp can set. From the main interface, it looks like it is very easy to stop starting Apache, MySQL services and open the preset.
Click the "preset" button to open the preset. Basically, I have not changed anything.
Well, now Apache and MySQL services have been started. Let's take a look at what the first page looks like.
Next, you need to install locomotive. Locomotive is a packaged Ruby on Rails suite. After installation, you can start to develop the Ruby on Rails program.
Click + in the lower left corner of the locomotive main interface to add a new service, specify the application name and the path of the website root directory (the path here is irrelevant to the root directory of the Apache website in the mamp ), then you can see the application name in the list. Click Run in the upper left corner to run the application. Right-click the application and select "preview in Browser" from the drop-down menu. This is simple. You can see that your first Ruby on Rails application is missing. Another important function is open terminal, which allows you to quickly enable the terminal to switch to the Application Path. Then, execute the generate and migrate commands.