Ultimate configuration for Ruby Development Environment (railsinstaller1.3.0 + mysql-5.1.61)

Source: Internet
Author: User
Tags deprecated mysql client

1. Install railsinstaller1.3.0

Packages included are:

    • Ruby1.8.7-p352
    • Rails3.0.7
    • Git1.7.3.1
    • SQLite3.7.3
    • Tinytds0.4.5
    • SQL Server Support3.0.14
    • Devkit

After successful installation, you can use ruby-V to view the version number. In addition, the environment variables in this place can be configured or not matched, without any impact. However, if you want to run the. RB file under the command line without adding ruby before. RB, you need to set the default open method of the. RB file to Ruby.

2. Install the mysql-5.1.61, see the installation method http://www.cnblogs.com/huzhiwei/archive/2012/02/22/2363811.html

After installation, use MySQL-u root-P to check whether the installation is successful.

3. Connect Ruby to MySQL

Method 1:

This step is the most troublesome and prone to problems. In the previous log, we have provided solutions for ruby1.9.2 and mysql5.5 (for new versions, refer to the previous log ).

Install MySQL gem (this step is the same as above)

After installing MySQL, if your ruby does not support the MySQL Driver (Integrated instant rails already exists), you need to install the MySQL driver in ruby.

GemInstall MySQL

This will install the mysql-2.7.3-mswin32.gem on. It should be noted that this driver supports Ruby 1.8, and currently there is no 1.9 compatible gem on Windows (mswin32) (mysql-ruby-2.8x already supports 1.9, however, if the compiled gem does not appear, you need to compile it by yourself-and the entire compilation will be very painful ).

Mysql-2.8.1-mswin32.gem was released on, which supports Ruby 1.9.

After the installation is complete, the following error occurs when require 'mysql' is called under IRB: loaderror: no such file-MySQL. Then you need to download and install ruby-mysql at http://www.tmtm.org/en/ruby/mysql/

Install
 
# Ruby./install. Rb

At this time, the error will change, which is:

 
Client does not support Authentication Protocol requested by server; consider upgrading MYSQL client.

Use either of the following methods

1:

Mysql> set password for->

'Some_user'

 
@

'Some_host'

 
= Old_password (

'Newpwd'

 
);

Second:

 
Mysql> Update mysql. User SET Password = old_password ('Newpwd')-> Where host ='Some_hostAnd user ='Some_user'; Mysql> flush privileges;

Instance: mysql> set password-

> Root @ localhost = old_password ('Newpwd');After the configuration is completed, there is no problem running. However, I don't know why the output version number is not correct, but there is no problem with database operations, so I will not study it any more. In addition, this configuration will not contain questions about http://www.cnblogs.com/huzhiwei/archive/2012/02/27/2425423.html.

 
Method 2:
 
Connect to the database through DBI.
 
DBI module installation can refer to: http://www.cnblogs.com/huzhiwei/archive/2012/02/27/2369789.html
 
After installation is complete, use the IRB command require 'dbi' to check whether the installation is correct. I encountered the following problems:
 
Question 1:GEMS/1.8/specifications/tilt-1.3.3.gemspec]: Invalid date format in specification: "00:00:00. 000000000z"
 
Solution:

Search "spec" files in your ruby Directory :*C: \ ruby187 \ Lib \ Ruby \ gems \ 1.8 \ specifications *

If a gemspec file contains something like this: S. Date = % q {2011-10-1300:00:00. 000000000z} Then delete00:00:00. 000000000zPart: S. Date = % q {2011-10-13}

After saving those gemspec files, the problem is solved.

Question 2:RB: 57: Undefined method 'describecate' for DBI: Date: Class (nomethoderror)

Solution: because of the version, I installed the old deprecated-2.0.1.gem by night, but the problem is still not resolved, so I installed the deprecated-3.0.0.gem, the problem still exists, but I just solved the problem by uninstalling the deprecated-3.0.0.gem. I feel that this solution is speechless.

Question 3: When DBH = DBI. Connect ("DBI: mysql: My (database): localhost", "root", "password") is executed, an error is returned:DBI. RB: 300: In 'Load _ Driver ': Unable to load driver 'mysql'

Solution: download an old version of libmysql. dll from the Internet, put it in the ruby bin directory, and execute gem install DBD-MySQL.

:

Http://instantrails.rubyforge.org/svn/trunk/InstantRails-win/InstantRails/mysql/bin/libmySQL.dll

You can also download it from here:

Libmysql

The above are the problems encountered in the configuration process. I feel that there are a lot of problems with the configuration of these development software. This is still not a development issue. It is quite unpleasant, but it is still fortunate to solve all the problems.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.