Preparation: Before installing it, I suggest you'd better install ruby, rails and MySQL at first. The installer package for ruby that I choose is rubyinstaller for windows version, you can download it from http://rubyinstaller.org. The process of installing is very simple, you only need to follow the wizard and do it(Notice: During installing, you must make sure the checkbox of Enable RubyGems option is checked. It's the default value):
After installing completed, you can open the command window and input the command line: Ruby –v. If the version of ruby can be displayed normally, it proved the installing was sucessful!(The installer would add the system path for ruby automatically. And my version of ruby is 1.8.6.)
Next, we should update Gem system. You can execute the command on the command windows: gem update –system; then we should execute the command "gem install -v=2.3.5 rails" to install Rails. After installed, you can execute the command "rails –v" to check the version of Rails.
Now, you need to install MySQL. Please pay attention to the version number of MySQL. It seams like the MySQL adapter that ruby provided is just for 5.0 version. The version of MySQL DB that I installed is 5.0.18 for windows. You can download it from MySQL official website. Here I omitted the process of installing for MySQL. If you want to verify whether the installing is sucessful, you might input the command line as below (Suppose the username and password all are "root"):
Then we need to install the gem for mysql. The gem I choosed is mysql-2.8.1-x86-mswin32.gem. After you fetch this file and save it in the installing directory for ruby(Suppose it is c:\ruby), you can switch the current directory to c:\ruby, and execute command line:
gem install mysql-2.8.1-x86-mswin32.gem
The system will give the result it showed "Sucessfully installed". But I don't know the specfic reason that the gem installer cann't install the related document and give the error message "No definition for …".
Now, we are going to install the RadRails plug-in, it is my topic of this article. The version of MyEclipse is 8.5. The installing steps are as below:
1. Start MyEclipse application, and choose "MyEclipse" menu, go to "MyEclipse Configuration Center" item.
2. Choose "Software" tag, and click the "add site" on the left side:
3. Input the name of site(The naming is up to you, I choose the name "Rails") and URL:
4. Now, the section which name is "Personal Site" emerges from the left side. There is the name of new site "Rails":
5. Click the site name, the system will connect to the URL and download the remoted data. It will last about one minute, then it will show the treeview structure of Rails-Aptana RadRails. Now you can click it, there should be show the message "Managed Changes:1 Change" in the Pending Changes section which locates in the bottom and right of the screen.
6. Click "Apply 1 Change" button, the system will validate the MyEclipse at first:
The process will progress slowly. It is very strange that it is normal at the beginning of update operation, but the error occurs frequently at the end of operation:
At this time, you must click "Back" button to back the dialog box, and click "update" button again, it will restart to update. It will skip the sucessful operation and repeat the wrong operation. Unfortunally, only one wrong operation can be corrected every time, the error diaglog box is popped up as ghost. I don't know how to handle this issue, the one way that I know is to repeat the process until it corrected all wrong operation. I try to find out the reason, but I failed. The error is not related to bandwidth of network.
This terrible process will be lasted for about two hours andsuccessful final. The system requires to restart MyEclipse.
After installing the plug-in, the system maybe notices the user to auto-install gems, the diagram is as below:
To validate whether the plug-in had been installed sucessfully, and integrated with ruby, rails and MySQL, we might create the sample project to check it. At first, we will change the view in MyEclipse into RadRails:
Then switch to the server window in MyEclipse, and start the server of Sample project(using WebRick server) with the default port number 3000. After server is running, you can open the explorer such as Internet Explorer or Firefox, and input the URL:http://localhost:3000:
Click the link "About your application's environment", if the information related to ruby can be display correctly, it proved the plug-in had been installed sucessfully and the development environment was prepared normally.