How To Put in Ruby on Rails Mysql2 Gem on Home windows 10

If you are not able to set up the MYSQL2 gem in Home windows, you want to down load the C-Header information from MYSQL. As opposed to other gems, MYSQL2 necessitates direct linking into some of the indigenous create information offered by the library. Except you have MYSQL installed now, it means you want to down load – and reference – this library from the Internet.

The issue is that given that the MYSQL2 gem necessitates specified information to help it connect to the Internet, the gem takes advantage of these to at create. The mistake you may receive will mention “Unsuccessful to create indigenous extensions”. This means your Home windows procedure did not have the header information necessary for the gem to be installed appropriately.

The way to solve this is to very first log onto the MYSQL site and seem for “C-Connector”. This is fundamentally the “driver” for MYSQL, enabling Home windows to simply call a quantity of pre-compiled features to help it talk with regional or external MYSQL installations. The goal of this down load is to be certain your laptop or computer has the needed information to set up the gem.

After you have uncovered the MYSQL C-Connector file, you want to down load it to your really hard generate. From this, unzip the file and put its contents on your really hard generate. You should place it in a route which has no areas, if not the installation reference will break. A route this kind of as C:/downloads/mysql-c-connector/information will perform great. Be sure to note you do NOT want to set up this – only down load the zipped archive, we can take out it after the gem has been installed.

If you have downloaded and placed the information on your really hard generate, you want to then set up the gem all over again. To do this, you ought to load up CMD and type the next command “gem set up mysql2 –platform=ruby — ‘–with-mysql-dir=”C:mysql-connector-route”‘”.

This command will reference the freshly installed MYSQL C-Connector library information which Ruby necessitates to create the gem. If you’ve downloaded / installed it appropriately, this ought to let Ruby to set up the necessary information and many others. If effective, the cmd will make clear the gem has been installed if not, it will most likely be that you have possibly downloaded the incorrect information OR you have not bought a further needed library installed on your procedure.

Considering the fact that Home windows will come with no external libraries, it really is needed to set up any necessary from the Internet. This is 1 of the motives most persons you should not like creating with Home windows – eventually, if you happen to be in a position to down load the appropriate header information, you ought to be great.

By Richard Peck

No Comments

Post A Comment