Forum: Ruby Install fcgi-ruby for Apache on Windows Xp

Posted by Javier Abaroa (gorkimaximum)
on 2010-03-09 11:13
Hello

I need some help with gem fcgi-ruby-0.8.8. I have tried to create from
the source rubygem, but in Windows Xp, always i get a lot of errors and
the process is aborted.

I have tried also to make a direct install of the gem, but always i get
an error about the "Ruby Native Extensions". This is a common error that
i have also obtained when i have tried to install other extensions like
"Sqlite3" and "Ruby-Postgres".

My question is?. Is there any way to obtain the correct native
extensions and compile fcgi and other extensions without obtain this
error?.

My OS is Windows-Xp SP3 and my Web Server Apache 2.2.14. I have
installed also Mingw and Msys, if it were an alternative way to compile
the modules i have mentioned.

Thank you.

Javier Abaroa
Posted by Luis Lavena (luislavena)
on 2010-03-09 13:55
(Received via mailing list)
On Mar 9, 11:13 am, Javier Abaroa <gamh03122...@hotmail.com> wrote:
>
> My question is?. Is there any way to obtain the correct native
> extensions and compile fcgi and other extensions without obtain this
> error?.
>
> My OS is Windows-Xp SP3 and my Web Server Apache 2.2.14. I have
> installed also Mingw and Msys, if it were an alternative way to compile
> the modules i have mentioned.
>
> Thank you.
>

Please provide more information about the ruby version you're using.
More precisely, if you're using downloads from ruby-lang, from old One-
Click Installer or the newer RubyInstaller project.

"ruby -v" output will be helpful.

Also, if you're using 1.8 or 1.9 versions of Ruby, as it is unknown to
me if fcgi-ruby extension is compatible with Ruby 1.9.

As you see, that information is required to actually help you.

Please include also the gem installation output: gem install xxx --
debug -V
Posted by Brian Candler (candlerb)
on 2010-03-09 14:02
Javier Abaroa wrote:
> I need some help with gem fcgi-ruby-0.8.8

I believe the gem is called 'fcgi': gem install fcgi
(at least it was when I installed it a couple of days ago :-)

To install the C native version will require a C compiler and the fcgi 
development kit version 2.4.0, available from www.fastcgi.com, which 
you'll also have to compile.

However I seem to remember that fcgi has a 'pure ruby' implementation 
too. I don't know how you'd tell 'gem install' not to attempt to build 
the C version. It may be easier just to install fcgi directly from the 
source bundle:
http://rubyforge.org/frs/?group_id=926&release_id=42628
Posted by Javier Abaroa (gorkimaximum)
on 2010-03-10 12:13
Hi,

Thanks for your help. I have downloaded and compiled the development kit 
fastcgi-2.4.0 , and i have seen that it contains the fcgiapp.h source 
that i need to compile ruby-fcgi-0.8.9. The problem is that when i try 
to install (gem install ruby-fcgi-0.8.9 --remote), i get the following 
error:

C:\fcgi\include>gem install ruby-fcgi --remote
Building native extensions.  This could take a while...
ERROR:  Error installing ruby-fcgi:
        ERROR: Failed to build gem native extension.

C:/Ruby19/bin/ruby.exe extconf.rb
checking for fcgiapp.h... no
checking for fastcgi/fcgiapp.h... no

make
make: *** No rule to make target `/usr/include/ruby-1.9.1/ruby.h', 
needed by `fcgi.o'.  Stop.


Gem files will remain installed in 
C:/Ruby19/lib/ruby/gems/1.9.1/gems/ruby-fcgi-0.8.9 for inspection.
Results logged to 
C:/Ruby19/lib/ruby/gems/1.9.1/gems/ruby-fcgi-0.8.9/ext/fcgi/gem_make.out

C:\fcgi\include>gem uninstall ruby-fcgi
ERROR:  While executing gem ... (Gem::InstallError)
    cannot uninstall, check `gem list -d ruby-fcgi`

C:\fcgi\include>gem uninstall ruby-fcgi-0.8.9
ERROR:  While executing gem ... (Gem::InstallError)
    cannot uninstall, check `gem list -d ruby-fcgi-0.8.9`

C:\fcgi\include>

I have set the route to fcgiapp.h in my path environment variables, but 
the rubygems can't find it. Also would be an error in the Makefile, 
because of the "/usr/include/ruby-1.9.1", as my Ruby Directory is 
"c:/Ruby19".

Thanks a lot.

Javier Abaroa.

Brian Candler wrote:
> Javier Abaroa wrote:
>> I need some help with gem fcgi-ruby-0.8.8
> 
> I believe the gem is called 'fcgi': gem install fcgi
> (at least it was when I installed it a couple of days ago :-)
> 
> To install the C native version will require a C compiler and the fcgi 
> development kit version 2.4.0, available from www.fastcgi.com, which 
> you'll also have to compile.
> 
> However I seem to remember that fcgi has a 'pure ruby' implementation 
> too. I don't know how you'd tell 'gem install' not to attempt to build 
> the C version. It may be easier just to install fcgi directly from the 
> source bundle:
> http://rubyforge.org/frs/?group_id=926&release_id=42628
Posted by Brian Candler (candlerb)
on 2010-03-10 12:33
Javier Abaroa wrote:
> make
> make: *** No rule to make target `/usr/include/ruby-1.9.1/ruby.h', 
> needed by `fcgi.o'.  Stop.

Then you need *ruby's* development header files as well.

If this were an Ubuntu box, I'd say install the package ruby1.8-dev or 
whatever.

However I don't know how you'd do it on Windows. You'd have to find out 
where your Windows install came from, and whether they offer the header 
files as a separate package.

> Also would be an error in the Makefile, 
> because of the "/usr/include/ruby-1.9.1", as my Ruby Directory is 
> "c:/Ruby19".

It could be a hard-coded assumption, although it should be using 
rbconfig to find the files where they were built. What happens if you do 
this in IRB?

>> require 'rbconfig'
=> true
>> Config::CONFIG['includedir']
=> "/usr/include"

If you see "/usr/include" then the person who built your ruby built it 
with that as the system header directory.

If you can't work out how to do this (and remember I'm not a Windows 
user so I can't help you much), I'd say your best option is to use the 
pure-ruby fcgi library. This is simply lib/fcgi.rb inside the gem. You 
can see that it tries to load fcgi.so, and if that fails, just builds 
the FCGI class from ruby code.
Posted by Javier Abaroa (gorkimaximum)
on 2010-03-10 13:19
The execution in IRB was:

require 'rbconfig'
=> true
>> Config::CONFIG['includedir']
=> "c:/ruby19/include"

But when i try to install gem ruby-fcgi-0.8.9 the Makefile generate a 
full of errors. Even, is configurated for i486-linux. So i think, it's 
no possible do a good configuration for Windows. Only if you hard coded 
Makefile on hand.

Thank you.

Brian Candler wrote:
> Javier Abaroa wrote:
>> make
>> make: *** No rule to make target `/usr/include/ruby-1.9.1/ruby.h', 
>> needed by `fcgi.o'.  Stop.
> 
> Then you need *ruby's* development header files as well.
> 
> If this were an Ubuntu box, I'd say install the package ruby1.8-dev or 
> whatever.
> 
> However I don't know how you'd do it on Windows. You'd have to find out 
> where your Windows install came from, and whether they offer the header 
> files as a separate package.
> 
>> Also would be an error in the Makefile, 
>> because of the "/usr/include/ruby-1.9.1", as my Ruby Directory is 
>> "c:/Ruby19".
> 
> It could be a hard-coded assumption, although it should be using 
> rbconfig to find the files where they were built. What happens if you do 
> this in IRB?
> 
>>> require 'rbconfig'
> => true
>>> Config::CONFIG['includedir']
> => "/usr/include"
> 
> If you see "/usr/include" then the person who built your ruby built it 
> with that as the system header directory.
> 
> If you can't work out how to do this (and remember I'm not a Windows 
> user so I can't help you much), I'd say your best option is to use the 
> pure-ruby fcgi library. This is simply lib/fcgi.rb inside the gem. You 
> can see that it tries to load fcgi.so, and if that fails, just builds 
> the FCGI class from ruby code.
Posted by Javier Abaroa (gorkimaximum)
on 2010-03-10 13:34
The first problem is that i can't find the fcgiapp.h or 
fastcgi/fcgiapp.h that i think are header files that managed the native 
extensions.They are in the include folder of the fastcgi-2.4.0 kit, but 
the gem install don't found them.

I have compiled fastcgi-2.4.0, and i have obtained the "cgi-fcgi.exe" 
and "libfcgi.dll", but perhaps, i haven't installed the files correctly 
and the rubygems install procedure can't find it.Perhaps this would be 
the problem.

The documentation of fastcgi-2.4.0 says how to compile the source, but 
not how to set the folders an install these on Windows environment.

Thank you.

Javier Abaroa.

Javier Abaroa wrote:
> The execution in IRB was:
> 
> require 'rbconfig'
> => true
>>> Config::CONFIG['includedir']
> => "c:/ruby19/include"
> 
> But when i try to install gem ruby-fcgi-0.8.9 the Makefile generate a 
> full of errors. Even, is configurated for i486-linux. So i think, it's 
> no possible do a good configuration for Windows. Only if you hard coded 
> Makefile on hand.
> 
> Thank you.
> 
> Brian Candler wrote:
>> Javier Abaroa wrote:
>>> make
>>> make: *** No rule to make target `/usr/include/ruby-1.9.1/ruby.h', 
>>> needed by `fcgi.o'.  Stop.
>> 
>> Then you need *ruby's* development header files as well.
>> 
>> If this were an Ubuntu box, I'd say install the package ruby1.8-dev or 
>> whatever.
>> 
>> However I don't know how you'd do it on Windows. You'd have to find out 
>> where your Windows install came from, and whether they offer the header 
>> files as a separate package.
>> 
>>> Also would be an error in the Makefile, 
>>> because of the "/usr/include/ruby-1.9.1", as my Ruby Directory is 
>>> "c:/Ruby19".
>> 
>> It could be a hard-coded assumption, although it should be using 
>> rbconfig to find the files where they were built. What happens if you do 
>> this in IRB?
>> 
>>>> require 'rbconfig'
>> => true
>>>> Config::CONFIG['includedir']
>> => "/usr/include"
>> 
>> If you see "/usr/include" then the person who built your ruby built it 
>> with that as the system header directory.
>> 
>> If you can't work out how to do this (and remember I'm not a Windows 
>> user so I can't help you much), I'd say your best option is to use the 
>> pure-ruby fcgi library. This is simply lib/fcgi.rb inside the gem. You 
>> can see that it tries to load fcgi.so, and if that fails, just builds 
>> the FCGI class from ruby code.
Posted by Brian Candler (candlerb)
on 2010-03-10 13:45
Javier Abaroa wrote:
> The first problem is that i can't find the fcgiapp.h or 
> fastcgi/fcgiapp.h that i think are header files that managed the native 
> extensions.They are in the include folder of the fastcgi-2.4.0 kit, but 
> the gem install don't found them.

You could try

set CPPFLAGS=-I/path/to/dir
set LDFLAGS=-L/path/to/lib

If you're going to do this sort of stuff, I suggest you don't install 
using rubygems. Rather, use the setup.rb which comes inside the fcgi 
source tarball.

Googling for "ruby fcgi windows" turns up some interesting stuff, such 
as
http://www.napcsweb.com/howto/rails/deployment/railsonIISWithApacheFCGI.pdf
although it doesn't address how to get fcgi installed for Windows. I 
guess they are just using the pure-ruby version.

Finally: if you're installing a 0.8.9 version, that's someone's fork. 
The "official" fcgi is 0.8.8 (the one on rubyforge.org anyway). You 
could try contacting whoever forked the code for help.
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.