If you can not set up the MYSQL2 gem in Windows, you wish to have to obtain the C-Header information from MYSQL. Unlike different gemstones, MYSQL2 calls for direct linking into one of the most local construct information supplied by way of the library. Unless you’ve gotten MYSQL put in already, it approach you wish to have to obtain – and reference – this library from the Internet.
The drawback is that because the MYSQL2 gem calls for positive information to lend a hand it hook up with the Internet, the gem makes use of those to at construct. The error you can obtain will point out “Failed to build native extensions”. This approach your Windows device didn’t have the header information required for the gem to be put in appropriately.
The option to unravel that is to first log onto the MYSQL site and search for “C-Connector”. This is principally the “driver” for MYSQL, permitting Windows to name various pre-compiled purposes to lend a hand it keep in touch with native or exterior MYSQL installations. The function of this obtain is to make sure your pc has the essential information to put in the gem.
Once you’ve gotten discovered the MYSQL C-Connector document, you wish to have to obtain it for your arduous pressure. From this, unzip the document and position its contents on your arduous pressure. You will have to put it in a direction which has no areas, another way the set up reference will damage. A direction similar to C:/downloads/mysql-c-connector/information will paintings effective. Please be aware you do NOT wish to set up this – best obtain the zipped archive, we will be able to take away it after the gem has been put in.
If you’ve gotten downloaded and positioned the information on your arduous pressure, you wish to have to then set up the gem once more. To do that, you will have to load up CMD and sort the next command “gem install mysql2 –platform=ruby — ‘–with-mysql-dir=”C:mysql-connector-path”‘”.
This command will reference the newly put in MYSQL C-Connector library information which Ruby calls for to construct the gem. If you have got downloaded / put in it appropriately, this will have to permit Ruby to put in the specified information and many others. If a hit, the cmd will provide an explanation for the gem has been put in; if now not, it’s going to most probably be that you’ve both downloaded the flawed information OR you haven’t were given every other essential library put in on your device.
Since Windows comes without a exterior libraries, it is essential to put in any required from the Internet. This is without doubt one of the causes the general public do not like growing with Windows – in the end, in case you are in a position to obtain the proper header information, you will have to be effective.