Hello,
I need to install my application to a Windows server (using MSSQL as
the DB) and to make my life easier I am freezing the application. I
have been able to freeze rails and unpack all the gems I need
(including activerecord-sqlserver-adapter) except for one: ruby-odbc
I can install the gem the regular way, which DevKit builds correctly.
I can run the application with the gem “in the open”. Then when I
unpack the gem everything seems to work, I get the message “Unpacked
gem: C:/Pepe/Code/RoR/afm/vendor/gems/ruby-odbc-0.99992”, but after
I uninstall the ‘regular’ gem and try to start Mongrel:
C:\Pepe\Code\RoR\afm>ruby script/server
=> Booting Mongrel
=> Rails 2.3.5 application starting on http://0.0.0.0:3000
C:/Pepe/Code/RoR/afm/config/…/vendor/rails/railties/lib/rails/
gem_dependency.rb
:119:Warning: Gem::Dependency#version_requirements is deprecated and
will be rem
oved on or after August 2010. Use #requirement
The following gems have native components that need to be built
ruby-odbc = 0.99992
You’re running:
ruby 1.8.7.302 at C:/Ruby187/bin/ruby.exe
rubygems 1.3.7 at C:/Users/bob/.gem/ruby/1.8, C:/Ruby187/lib/ruby/
gems/1.8
Run rake gems:build
to build the unbuilt gems.
I then try to build:
C:\Pepe\Code\RoR\afm>rake gems:build
(in C:/Pepe/Code/RoR/afm)
rake aborted!
ERROR: Failed to build gem native extension.
C:/Ruby187/bin/ruby.exe extconf.rb
checking for version.h… no
checking for sql.h… no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
–with-opt-dir
–without-opt-dir
–with-opt-include
–without-opt-include=${opt-dir}/include
–with-opt-lib
–without-opt-lib=${opt-dir}/lib
–with-make-prog
–without-make-prog
–srcdir=.
–curdir
–ruby=C:/Ruby187/bin/ruby
–with-odbc-dir
–without-odbc-dir
–with-odbc-include
–without-odbc-include=${odbc-dir}/include
–with-odbc-lib
–without-odbc-lib=${odbc-dir}/lib
ERROR: sql.h not found
Gem files will remain installed in C:/Pepe/Code/RoR/afm/vendor/gems/
ruby-odbc-0.
99992 for inspection.
Results logged to C:/Pepe/Code/RoR/afm/vendor/gems/ruby-odbc-0.99992/
ext/gem_mak
e.out
(See full trace by running task with --trace)
I have even successfully installed the gem in the gems directory, just
in case it would work:
C:\Pepe\Code\RoR\afm\vendor\gems>gem install ruby-odbc -i C:\Pepe\Code
\RoR\afm\v
endor\gems
Temporarily enhancing PATH to include DevKit…
Building native extensions. This could take a while…
Successfully installed ruby-odbc-0.99992
1 gem installed
Installing ri documentation for ruby-odbc-0.99992…
Installing RDoc documentation for ruby-odbc-0.99992…
But it doesn’t:
C:\Pepe\Code\RoR\afm>ruby script/server
config.gem: Unpacked gem cache in vendor/gems has no specification
file. Run ‘ra
ke gems:refresh_specs’ to fix this.
config.gem: Unpacked gem cache in vendor/gems not in a versioned
directory. Givi
ng up.
config.gem: Unpacked gem doc in vendor/gems has no specification file.
Run ‘rake
gems:refresh_specs’ to fix this.
config.gem: Unpacked gem doc in vendor/gems not in a versioned
directory. Giving
up.
config.gem: Unpacked gem gems in vendor/gems has no specification
file. Run ‘rak
e gems:refresh_specs’ to fix this.
config.gem: Unpacked gem gems in vendor/gems not in a versioned
directory. Givin
g up.
config.gem: Unpacked gem specifications in vendor/gems has no
specification file
. Run ‘rake gems:refresh_specs’ to fix this.
config.gem: Unpacked gem specifications in vendor/gems not in a
versioned direct
ory. Giving up.
=> Booting Mongrel
=> Rails 2.3.5 application starting on http://0.0.0.0:3000
C:/Pepe/Code/RoR/afm/config/…/vendor/rails/railties/lib/rails/
gem_dependency.rb
:119:Warning: Gem::Dependency#version_requirements is deprecated and
will be rem
oved on or after August 2010. Use #requirement
The following gems have native components that need to be built
ruby-odbc = 0.99992
You’re running:
ruby 1.8.7.302 at C:/Ruby187/bin/ruby.exe
rubygems 1.3.7 at C:/Users/bob/.gem/ruby/1.8, C:/Ruby187/lib/ruby/
gems/1.8
Run rake gems:build
to build the unbuilt gems.
I am probably missing something obvious but I haven’t been able to
figure it out.
How can I unpack ruby-odbc correctly? Any clues?
Thanks in advance.