Mac Martine
2012-Dec-06 19:48 UTC
Unicorn fails to install even though it''s already installed and running
I''m deploying a Rails 3.2.8 app to Ubuntu. The server already runs the
app with Unicorn and Nginx.
unicorn -v returns unicorn v4.4.0
Adn rvm gem list shows:
unicorn (4.4.0)
Yet when I manually run ''gem install unicorn ''4.4.0''
it fails with the following. Any ideas why?
Installing unicorn (4.4.0)
** [out :: mydomain.net] with native extensions
** [out :: mydomain.net]
** [out :: mydomain.net] Gem::Installer::ExtensionBuildError: ERROR: Failed
to build gem native extension.
** [out :: mydomain.net]
** [out :: mydomain.net] /home/eg/.rvm/rubies/ruby-1.9.3-p194/bin/ruby
extconf.rb
** [out :: mydomain.net] checking for SIZEOF_OFF_T in ruby.h... ***
extconf.rb failed ***
** [out :: mydomain.net] Could not create Makefile due to some reason,
probably lack of
** [out :: mydomain.net] necessary libraries and/or headers. Check the
mkmf.log file for more
** [out :: mydomain.net] details. You may need configuration options.
** [out :: mydomain.net]
** [out :: mydomain.net] Provided configuration options:
** [out :: mydomain.net] --with-opt-dir
** [out :: mydomain.net] --with-opt-include
** [out :: mydomain.net] --without-opt-include=${opt-dir}/include
** [out :: mydomain.net] --with-opt-lib
** [out :: mydomain.net] --without-opt-lib=${opt-dir}/lib
** [out :: mydomain.net] --with-make-prog
** [out :: mydomain.net] --without-make-prog
** [out :: mydomain.net] --srcdir=.
** [out :: mydomain.net] --curdir
** [out :: mydomain.net]
--ruby=/home/eg/.rvm/rubies/ruby-1.9.3-p194/bin/ruby
** [out :: mydomain.net]
/home/eg/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:381:in
`try_do'': The compiler failed to generate an executable file.
(RuntimeError)
** [out :: mydomain.net] You have to install development tools first.
** [out :: mydomain.net] from
/home/eg/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:491:in `block in
try_compile''
** [out :: mydomain.net] from
/home/eg/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:443:in
`with_werror''
** [out :: mydomain.net] from
/home/eg/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:491:in
`try_compile''
** [out :: mydomain.net] from
/home/eg/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:686:in
`macro_defined?''
** [out :: mydomain.net] from
/home/eg/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:822:in `block in
have_macro''
** [out :: mydomain.net] from
/home/eg/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:790:in `block in
checking_for''
** [out :: mydomain.net] from
/home/eg/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:284:in `block (2
levels) in postpone''
** [out :: mydomain.net] from
/home/eg/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:254:in
`open''
** [out :: mydomain.net] from
/home/eg/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:284:in `block in
postpone''
** [out :: mydomain.net] from
/home/eg/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:254:in
`open''
** [out :: mydomain.net] from
/home/eg/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:280:in
`postpone''
** [out :: mydomain.net] from
/home/eg/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:789:in
`checking_for''
** [out :: mydomain.net]
** [out :: mydomain.net] from
/home/eg/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:821:in
`have_macro''
** [out :: mydomain.net] from extconf.rb:4:in `<main>''
** [out :: mydomain.net]
** [out :: mydomain.net]
** [out :: mydomain.net] Gem files will remain installed in
/rails_apps/eg/production/shared/bundle/ruby/1.9.1/gems/unicorn-4.4.0 for
inspection.
** [out :: mydomain.net] Results logged to
/rails_apps/eg/production/shared/bundle/ruby/1.9.1/gems/unicorn-4.4.0/ext/unicorn_http/gem_make.out
** [out :: mydomain.net]
** [out :: mydomain.net] An error occurred while installing unicorn
(4.4.0), and Bundler cannot continue.
** [out :: mydomain.net] Make sure that `gem install unicorn -v
''4.4.0''` succeeds before bundling.
Here''s the content from what I _think_ is the relevant mkmf.log
have_macro: checking for SIZEOF_SIZE_T in ruby.h... -------------------- yes
"gcc
-I/home/evergreen/.rvm/rubies/ruby-1.9.3-p194/include/ruby-1.9.1/x86_64-linux
-I/home/eg/.rvm/rubies/ruby-1.9.3-p194/include/ruby-1.9.1/ruby/backward
-I/home/eg/.rvm/rubies/ruby-1.9.3-p194/include/ruby-1.9.1 -I.
-I/home/eg/.rvm/usr/include -O3 -ggdb -Wextra -Wno-unused-parameter
-Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith
-Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration
-fPIC -c conftest.c"
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <ruby.h>
4: /*top*/
5: #ifndef SIZEOF_SIZE_T
6: # error
7: >>>>>> SIZEOF_SIZE_T undefined <<<<<<
8: #endif
/* end */
--------------------
have_macro: checking for SIZEOF_LONG in ruby.h... -------------------- yes
Eric Wong
2012-Dec-06 20:23 UTC
Unicorn fails to install even though it''s already installed and running
Mac Martine <99miles at gmail.com> wrote:> I''m deploying a Rails 3.2.8 app to Ubuntu. The server already runs the app with Unicorn and Nginx. > unicorn -v returns unicorn v4.4.0 > > Adn rvm gem list shows: > unicorn (4.4.0) > > Yet when I manually run ''gem install unicorn ''4.4.0'' it fails with the following. Any ideas why?Not sure, yet, (see below) Then there''s also errors which may not be logged correctly: permissions and out-of-disk-space errors> Installing unicorn (4.4.0) > ** [out :: mydomain.net] with native extensions > ** [out :: mydomain.net] > ** [out :: mydomain.net] Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. > ** [out :: mydomain.net] > ** [out :: mydomain.net] /home/eg/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb > ** [out :: mydomain.net] checking for SIZEOF_OFF_T in ruby.h... *** extconf.rb failed *** > ** [out :: mydomain.net] Could not create Makefile due to some reason, probably lack of > ** [out :: mydomain.net] necessary libraries and/or headers. Check the mkmf.log file for more > ** [out :: mydomain.net] details. You may need configuration options.> ** [out :: mydomain.net] Gem files will remain installed in /rails_apps/eg/production/shared/bundle/ruby/1.9.1/gems/unicorn-4.4.0 for inspection. > ** [out :: mydomain.net] Results logged to /rails_apps/eg/production/shared/bundle/ruby/1.9.1/gems/unicorn-4.4.0/ext/unicorn_http/gem_make.outMaybe gem_make.out will have more info than mkmf.log> Here''s the content from what I _think_ is the relevant mkmf.log > > have_macro: checking for SIZEOF_SIZE_T in ruby.h... -------------------- yes > > "gcc -I/home/evergreen/.rvm/rubies/ruby-1.9.3-p194/include/ruby-1.9.1/x86_64-linux -I/home/eg/.rvm/rubies/ruby-1.9.3-p194/include/ruby-1.9.1/ruby/backward -I/home/eg/.rvm/rubies/ruby-1.9.3-p194/include/ruby-1.9.1 -I. -I/home/eg/.rvm/usr/include -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -fPIC -c conftest.c" > checked program was: > /* begin */ > 1: #include "ruby.h" > 2: > 3: #include <ruby.h> > 4: /*top*/ > 5: #ifndef SIZEOF_SIZE_T > 6: # error > 7: >>>>>> SIZEOF_SIZE_T undefined <<<<<< > 8: #endif > /* end */ > > -------------------- > > have_macro: checking for SIZEOF_LONG in ruby.h... -------------------- yesThat looks fine, actually. I think any error will be near the end of mkmf.log.
Mac Martine
2012-Dec-06 21:11 UTC
Unicorn fails to install even though it''s already installed and running
Thanks,
I can install other gems just fine in the same way, so it doesn''t seem
like permissions then, right?
And disk space looks ok:
df -h
Filesystem Size Used Avail Use% Mounted on
/dev/xvda1 38G 17G 21G 45% /
udev 490M 4.0K 490M 1% /dev
tmpfs 199M 240K 199M 1% /run
none 5.0M 0 5.0M 0% /run/lock
none 497M 0 497M 0% /run/shm
Here''s the end of mkmf.log
have_macro: checking for SIZEOF_SIZE_T in ruby.h... -------------------- no
"gcc -I. -I/usr/lib/ruby/1.8/x86_64-linux -I. -fno-strict-aliasing -g -g
-O2 -fPIC -c conftest.c"
conftest.c:4:3: error: #error
conftest.c:5:1: error: expected identifier or ?(? before ?>>? token
checked program was:
/* begin */
1: #include <ruby.h>
2: /*top*/
3: #ifndef SIZEOF_SIZE_T
4: # error
5: >>>>>> SIZEOF_SIZE_T undefined <<<<<<
6: #endif
/* end */
--------------------
check_sizeof: checking size of size_t in sys/types.h... -------------------- 8
"gcc -o conftest -I. -I/usr/lib/ruby/1.8/x86_64-linux -I.
-fno-strict-aliasing -g -g -O2 -fPIC conftest.c -L. -L/usr/lib -L.
-Wl,-Bsymbolic-functions -rdynamic -Wl,-export-dynamic -lruby1.8-static
-lpthread -lrt -ldl -lcrypt -lm -lc"
checked program was:
/* begin */
1: #include <sys/types.h>
2:
3: #include <stdio.h>
4: /*top*/
5: int conftest_const = (int)(sizeof(size_t));
6: int main() {printf("%d\n", conftest_const); return 0;}
/* end */
./conftest |
--------------------
have_macro: checking for SIZEOF_LONG in ruby.h... -------------------- yes
"gcc -I. -I/usr/lib/ruby/1.8/x86_64-linux -I. -fno-strict-aliasing -g -g
-O2 -fPIC -c conftest.c"
checked program was:
/* begin */
1: #include <ruby.h>
2: /*top*/
3: #ifndef SIZEOF_LONG
4: # error
5: >>>>>> SIZEOF_LONG undefined <<<<<<
6: #endif
/* end */
--------------------
have_func: checking for rb_str_set_len() in ruby.h... -------------------- yes
"gcc -o conftest -I. -I/usr/lib/ruby/1.8/x86_64-linux -I.
-fno-strict-aliasing -g -g -O2 -fPIC conftest.c -L. -L/usr/lib -L.
-Wl,-Bsymbolic-functions -rdynamic -Wl,-export-dynamic -lruby1.8-static
-lpthread -lrt -ldl -lcrypt -lm -lc"
checked program was:
/* begin */
1: #include <ruby.h>
2:
3: /*top*/
4: int main() { return 0; }
5: int t() { void ((*volatile p)()); p = (void ((*)()))rb_str_set_len; return 0;
}
/* end */
--------------------
have_func: checking for gmtime_r() in time.h... -------------------- yes
"gcc -o conftest -I. -I/usr/lib/ruby/1.8/x86_64-linux -I.
-fno-strict-aliasing -g -g -O2 -fPIC conftest.c -L. -L/usr/lib -L.
-Wl,-Bsymbolic-functions -rdynamic -Wl,-export-dynamic -lruby1.8-static
-lpthread -lrt -ldl -lcrypt -lm -lc"
checked program was:
/* begin */
1: #include <time.h>
2:
3: /*top*/
4: int main() { return 0; }
5: int t() { void ((*volatile p)()); p = (void ((*)()))gmtime_r; return 0; }
/* end */
--------------------
On Dec 6, 2012, at 12:23 PM, Eric Wong <normalperson at yhbt.net> wrote:
> Mac Martine <99miles at gmail.com> wrote:
>> I''m deploying a Rails 3.2.8 app to Ubuntu. The server already
runs the app with Unicorn and Nginx.
>> unicorn -v returns unicorn v4.4.0
>>
>> Adn rvm gem list shows:
>> unicorn (4.4.0)
>>
>> Yet when I manually run ''gem install unicorn
''4.4.0'' it fails with the following. Any ideas why?
>
> Not sure, yet, (see below)
>
> Then there''s also errors which may not be logged correctly:
permissions
> and out-of-disk-space errors
>
>> Installing unicorn (4.4.0)
>> ** [out :: mydomain.net] with native extensions
>> ** [out :: mydomain.net]
>> ** [out :: mydomain.net] Gem::Installer::ExtensionBuildError:
ERROR: Failed to build gem native extension.
>> ** [out :: mydomain.net]
>> ** [out :: mydomain.net]
/home/eg/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb
>> ** [out :: mydomain.net] checking for SIZEOF_OFF_T in ruby.h... ***
extconf.rb failed ***
>> ** [out :: mydomain.net] Could not create Makefile due to some
reason, probably lack of
>> ** [out :: mydomain.net] necessary libraries and/or headers. Check
the mkmf.log file for more
>> ** [out :: mydomain.net] details. You may need configuration
options.
>
>> ** [out :: mydomain.net] Gem files will remain installed in
/rails_apps/eg/production/shared/bundle/ruby/1.9.1/gems/unicorn-4.4.0 for
inspection.
>> ** [out :: mydomain.net] Results logged to
/rails_apps/eg/production/shared/bundle/ruby/1.9.1/gems/unicorn-4.4.0/ext/unicorn_http/gem_make.out
>
> Maybe gem_make.out will have more info than mkmf.log
>
>> Here''s the content from what I _think_ is the relevant
mkmf.log
>>
>> have_macro: checking for SIZEOF_SIZE_T in ruby.h...
-------------------- yes
>>
>> "gcc
-I/home/evergreen/.rvm/rubies/ruby-1.9.3-p194/include/ruby-1.9.1/x86_64-linux
-I/home/eg/.rvm/rubies/ruby-1.9.3-p194/include/ruby-1.9.1/ruby/backward
-I/home/eg/.rvm/rubies/ruby-1.9.3-p194/include/ruby-1.9.1 -I.
-I/home/eg/.rvm/usr/include -O3 -ggdb -Wextra -Wno-unused-parameter
-Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith
-Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration
-fPIC -c conftest.c"
>> checked program was:
>> /* begin */
>> 1: #include "ruby.h"
>> 2:
>> 3: #include <ruby.h>
>> 4: /*top*/
>> 5: #ifndef SIZEOF_SIZE_T
>> 6: # error
>> 7: >>>>>> SIZEOF_SIZE_T undefined
<<<<<<
>> 8: #endif
>> /* end */
>>
>> --------------------
>>
>> have_macro: checking for SIZEOF_LONG in ruby.h...
-------------------- yes
>
> That looks fine, actually. I think any error will be near the end of
> mkmf.log.
> _______________________________________________
> Unicorn mailing list - mongrel-unicorn at rubyforge.org
> http://rubyforge.org/mailman/listinfo/mongrel-unicorn
> Do not quote signatures (like this one) or top post when replying
Eric Wong
2012-Dec-06 21:54 UTC
Unicorn fails to install even though it''s already installed and running
Mac Martine <99miles at gmail.com> wrote:> Thanks, > > I can install other gems just fine in the same way, so it doesn''t seem > like permissions then, right? > > And disk space looks ok:That''s good to know.> Here''s the end of mkmf.log > > have_macro: checking for SIZEOF_SIZE_T in ruby.h... -------------------- no > > "gcc -I. -I/usr/lib/ruby/1.8/x86_64-linux -I. -fno-strict-aliasing -g -g -O2 -fPIC -c conftest.c"Wait, are you now using a different version of Ruby? Your original message had 1.9 (via RVM)> >> ** [out :: mydomain.net] Results logged to /rails_apps/eg/production/shared/bundle/ruby/1.9.1/gems/unicorn-4.4.0/ext/unicorn_http/gem_make.out > > > > Maybe gem_make.out will have more info than mkmf.logAgain ^^ However, scrutinizing your original email more:> >> "gcc -I/home/evergreen/.rvm/rubies/ruby-1.9.3-p194/include/ruby-1.9.1/x86_64-linux -I/home/eg/.rvm/rubies/ruby-1.9.3-p194/include/ruby-1.9.1/ruby/backward -I/home/eg/.rvm/rubies/ruby-1.9.3-p194/include/ruby-1.9.1 -I. -I/home/eg/.rvm/usr/include -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -fPIC -c conftest.c"I see both /home/evergreen/ and /home/eg/ in there; that looks suspicious. Did you perhaps copy anything in .rvm/ between home directories or rename the home directory at some point after RVM was installed?