Problem:
Railsinstaller does not contain the MySQL gem by default.
After installing and configuring the rails environment using railsinstaller, you will find that you cannot use the gem update -- system or other updates or install the remote gem install-remote MySQL command, the following error is reported: GEM: remotefetcher: fetcherror. Too many connections are reset.
Some people on the Internet say that the address is broken down. (Snwrking: I played the gem update -- system very successfully, and there was no problem with the wall ~ )
Solution:
1. Add the-p parameter after the operation.Example:
?
Function of parameters: Option (-P, -- [no-] HTTP-proxy [url]) use an "HTTP proxy for remote operations", which means a proxy connection is used.
Install MySQL
?
2. Use local installation:
Gem official address: http://rubygems.org/
Gem of mysql2: https://rubygems.org/gems/mysql/versions/2.8.1-x86-mingw32
List all installed gem commands:
gem query --local
Installation Method: Download The. Gem file, use CD to the directory where. Gem is located, and then execute the following command:
Gem install -- local filename. Gem
Or execute the command with the path name of the. Gem file.
Gem install -- local F:/Ruby/gem/filename. Gem
Note: This is an x86 version. All other versions of msyql or mysql2 are successfully installed. If a libmysql error is reported during the installation process, I just want to test this file under MySQL/bin to Ruby/bin.
3. Add other download resources:
First, view the gem running environment through gem Env.
?
Add two updated source addresses:
?
gem sources -a http://gems.github.com gem sources -a http://gems.rubyforge.org
|
4. If the gem of MySQL is installed, an error is reported during use:
The libmysql. dll file that requires 6.0 compilation is downloaded. Yes: http://www.mysql.com/downloads/connector/c/
Download the package and put it in the ruby/bin directory. (Snwrking: Do not download the install version of Windows. Download the ZIP Archive version and decompress it in the lib directory .)
Reprinted Source: http://www.cnblogs.com/tambor/archive/2011/12/25/Ruby_gem_Windows_mysql.html