How To Install Ruby on Rails Mysql2 Gem on Windows 10

If you cannot install the MySQL2 gem in Windows, you require to download and install the C-Header data from MySQL. Unlike various other treasures, MYSQL2 needs straight connecting right into several of the indigenous develop data given by the collection. Unless you have actually MYSQL set up currently, it implies you require to download and install – as well as referral – this collection from the Internet.

The trouble is that given that the MYSQL2 gem needs specific data to assist it link to the Internet, the gem utilizes these to at develop. The mistake you'll obtain will certainly state "Failed to build native extensions". This implies your Windows system did not have the header data needed for the gem to be set up properly.

The means to fix this is to initial log onto the MySQL web site as well as try to find "C-Connector". This is essentially the "driver" for MYSQL, enabling Windows to call a variety of pre-compiled features to assist it connect with neighborhood or outside MYSQL installments. The objective of this download is to guarantee your computer system has the essential data to install the gem.

Once you have actually discovered the MySQL C-Connector documents, you require to download it to your hard disk drive. From this, unzip the documents as well as location its components on your hard disk drive. You needs to place it in a course which has no rooms, or else the setup referral will certainly damage. A course such as C: / downloads / mysql-c-connector / data will certainly function penalty. Please note you do NOT require to install this – just download and install the whized archive, we can eliminate it after the gem has actually been set up.

If you have actually downloaded and install as well as put the data on your hard disk drive, you require to after that install the gem once more. To do this, you must fill up CMD as well as kind the adhering to command "gem install mysql2 –platform = ruby ​​- '–with-mysql-dir =" C: mysql-connector-path "'".

This command will certainly reference the freshly set up MySQL C-Connector collection data which Ruby needs to develop the gem. If you've downloaded / mounted it properly, this must enable Ruby to install the needed data etc. If effective, the cmd will certainly clarify the gem has actually been set up; otherwise, it will likely be that you have either downloaded and install the inaccurate data OR you have actually not obtained an additional essential collection set up on your system.

Since Windows includes no outside collections, it's essential to install any kind of needed from the Internet. This is among the factors many people wear't like creating with Windows – eventually, if you're able to download and install the right header data, you must be great.

Source by Richard Peck

Leave a Reply

Your email address will not be published. Required fields are marked *