Rails Install fcgi on my mac - ruby-on-rails

I'm using Rails 3.2 and ruby 1.9.2. I've added gem 'fcgi' (fastcgi) to my Gemfile, but when I run bundle install it fails on the fcgi.
output:
Installing fcgi (0.9.1) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/Users/johndcowan/.rvm/rubies/ruby-1.9.2-p318/bin/ruby extconf.rb
checking for fcgiapp.h... no
checking for fastcgi/fcgiapp.h... no
make
make: *** No targets. Stop.
Gem files will remain installed in /Users/johndcowan/.rvm/gems/ruby-1.9.2-p318/gems/fcgi- 0.9.1 for inspection.
Results logged to /Users/johndcowan/.rvm/gems/ruby-1.9.2-p318/gems/fcgi-0.9.1/ext/fcgi/gem_make.out
An error occured while installing fcgi (0.9.1), and Bundler cannot continue.
Make sure that `gem install fcgi -v '0.9.1'` succeeds before bundling.
Installing fcgi (0.9.1) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/Users/johndcowan/.rvm/rubies/ruby-1.9.2-p318/bin/ruby extconf.rb
checking for fcgiapp.h... no
checking for fastcgi/fcgiapp.h... no
make
make: *** No targets. Stop.
Gem files will remain installed in /Users/johndcowan/.rvm/gems/ruby-1.9.2-p318/gems/fcgi-0.9.1 for inspection.
Results logged to /Users/johndcowan/.rvm/gems/ruby-1.9.2-p318/gems/fcgi-0.9.1/ext/fcgi/gem_make.out
An error occured while installing fcgi (0.9.1), and Bundler cannot continue.
Make sure that `gem install fcgi -v '0.9.1'` succeeds before bundling.
Then, I ran the gem install as suggested:
johns-MacBook-Pro:drywall johndcowan$ sudo gem install fcgi -v '0.9.1'
Fetching: fcgi-0.9.1.gem (100%)
Building native extensions. This could take a while...
ERROR: Error installing fcgi:
ERROR: Failed to build gem native extension.
/Users/johndcowan/.rvm/rubies/ruby-1.9.2-p318/bin/ruby extconf.rb
checking for fcgiapp.h... no
checking for fastcgi/fcgiapp.h... no
make
make: *** No targets. Stop.
Gem files will remain installed in /Users/johndcowan/.rvm/rubies/ruby-1.9.2-p318/lib/ruby/gems/1.9.1/gems/fcgi-0.9.1 for inspection.
Results logged to /Users/johndcowan/.rvm/rubies/ruby-1.9.2-p318/lib/ruby/gems/1.9.1/gems/fcgi-0.9.1/ext/fcgi/gem_make.out
johns-MacBook-Pro:drywall johndcowan$
I found a user with the same problem and he/she installed fcgi_devel using yum which solved his/her problem with fcgi. I tried instaling using port but it won't work. The same site said I do not need yum.
sudo port install fcgi-devel
Error: Port fcgi-devel not found
Any ideas?

If using Homebrew, try brew install fastcgi first.

Related

Mina deploy a rails project failed"Gem::Ext::BuildError: ERROR: Failed to build gem native extension."

I use the mina to deploy a rails web app,but always have many error.
This is part of my mina's logs
Using mini_magick (4.5.1)
Installing pg (0.18.4)
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /var/www/sample_app/shared/bundle/ruby/2.3.0/gems/pg-0.18.4/ext
/usr/bin/ruby2.3 -r ./siteconf20160917-1997-acaacj.rb extconf.rb
Cannot allocate memory - /usr/bin/ruby2.3 -r ./siteconf20160917-1997-acaacj.rb extconf.rb 2>&1
Gem files will remain installed in /var/www/sample_app/tmp/build-14740431655892/vendor/bundle/ruby/2.3.0/gems/pg-0.18.4 for inspection.
Results logged to /var/www/sample_app/tmp/build-14740431655892/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/pg-0.18.4/gem_make.out
An error occurred while installing pg (0.18.4), and Bundler cannot continue.
Make sure that `gem install pg -v '0.18.4'` succeeds before bundling.
! ERROR: Deploy failed.
-----> Cleaning up build
Unlinking current
OK
Connection to IP closed.
! Command failed.
Failed with status 1 (4864)
I noticed Cannot allocate memory but I use top keep watch on the memory,only use about 50%(total 1G),and I am already run gem install pg -v '0.18.4',install pg succeed. I can use gem listfind it.
How to fix it?Thanks

Error installing bcrypt using bundle install

I am going to install some gems in my rails application using bundle install on Debian testing(stretch). I get this error:
Installing bcrypt 3.1.10 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/usr/bin/ruby2.1 extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h
extconf failed, exit code 1
Gem files will remain installed in /tmp/bundler20151208-29851-hg3bi3bcrypt-3.1.10/gems/bcrypt-3.1.10 for inspection.
Results logged to /tmp/bundler20151208-29851-hg3bi3bcrypt-3.1.10/extensions/x86_64-linux/2.1.0/bcrypt-3.1.10/gem_make.out
An error occurred while installing bcrypt (3.1.10), and Bundler cannot continue.
Make sure that `gem install bcrypt -v '3.1.10'` succeeds before bundling.
but I have installed bcrypt and bcrypt-ruby using gem install .
For gems with C extensions to compile, you'll need to install the ruby-dev package:
$ sudo apt-get install ruby-dev

Rails bundle failing while installing atomic

I'm just getting into ruby on rails, And I'm setting it up on a second windows computer.
I've used the most recent 'railsinstaller' using rails: 4.0.0 and ruby: 2.0.0p195
when I run rails new <project name> Rails creates the project but fails on the bundle step with the following error.
Installing atomic (1.1.14)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
D:/RailsInstaller/Ruby2.0.0/bin/ruby.exe extconf.rb
creating Makefile
Gem files will remain installed in D:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/atomic-1.1.14 for inspection.
Results logged to D:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/atomic-1.1.14/ext/gem_make.out
An error occurred while installing atomic (1.1.14), and Bundler cannot continue.
Make sure that `gem install atomic -v '1.1.14'` succeeds before bundling.
I've tried a few things I've found on google such as updating gem and ruby but none of that worked... I'm too new to rails to figure this out myself, does anyone know what might be the problem?
EDIT
the outcome of gem install atomic -v '1.1.14'
D:\Programming\Ruby>gem install atomic -v '1.1.14'
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ConEmu blocks ANSICON injection
The system cannot find the file D:\ansicon\ansicon-master\ansicon.exe.
ERROR: Error installing atomic:
ERROR: Failed to build gem native extension.
D:/RailsInstaller/Ruby2.0.0/bin/ruby.exe extconf.rb
creating Makefile
Gem files will remain installed in D:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/atomic-1.1.14 for inspection.
Results logged to D:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/atomic-1.1.14/ext/gem_make.out
Thanks,
Peter McKinney

bson 2.0.0.rc2 gem installing under windows cmd fails

I'm trying to use ruby+rails under windows cmd.exe, everything is now fine except bundle doesn't install one gem:
<...>
Using sass (3.2.11)
Using bootstrap-sass (2.3.1.3)
Using bootstrap-select-rails (1.3.0.1)
Installing bson (2.0.0.rc2)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension
.
C:/Ruby200-x64/bin/ruby.exe extconf.rb
creating Makefile
make "DESTDIR="
generating native-x64-mingw32.def
compiling native.c
native.c:17:23: fatal error: arpa/inet.h: No such file or directory
compilation terminated.
make: *** [native.o] Error 1
Gem files will remain installed in C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bson-
2.0.0.rc2 for inspection.
Results logged to C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bson-2.0.0.rc2/ext/bso
n/gem_make.out
An error occurred while installing bson (2.0.0.rc2), and Bundler cannot
continue.
Make sure that `gem install bson -v '2.0.0.rc2'` succeeds before bundling.
What am I doing incorrect?

Error while creating rails new app project

Can't overcome problem. Everytime i generating new rails project on windows get the massage:
Installing json (1.6.5) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
C:/Ruby193/bin/ruby.exe extconf.rb
C:/Ruby193/bin/ruby.exe: No such file or directory -- extconf.rb (LoadError)
Gem files will remain installed in C:/Ruby193/lib/ruby/gems/1.9.1/gems/json-1.6.5
for inspection.
Results logged to C:/Ruby193/lib/ruby/gems/1.9.1/gems/json-1.6.5/ext/json/ext/parser/gem_make.out
An error occured while installing json (1.6.5), and Bundler cannot continue.
Make sure that `gem install json -v '1.6.5'` succeeds before bundling.
i've tried instal json but without lack... I've manage to instal json_pure. But still get this error. 'ruby dk.rb init' not worked too
For building native extensions on Windows, you need to install DevKit. It gives you a Unix-like environment and compilers.

Resources