Issues Installing Ruby and Rails and Devkit on Windows 7 X64 - Fix Needed

Issues installing Ruby and Rails and DevKit on windows 7 x64 - fix needed

Seems you installed Ruby (along the DevKit?) inside a directory with spaces.

As indicated during Ruby own installer, path with spaces are not recommended (that is why default is C:\Ruby193

GCC, the compiler that is part of DevKit, has problems with path with spaces, so installation of DevKit is also recommended to be placed in a path without spaces (e.g. C:\DevKit)

All this is mentioned in both RubyInstaller and DevKit installation instructions page

Trouble with ruby Development Kit

Installing the dev kit in a directory with spaces is a source of trouble.

Don't use C:/Program Files but another directory, e.g. C:/ProgramFiles or C:/bin ...

See also

  • Issues installing Ruby and Rails and DevKit on windows 7 x64 - fix needed
  • Bundle command not found. Bad Interpreter

Rails on windows - install issue

From the output shown above, I assume the following:

  • Installed Ruby 2.0.0 x64 (64bits)
  • Installed some DevKit from RubyInstaller page

Now, as explained here, for 64bits Ruby you need 64bits DevKit.

From the error in the output:


make: x86_64-w64-mingw32-gcc: Command not found

It is clear you didn't install the right DevKit.

Please remove the DevKit installed, download the correct one (as indicated in the link above and in RubyInstaller downloads page) and install again.

You will require to use ruby dk.rb install --force (note the --force option) to override the previous DevKit installation.

As for the the deprecation error, --include-dependencies is no longer required. I recommend you use as installation reference a modern Ruby/Rails guide.

installing ruby with mysql2 on windows 7 64 bit returns error on rails s

Basically following the instructions in here
I just completed an installation from zero to fully functional on Windows 7 64bit.

In your case the problem may lie in the version of the gem mysql2 or in the manner in which it was installed; you could start with uninstall and re-install the 0.2.6 version @see Gediminas answer and check the GemFile if you have a different version.
This save me from troubles with specific:

--with-mysql-dir=.... --with-mysql-lib=.... --with-mysql-include=....


Anyway I will detail each steps of my checklist so you can see if there are differences to your installation

  • Installed mysql-installer-community-5.6.24.0.msi from http://dev.mysql.com/downloads/mysql/
    In my personal checklist
    these are my selected component:
    MySQL-Install-OptionSelected
    .. my choice for connectivity options:
    Sample Image
    .. and account/security option:
    Sample Image

  • Installed Ruby rubyinstaller-2.1.6.exefrom http://rubyinstaller.org/downloads/

Notice: according to http://rubyinstaller.org/downloads/ I select the 2.1.* ( not the last one) and I downloaded the standard 32-bit version because the 64-bit versions of Ruby are relatively new on the Windows area and not all the packages have been updated to be compatible with it. To use this version you will require some knowledge about compilers and solving dependency issues, which might be too complicated if you just want to play with the language. Also reading on the same page
: Ruby 2.0.0 and above -->: mingw64-32-4.7.2

  • Installed Ruby Devkit DevKit-mingw64-32-4.7.2-20130224-1151-sfx.exe from http://rubyinstaller.org/downloads/ (extracted to C:\DevKit)
  • Don't forget to setup the DevKit
cd C:\DevKit 
ruby dk.rb init
ruby dk.rb install
devkitvars.bat
  • Don't forget to copy libmysql.dll in my case, after installing mysql community 5.6 i found three different dll ( in dimension) with the same name:
cd \
find . -name "libmysql.dll"
./Program Files/MySQL/MySQL Connector.C 6.1/lib/libmysql.dll
./Program Files/MySQL/MySQL Server 5.6/lib/libmysql.dll
./Program Files/MySQL/MySQL Workbench 6.2 CE/libmysql.dll``

Definitively i choose this option:

C:>cd C:\Ruby21\bin>
C:\Ruby21\bin> copy "\Program Files\MySQL\MySQL Server 5.6\lib\libmysql.dll" .
1 file(s) copied.
  • I had some issue installing gems therefore i decided to update rubigems, this helps me a lot.
C:\Ruby21\bin>gem update --system
...
[snip]
...
C:\Ruby21\bin>gem env
RubyGems Environment:
- RUBYGEMS VERSION: 2.4.6
- RUBY VERSION: 2.1.6 (2015-04-13 patchlevel 336) [i386-mingw32]
- INSTALLATION DIRECTORY: C:/Ruby21/lib/ruby/gems/2.1.0
- RUBY EXECUTABLE: C:/Ruby21/bin/ruby.exe
- EXECUTABLE DIRECTORY: C:/Ruby21/bin
- SPEC CACHE DIRECTORY: C:/Users/rondadev/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: C:/ProgramData
- RUBYGEMS PLATFORMS:
- ruby
- x86-mingw32
- GEM PATHS:
- C:/Ruby21/lib/ruby/gems/2.1.0
- C:/Users/rondadev/.gem/ruby/2.1.0
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- C:\DevKit\bin
- C:\DevKit\mingw\bin
- C:\Ruby21\bin
- C:\Windows\system32
- C:\Windows
- C:\Windows\System32\Wbem
- C:\Windows\System32\WindowsPowerShell\v1.0\
- C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\
- C:\Program Files\Microsoft SQL Server\110\Tools\Binn\
- C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\
- C:\Program Files (x86)\MySQL\MySQL Fabric 1.5.4

ready to install rails and create the first application:

gem install rails

gem install mysql2 -v 0.2.6

rails new test_app -d mysql

At the end the last steps:

  1. connected MySQL Workbench and created a new schema named
    test_app_development (to create a new schema you can press the 4th icon in the tool bar with a cylinder and a plus sign ..see next screenshot)

  2. fixed username and password in config/database.yml as in sansarp
    anwser
    Sample Image

  3. Migrated the database

MySQL Workbench and database migration
after migrate your schema should look like this:
Sample Image


  1. executed rails -s

  2. successfully opened in the browser http://localhost:3000

```

C:\Projects\test_app>rake db:migrate --trace
DL is deprecated, please use Fiddle
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Invoke db:load_config (first_time)
** Execute db:load_config
** Execute db:migrate
** Invoke db:_dump (first_time)
** Execute db:_dump
** Invoke db:schema:dump (first_time)
** Invoke environment
** Invoke db:load_config
** Execute db:schema:dump

C:\Projects\test_app>rails s
DL is deprecated, please use Fiddle
=> Booting WEBrick
=> Rails 4.2.1 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
[2015-04-29 00:20:21] INFO WEBrick 1.3.1
[2015-04-29 00:20:21] INFO ruby 2.1.6 (2015-04-13) [i386-mingw32]
[2015-04-29 00:20:21] INFO WEBrick::HTTPServer#start: pid=4144 port=3000

Started GET "/" for ::1 at 2015-04-29 00:20:34 +0200
Processing by Rails::WelcomeController#index as HTML
Rendered C:/Ruby21/lib/ruby/gems/2.1.0/gems/railties-4.2.1/lib/rails/templates
/rails/welcome/index.html.erb (0.0ms)
Completed 200 OK in 31ms (Views: 15.6ms | ActiveRecord: 0.0ms)

Ruby Devkit install error on Windows

The DevKit script looks at some Registry Keys that were set during a RubyInstaller installation.

When you removed the other Ruby installations you just deleted them instead of using the uninstaller that came with RubyInstaller. That left the Registry Keys as dangling pointing at deleted registrations.

A registry cleanup tool might be able to pick them and fix it for you, if not you may have to manually clean it up yourself.

Ruby on rails devkit windows

The error is that you added C:/Ruby192/include/ruby-1.9.1 to the list of Ruby installations.

By default dk.rb will not find that and actually that is not a valid path.

Please ensure config.yml contains just this:

- C:/Ruby192

The dash is important

Once you do that, try ruby dk.rb install again.



Related Topics



Leave a reply



Submit