捆绑安装不成功
bundle install doesn't succeed
我目前正在帮助这个 rails 项目。 (我刚开始ruby,甚至编程,所以请放轻松...)
当我尝试 bundle install
与项目共享 Gemfile/Gemfile.lock 时,它会引起一些 json 1.8.1
和 libv8 3.16.14.3
安装的麻烦。
我打了一些搜索结果,涉及到一半的答案bundle update
,据更多有经验的团队成员说,这是在团队中工作的禁忌,因为它会给项目带来混乱Gemfile.lock.
我用不同的东西尝试了另一半,比如 El-Captain 相关的恢复模式位或 gem update -system
或 libv8 相关的东西。
似乎其中任何一个都不起作用。
再一次,我很可能没有使用精确的查询来搜索答案,因为我是初学者并且没有太多的知识或猜测通常导致问题的原因或'this is base library so i should get this done right.'或像这样的东西。
如果有人能帮助我,那将是莫大的恩情。
我要把日志留在这里:
Installing json 1.8.1 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /usr/local/lib/ruby/gems/2.3.0/gems/json-
1.8.1/ext/json/ext/generator
/usr/local/opt/ruby/bin/ruby -r ./siteconf20160607-22004-lr43ei.rb extconf.rb
creating Makefile
current directory: /usr/local/lib/ruby/gems/2.3.0/gems/json-1.8.1/ext/json/ext/generator
make "DESTDIR=" clean
current directory: /usr/local/lib/ruby/gems/2.3.0/gems/json-1.8.1/ext/json/ext/generator
make "DESTDIR="
compiling generator.c
In file included from generator.c:1:
./../fbuffer/fbuffer.h:175:47: error: too few arguments provided to function-like macro invocation
VALUE result = rb_str_new(FBUFFER_PAIR(fb));
^
/usr/local/Cellar/ruby/2.3.1/include/ruby-2.3.0/ruby/intern.h:797:9: note: macro 'rb_str_new' defined here
#define rb_str_new(str, len) __extension__ ( \
^
In file included from generator.c:1:
./../fbuffer/fbuffer.h:175:11: warning: incompatible pointer to integer conversion initializing 'VALUE' (aka 'unsigned long') with an expression of type 'VALUE (const char *, long)' (aka 'unsigned long (const char *, long)') [-Wint-conversion]
VALUE result = rb_str_new(FBUFFER_PAIR(fb));
^ ~~~~~~~~~~
1 warning and 1 error generated.
make: *** [generator.o] Error 1
make failed, exit code 2
Gem files will remain installed in /usr/local/lib/ruby/gems/2.3.0/gems/json-1.8.1 for inspection.
Results logged to /usr/local/lib/ruby/gems/2.3.0/extensions/x86_64-darwin-15/2.3.0/json-1.8.1/gem_make.out
Installing libv8 3.16.14.3 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /usr/local/lib/ruby/gems/2.3.0/gems/libv8-3.16.14.3/ext/libv8
/usr/local/opt/ruby/bin/ruby -r ./siteconf20160607-22004-1gr1tzk.rb extconf.rb
creating Makefile
Compiling v8 for x64
Using python 2.7.10
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Using compiler: /usr/bin/g++
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
../src/cached-powers.cc:136:18: error: unused variable 'kCachedPowersLength' [-Werror,-Wunused-const-variable]
static const int kCachedPowersLength = ARRAY_SIZE(kCachedPowers);
^
1 error generated.
make[1]: *** [/usr/local/lib/ruby/gems/2.3.0/gems/libv8-3.16.14.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/cached-powers.o] Error 1
make: *** [x64.release] Error 2
/usr/local/lib/ruby/gems/2.3.0/gems/libv8-3.16.14.3/ext/libv8/location.rb:36:in `block in verify_installation!': libv8 did not install properly, expected binary v8 archive '/usr/local/lib/ruby/gems/2.3.0/gems/libv8-3.16.14.3/vendor/v8/out/x64.release/obj.target/tools/gyp/libv8_base.a'to exist, but it was not found (Libv8::Location::Vendor::ArchiveNotFound)
from /usr/local/lib/ruby/gems/2.3.0/gems/libv8-3.16.14.3/ext/libv8/location.rb:35:in `each'
from /usr/local/lib/ruby/gems/2.3.0/gems/libv8-3.16.14.3/ext/libv8/location.rb:35:in `verify_installation!'
from /usr/local/lib/ruby/gems/2.3.0/gems/libv8-3.16.14.3/ext/libv8/location.rb:26:in `install!'
from extconf.rb:7:in `<main>'
GYP_GENERATORS=make \
build/gyp/gyp --generator-output="out" build/all.gyp \
-Ibuild/standalone.gypi --depth=. \
-Dv8_target_arch=x64 \
-S.x64 -Dv8_enable_backtrace=1 -Dv8_can_use_vfp2_instructions=true -Darm_fpu=vfpv2 -Dv8_can_use_vfp3_instructions=true -Darm_fpu=vfpv3
CXX(target) /usr/local/lib/ruby/gems/2.3.0/gems/libv8-3.16.14.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/allocation.o
CXX(target) /usr/local/lib/ruby/gems/2.3.0/gems/libv8-3.16.14.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/atomicops_internals_x86_gcc.o
CXX(target) /usr/local/lib/ruby/gems/2.3.0/gems/libv8-3.16.14.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/bignum.o
CXX(target) /usr/local/lib/ruby/gems/2.3.0/gems/libv8-3.16.14.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/bignum-dtoa.o
CXX(target) /usr/local/lib/ruby/gems/2.3.0/gems/libv8-3.16.14.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/cached-powers.o
extconf failed, exit code 1
Gem files will remain installed in /usr/local/lib/ruby/gems/2.3.0/gems/libv8-3.16.14.3 for inspection.
Results logged to /usr/local/lib/ruby/gems/2.3.0/extensions/x86_64-darwin-15/2.3.0/libv8-3.16.14.3/gem_make.out
非常抱歉各位,我正在使用 Mac!
ERROR: Failed to build gem native extension.
这可能是因为您没有安装 node.js
:
卷曲-sL https://deb.nodesource.com/setup_6.x |须藤 -E bash -
sudo apt-get install -y nodejs
试试这个:
sudo apt-get install nodejs
我遇到了与您类似的问题,除了我,我只收到与 json gem(相同的版本号和所有内容)相关的错误。我找到了 this solution,它对我有用(不过我必须先删除 Gemfile.lock)。希望对您有所帮助!
首先删除您的 Gemfile.lock
文件,然后
bundle install
我找到了失败的原因,就是那些gem的版本和ruby版本的兼容性问题。
我非常清楚这可能是个问题,但我认为我确保为 Gemfile/Gemfile.lock 中指定的 gems 版本设置了正确的 ruby 版本。我错过的是 rbenv 配置错误的痕迹,在日志中显示为“2.3.0”。我认为它应该是“2.0.0”。
由于我没有做好 rbenv 设置,bundler 指的是 ruby 不在项目目录中。因此明显的版本不兼容。
我目前正在帮助这个 rails 项目。 (我刚开始ruby,甚至编程,所以请放轻松...)
当我尝试 bundle install
与项目共享 Gemfile/Gemfile.lock 时,它会引起一些 json 1.8.1
和 libv8 3.16.14.3
安装的麻烦。
我打了一些搜索结果,涉及到一半的答案bundle update
,据更多有经验的团队成员说,这是在团队中工作的禁忌,因为它会给项目带来混乱Gemfile.lock.
我用不同的东西尝试了另一半,比如 El-Captain 相关的恢复模式位或 gem update -system
或 libv8 相关的东西。
似乎其中任何一个都不起作用。
再一次,我很可能没有使用精确的查询来搜索答案,因为我是初学者并且没有太多的知识或猜测通常导致问题的原因或'this is base library so i should get this done right.'或像这样的东西。
如果有人能帮助我,那将是莫大的恩情。 我要把日志留在这里:
Installing json 1.8.1 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /usr/local/lib/ruby/gems/2.3.0/gems/json-
1.8.1/ext/json/ext/generator
/usr/local/opt/ruby/bin/ruby -r ./siteconf20160607-22004-lr43ei.rb extconf.rb
creating Makefile
current directory: /usr/local/lib/ruby/gems/2.3.0/gems/json-1.8.1/ext/json/ext/generator
make "DESTDIR=" clean
current directory: /usr/local/lib/ruby/gems/2.3.0/gems/json-1.8.1/ext/json/ext/generator
make "DESTDIR="
compiling generator.c
In file included from generator.c:1:
./../fbuffer/fbuffer.h:175:47: error: too few arguments provided to function-like macro invocation
VALUE result = rb_str_new(FBUFFER_PAIR(fb));
^
/usr/local/Cellar/ruby/2.3.1/include/ruby-2.3.0/ruby/intern.h:797:9: note: macro 'rb_str_new' defined here
#define rb_str_new(str, len) __extension__ ( \
^
In file included from generator.c:1:
./../fbuffer/fbuffer.h:175:11: warning: incompatible pointer to integer conversion initializing 'VALUE' (aka 'unsigned long') with an expression of type 'VALUE (const char *, long)' (aka 'unsigned long (const char *, long)') [-Wint-conversion]
VALUE result = rb_str_new(FBUFFER_PAIR(fb));
^ ~~~~~~~~~~
1 warning and 1 error generated.
make: *** [generator.o] Error 1
make failed, exit code 2
Gem files will remain installed in /usr/local/lib/ruby/gems/2.3.0/gems/json-1.8.1 for inspection.
Results logged to /usr/local/lib/ruby/gems/2.3.0/extensions/x86_64-darwin-15/2.3.0/json-1.8.1/gem_make.out
Installing libv8 3.16.14.3 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /usr/local/lib/ruby/gems/2.3.0/gems/libv8-3.16.14.3/ext/libv8
/usr/local/opt/ruby/bin/ruby -r ./siteconf20160607-22004-1gr1tzk.rb extconf.rb
creating Makefile
Compiling v8 for x64
Using python 2.7.10
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Using compiler: /usr/bin/g++
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
../src/cached-powers.cc:136:18: error: unused variable 'kCachedPowersLength' [-Werror,-Wunused-const-variable]
static const int kCachedPowersLength = ARRAY_SIZE(kCachedPowers);
^
1 error generated.
make[1]: *** [/usr/local/lib/ruby/gems/2.3.0/gems/libv8-3.16.14.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/cached-powers.o] Error 1
make: *** [x64.release] Error 2
/usr/local/lib/ruby/gems/2.3.0/gems/libv8-3.16.14.3/ext/libv8/location.rb:36:in `block in verify_installation!': libv8 did not install properly, expected binary v8 archive '/usr/local/lib/ruby/gems/2.3.0/gems/libv8-3.16.14.3/vendor/v8/out/x64.release/obj.target/tools/gyp/libv8_base.a'to exist, but it was not found (Libv8::Location::Vendor::ArchiveNotFound)
from /usr/local/lib/ruby/gems/2.3.0/gems/libv8-3.16.14.3/ext/libv8/location.rb:35:in `each'
from /usr/local/lib/ruby/gems/2.3.0/gems/libv8-3.16.14.3/ext/libv8/location.rb:35:in `verify_installation!'
from /usr/local/lib/ruby/gems/2.3.0/gems/libv8-3.16.14.3/ext/libv8/location.rb:26:in `install!'
from extconf.rb:7:in `<main>'
GYP_GENERATORS=make \
build/gyp/gyp --generator-output="out" build/all.gyp \
-Ibuild/standalone.gypi --depth=. \
-Dv8_target_arch=x64 \
-S.x64 -Dv8_enable_backtrace=1 -Dv8_can_use_vfp2_instructions=true -Darm_fpu=vfpv2 -Dv8_can_use_vfp3_instructions=true -Darm_fpu=vfpv3
CXX(target) /usr/local/lib/ruby/gems/2.3.0/gems/libv8-3.16.14.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/allocation.o
CXX(target) /usr/local/lib/ruby/gems/2.3.0/gems/libv8-3.16.14.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/atomicops_internals_x86_gcc.o
CXX(target) /usr/local/lib/ruby/gems/2.3.0/gems/libv8-3.16.14.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/bignum.o
CXX(target) /usr/local/lib/ruby/gems/2.3.0/gems/libv8-3.16.14.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/bignum-dtoa.o
CXX(target) /usr/local/lib/ruby/gems/2.3.0/gems/libv8-3.16.14.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/cached-powers.o
extconf failed, exit code 1
Gem files will remain installed in /usr/local/lib/ruby/gems/2.3.0/gems/libv8-3.16.14.3 for inspection.
Results logged to /usr/local/lib/ruby/gems/2.3.0/extensions/x86_64-darwin-15/2.3.0/libv8-3.16.14.3/gem_make.out
非常抱歉各位,我正在使用 Mac!
ERROR: Failed to build gem native extension.
这可能是因为您没有安装 node.js
:
卷曲-sL https://deb.nodesource.com/setup_6.x |须藤 -E bash - sudo apt-get install -y nodejs
试试这个:
sudo apt-get install nodejs
我遇到了与您类似的问题,除了我,我只收到与 json gem(相同的版本号和所有内容)相关的错误。我找到了 this solution,它对我有用(不过我必须先删除 Gemfile.lock)。希望对您有所帮助!
首先删除您的 Gemfile.lock
文件,然后
bundle install
我找到了失败的原因,就是那些gem的版本和ruby版本的兼容性问题。
我非常清楚这可能是个问题,但我认为我确保为 Gemfile/Gemfile.lock 中指定的 gems 版本设置了正确的 ruby 版本。我错过的是 rbenv 配置错误的痕迹,在日志中显示为“2.3.0”。我认为它应该是“2.0.0”。
由于我没有做好 rbenv 设置,bundler 指的是 ruby 不在项目目录中。因此明显的版本不兼容。