読者です 読者をやめる 読者になる 読者になる

【Ruby】bundle installでエラー

 

環境:Vagrant

 

エラー内容

Text file busy @ unlink_internal - ./siteconf20161125-1337-gscgg6.rb

An error occurred while installing nio4r (1.2.1), and Bundler cannot continue.
Make sure that `gem install nio4r -v '1.2.1'` succeeds before bundling.

 

 

nio4r -v '1.2.1'`に問題があるのかと思い以下のログを確認しました。

myapp\ruby\mymemo\vendor\bundle\ruby\2.2.0\extensions\x86_64-linux\2.2.0\nio4r-1.2.1\mkmf.log

 

have_header: checking for unistd.h... -------------------- yes

"gcc -o conftest -I/home/vagrant/.rvm/rubies/ruby-2.2.2/include/ruby-2.2.0/x86_64-linux -I/home/vagrant/.rvm/rubies/ruby-2.2.2/include/ruby-2.2.0/ruby/backward -I/home/vagrant/.rvm/rubies/ruby-2.2.2/include/ruby-2.2.0 -I. -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wno-packed-bitfield-compat -fPIC conftest.c -L. -L/home/vagrant/.rvm/rubies/ruby-2.2.2/lib -Wl,-R/home/vagrant/.rvm/rubies/ruby-2.2.2/lib -L. -fstack-protector -rdynamic -Wl,-export-dynamic -Wl,-R/home/vagrant/.rvm/rubies/ruby-2.2.2/lib -L/home/vagrant/.rvm/rubies/ruby-2.2.2/lib -lruby -lpthread -lrt -ldl -lcrypt -lm -lc"
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5: return 0;
6: }
/* end */

"gcc -E -I/home/vagrant/.rvm/rubies/ruby-2.2.2/include/ruby-2.2.0/x86_64-linux -I/home/vagrant/.rvm/rubies/ruby-2.2.2/include/ruby-2.2.0/ruby/backward -I/home/vagrant/.rvm/rubies/ruby-2.2.2/include/ruby-2.2.0 -I. -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wno-packed-bitfield-compat -fPIC conftest.c -o conftest.i"
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <unistd.h>
/* end */

--------------------

have_func: checking for rb_thread_blocking_region()... -------------------- no

"gcc -o conftest -I/home/vagrant/.rvm/rubies/ruby-2.2.2/include/ruby-2.2.0/x86_64-linux -I/home/vagrant/.rvm/rubies/ruby-2.2.2/include/ruby-2.2.0/ruby/backward -I/home/vagrant/.rvm/rubies/ruby-2.2.2/include/ruby-2.2.0 -I. -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wno-packed-bitfield-compat -fPIC conftest.c -L. -L/home/vagrant/.rvm/rubies/ruby-2.2.2/lib -Wl,-R/home/vagrant/.rvm/rubies/ruby-2.2.2/lib -L. -fstack-protector -rdynamic -Wl,-export-dynamic -Wl,-R/home/vagrant/.rvm/rubies/ruby-2.2.2/lib -L/home/vagrant/.rvm/rubies/ruby-2.2.2/lib -lruby -lpthread -lrt -ldl -lcrypt -lm -lc"
conftest.c: In Funktion »t«:
conftest.c:13: Fehler: »rb_thread_blocking_region« nicht deklariert (erste Benutzung in dieser Funktion)
conftest.c:13: Fehler: (Jeder nicht deklarierte Bezeichner wird nur einmal aufgeführt
conftest.c:13: Fehler: für jede Funktion in der er auftritt.)
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: /*top*/
4: extern int t(void);
5: int main(int argc, char **argv)
6: {
7: if (argc > 1000000) {
8: printf("%p", &t);
9: }
10:
11: return 0;
12: }
13: int t(void) { void *1; p = (void *2; p = (void ((*)()))rb_thread_call_without_gvl; return 0; }
/* end */

"gcc -o conftest -I/home/vagrant/.rvm/rubies/ruby-2.2.2/include/ruby-2.2.0/x86_64-linux -I/home/vagrant/.rvm/rubies/ruby-2.2.2/include/ruby-2.2.0/ruby/backward -I/home/vagrant/.rvm/rubies/ruby-2.2.2/include/ruby-2.2.0 -I. -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wno-packed-bitfield-compat -fPIC conftest.c -L. -L/home/vagrant/.rvm/rubies/ruby-2.2.2/lib -Wl,-R/home/vagrant/.rvm/rubies/ruby-2.2.2/lib -L. -fstack-protector -rdynamic -Wl,-export-dynamic -Wl,-R/home/vagrant/.rvm/rubies/ruby-2.2.2/lib -L/home/vagrant/.rvm/rubies/ruby-2.2.2/lib -lruby -lpthread -lrt -ldl -lcrypt -lm -lc"
conftest.c: In Funktion »t«:
conftest.c:13: Warnung: Implizite Deklaration der Funktion »rb_thread_call_without_gvl«
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: /*top*/
4: extern int t(void);
5: int main(int argc, char **argv)
6: {
7: if (argc > 1000000) {
8: printf("%p", &t);
9: }
10:
11: return 0;
12: }
13: int t(void) { rb_thread_call_without_gvl(); return 0; }
/* end */

--------------------

have_header: checking for sys/select.h... -------------------- yes

"gcc -E -I/home/vagrant/.rvm/rubies/ruby-2.2.2/include/ruby-2.2.0/x86_64-linux -I/home/vagrant/.rvm/rubies/ruby-2.2.2/include/ruby-2.2.0/ruby/backward -I/home/vagrant/.rvm/rubies/ruby-2.2.2/include/ruby-2.2.0 -I. -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wno-packed-bitfield-compat -fPIC conftest.c -o conftest.i"
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <sys/select.h>
/* end */

--------------------

have_header: checking for poll.h... -------------------- yes

"gcc -E -I/home/vagrant/.rvm/rubies/ruby-2.2.2/include/ruby-2.2.0/x86_64-linux -I/home/vagrant/.rvm/rubies/ruby-2.2.2/include/ruby-2.2.0/ruby/backward -I/home/vagrant/.rvm/rubies/ruby-2.2.2/include/ruby-2.2.0 -I. -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wno-packed-bitfield-compat -fPIC conftest.c -o conftest.i"
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <poll.h>
/* end */

--------------------

have_header: checking for sys/epoll.h... -------------------- yes

"gcc -E -I/home/vagrant/.rvm/rubies/ruby-2.2.2/include/ruby-2.2.0/x86_64-linux -I/home/vagrant/.rvm/rubies/ruby-2.2.2/include/ruby-2.2.0/ruby/backward -I/home/vagrant/.rvm/rubies/ruby-2.2.2/include/ruby-2.2.0 -I. -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wno-packed-bitfield-compat -fPIC conftest.c -o conftest.i"
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <sys/epoll.h>
/* end */

--------------------

have_header: checking for sys/event.h... -------------------- no

"gcc -E -I/home/vagrant/.rvm/rubies/ruby-2.2.2/include/ruby-2.2.0/x86_64-linux -I/home/vagrant/.rvm/rubies/ruby-2.2.2/include/ruby-2.2.0/ruby/backward -I/home/vagrant/.rvm/rubies/ruby-2.2.2/include/ruby-2.2.0 -I. -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wno-packed-bitfield-compat -fPIC conftest.c -o conftest.i"
conftest.c:3:23: Fehler: sys/event.h: Datei oder Verzeichnis nicht gefunden
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <sys/event.h>
/* end */

--------------------

have_header: checking for port.h... -------------------- no

"gcc -E -I/home/vagrant/.rvm/rubies/ruby-2.2.2/include/ruby-2.2.0/x86_64-linux -I/home/vagrant/.rvm/rubies/ruby-2.2.2/include/ruby-2.2.0/ruby/backward -I/home/vagrant/.rvm/rubies/ruby-2.2.2/include/ruby-2.2.0 -I. -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wno-packed-bitfield-compat -fPIC conftest.c -o conftest.i"
conftest.c:3:18: Fehler: port.h: Datei oder Verzeichnis nicht gefunden
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <port.h>
/* end */

--------------------

have_header: checking for sys/resource.h... -------------------- yes

"gcc -E -I/home/vagrant/.rvm/rubies/ruby-2.2.2/include/ruby-2.2.0/x86_64-linux -I/home/vagrant/.rvm/rubies/ruby-2.2.2/include/ruby-2.2.0/ruby/backward -I/home/vagrant/.rvm/rubies/ruby-2.2.2/include/ruby-2.2.0 -I. -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wno-packed-bitfield-compat -fPIC conftest.c -o conftest.i"
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <sys/resource.h>
/* end */

--------------------

 

 

 

nio4rの問題ではなく、共有フォルダにinstallすると発生する

Vagrantなど仮想環境の問題のようです。

 

なぜ、rails new myapp したときにはエラーが発生しないのか?

 

デフォルトのインストール先は

/home/vagrant/.rvm/gems/ruby-2.2.2/gems/

になっているからです。

(共有フォルダではない)

 

ですので、解決策としては、

/home/vagrant/.myapp/ を作成し、

bundle install --path /home/vagrant/.myapp

などにすれば解決します。

 

 

 

 

 

*1:*volatile p)(

*2:*)()))rb_thread_blocking_region; return 0; }
/* end */

"gcc -o conftest -I/home/vagrant/.rvm/rubies/ruby-2.2.2/include/ruby-2.2.0/x86_64-linux -I/home/vagrant/.rvm/rubies/ruby-2.2.2/include/ruby-2.2.0/ruby/backward -I/home/vagrant/.rvm/rubies/ruby-2.2.2/include/ruby-2.2.0 -I. -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wno-packed-bitfield-compat -fPIC conftest.c -L. -L/home/vagrant/.rvm/rubies/ruby-2.2.2/lib -Wl,-R/home/vagrant/.rvm/rubies/ruby-2.2.2/lib -L. -fstack-protector -rdynamic -Wl,-export-dynamic -Wl,-R/home/vagrant/.rvm/rubies/ruby-2.2.2/lib -L/home/vagrant/.rvm/rubies/ruby-2.2.2/lib -lruby -lpthread -lrt -ldl -lcrypt -lm -lc"
conftest.c: In Funktion »t«:
conftest.c:13: Warnung: Implizite Deklaration der Funktion »rb_thread_blocking_region«
/tmp/cc2UUJPo.o: In function `t':
/vagrant/myapp/ruby/mymemo/vendor/bundle/ruby/2.2.0/gems/nio4r-1.2.1/ext/nio4r/conftest.c:13: undefined reference to `rb_thread_blocking_region'
collect2: ld gab 1 als Ende-Status zurück
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: /*top*/
4: extern int t(void);
5: int main(int argc, char **argv)
6: {
7: if (argc > 1000000) {
8: printf("%p", &t);
9: }
10:
11: return 0;
12: }
13: int t(void) { rb_thread_blocking_region(); return 0; }
/* end */

--------------------

have_func: checking for rb_thread_call_without_gvl()... -------------------- yes

"gcc -o conftest -I/home/vagrant/.rvm/rubies/ruby-2.2.2/include/ruby-2.2.0/x86_64-linux -I/home/vagrant/.rvm/rubies/ruby-2.2.2/include/ruby-2.2.0/ruby/backward -I/home/vagrant/.rvm/rubies/ruby-2.2.2/include/ruby-2.2.0 -I. -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wno-packed-bitfield-compat -fPIC conftest.c -L. -L/home/vagrant/.rvm/rubies/ruby-2.2.2/lib -Wl,-R/home/vagrant/.rvm/rubies/ruby-2.2.2/lib -L. -fstack-protector -rdynamic -Wl,-export-dynamic -Wl,-R/home/vagrant/.rvm/rubies/ruby-2.2.2/lib -L/home/vagrant/.rvm/rubies/ruby-2.2.2/lib -lruby -lpthread -lrt -ldl -lcrypt -lm -lc"
conftest.c: In Funktion »t«:
conftest.c:13: Fehler: »rb_thread_call_without_gvl« nicht deklariert (erste Benutzung in dieser Funktion)
conftest.c:13: Fehler: (Jeder nicht deklarierte Bezeichner wird nur einmal aufgeführt
conftest.c:13: Fehler: für jede Funktion in der er auftritt.)
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: /*top*/
4: extern int t(void);
5: int main(int argc, char **argv)
6: {
7: if (argc > 1000000) {
8: printf("%p", &t);
9: }
10:
11: return 0;
12: }
13: int t(void) { void ((*volatile p)(