Ruby Install Mysql2 Gem Windows

No I don’t like working on Windows, but unfortunately my co-workers haven’t seen the light yet. To make the rails setup a bit easier I needed to document the installation of Ruby on Rails on Windows with a Mysql database. The description is about Ruby 1.9.?, Rails 3.0, Mysql 5.5 with the mysql2 gem. And a lot of gems that got installed and compiled via “bundle install” Here’s a raw extract of the document I build: 1. Install MySQL In our situation MySQL was installed.

But you should install MySQL with development files. (C++ headers and Libraries).

Just download the Community Server. Install Ruby Install the base Ruby version.

Recently I reinstalled by entire Windows installation due a SSD migration and wanted to take the opportunity to document the configuration process, specially in the light of the known issues with making it. Gem install mysql --platform=ruby -- --with-mysql-dir=C:/mysql-connector-c-noinstall-6.0.2-win32.

Download the installer at Run the installer and check the following items: • Add Ruby executables to your PATH • Associate.rb and.rbw files with this Ruby Installation 3. Install DevKit Because a lot of Ruby plugins make use of Native extensions you need a compiler.

Ruby Install Mysql2 Gem WindowsRuby Install Mysql2 Gem Windows

For windows there’s devkit to the rescue. Download it at rubyinstaller:. Extract this to (for example) c:/devkit (this text assumes this location) Open a command prompt: (cmd.exe) and enter the following commands. Cd c:/devkit ruby dk.rb init DevKit wil probably find your ruby installation.

But to make sure check the file c:/devkit/config.yml. It should contain the path of your Ruby installation: --- - C:/Ruby192 This step installs (or updates) an operating_system.rb file into the relevant directory needed to implement a RubyGems pre_install hook and a devkit.rb helper library file into lib ruby site_ruby. NOTE: you may need to use the –force option to update (with backup of the originals) the above mentioned files as discussed at the SFX DevKit upgrade FAQ entry.

Test the Devkit installation Confirm your Ruby environment is correctly using the DevKit by running. Gem install rdiscount --platform=ruby RDiscount should install correctly and you should see: Temporarily enhancing PATH to include DevKit in the screen messages. After this double check if it works by running: ruby -rubygems -e 'require 'rdiscount'; puts RDiscount.new('**Hello RubyInstaller**').to_html' to confirm that the rdiscount gem is working. (This should generate HTML) (More info: ) 4.

Install Git If you not already have installed git, please do it. You will like it! Git is required for many plugins so you need it. • download git at (choose a version I don’t know:P, the latest.exe?? ) • execute the installer, select the following options: • check “Run Git and included tools from the windows command prompt” (Select the option with the red letters that scream “don’t pick me”:P ) • checkout-as-is and commit-as-it. Install Rails with the mysql2 plugin Next install Ruby on Rails.

(We don’t install/generate the docs) gem install rails --no-ri --no-rdoc 6. Install the mysql2 gem To build mysql2 support do this: (Point the paths to your MySQL install directory!) NOTE: When using a 64bit version of windows you probably run into issues. Thanks for mentioning Luis! (Read more about it: ). Gem install mysql2 -- '--with-mysql-lib='c: Program Files MySQL MySQL Server 5.5 lib' --with-mysql-include='c: Program Files MySQL MySQL Server 5.5 include' (Mysql5.1 seems to have the path: c: Program Files MySQL MySQL Server 5.1 lib opt) Fix up Bundler (the gem management tool) to know what the mysql2 gem build settings need to be. Else you’re “bundle install” will fail when installing or updating the mysql2 gem!!

Bundle config build.mysql2 '--with-mysql-lib='c: Program Files MySQL MySQL Server 5.5 lib' --with-mysql-include='c: Program Files MySQL MySQL Server 5.5 include' As soon as you start using this installation you could get errors like ‘libmysql.dll not found. To solve this copy this file from the mysql-installation/lib directory to the ruby/bin directory. Slightly Unrelated, install the Rails app Pull the rails app from git. Vdo Cdr 2005 Keygen For Mac. (Or copy it).

And run bundler install to install all gems. Cd /rails/app bundle install I’ve recieved the following error when doing this: Resolving deltas: 100% (3434/3434), done. Checking out files: 100% (85/85), done. Fetching source index for Could not find devise-1.4.0 in any of the sources I seems that devise was updated and the specific version in Gemfile. Download Game Yu-gi-oh Pegasus The Illusion Mod. lock wasn’t available anymore.

You can Force the installation of this updated package bundle update devise These were my steps to build a working rails environment under windows Enough of windows, Now back to my Mac:P. I am getting an error like this $ rails generate exam index c:/Ruby193/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32/lib/mysql2/mysql2.rb:2:in `require’: 193:%1 is not a valid Win32 application.

Copy libmysql.dll from mysql lib dir (C: Program Files (x86) MySQL MySQL Server 5.6 lib) to ruby bin dir (C: RailsInstaller Ruby1.9.3 bin). Run below line from git bash (doesn't work from windows powershell ) gem install mysql2 -- '--with-mysql-lib='c: Program Files (x86) MySQL MySQL Server 5.6 lib' --with-mysql-include='c: Program Files (x86) MySQL MySQL Server 5.6 include' # for specific version gem install mysql2 -v=0.3.14 -- '--with-mysql-lib='c: Program Files (x86) MySQL MySQL Server 5.6 lib' --with-mysql-include='c: Program Files (x86) MySQL MySQL Server 5.6 include'.