Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails capistrano-错误:无法生成gem本机扩展_Ruby On Rails_Ruby_Capistrano - Fatal编程技术网

Ruby on rails capistrano-错误:无法生成gem本机扩展

Ruby on rails capistrano-错误:无法生成gem本机扩展,ruby-on-rails,ruby,capistrano,Ruby On Rails,Ruby,Capistrano,我尝试使用Capistrano3、pg数据库、nginx和passenger部署rails应用程序,但我有此错误 我使用RVM 操作系统:ubuntu 14.04 ruby v:2.1.4 完全错误 错误:无法生成gem本机扩展。 /usr/local/bin/ruby extconf.rb /home/ubuntu/.rvm/rubies/ruby-2.1.4/lib/ruby/gems/2.1.0/gems/executable-hooks-1.3.2/lib/executable-hook

我尝试使用Capistrano3、pg数据库、nginx和passenger部署rails应用程序,但我有此错误
我使用RVM
操作系统:ubuntu 14.04
ruby v:2.1.4

完全错误

错误:无法生成gem本机扩展。
/usr/local/bin/ruby extconf.rb
/home/ubuntu/.rvm/rubies/ruby-2.1.4/lib/ruby/gems/2.1.0/gems/executable-hooks-1.3.2/lib/executable-hooks/regenate\u binstubs\u命令。rb:71:“初始化”:权限被拒绝@rb\u sysopen-/usr/local/bin/ri(Errno::EACCES)
来自/home/ubuntu/.rvm/rubies/ruby-2.1.4/lib/ruby/gems/2.1.0/gems/executable-hooks-1.3.2/lib/executable-hooks/regenate\u binstubs\u命令。rb:71:在“打开”中
来自/home/ubuntu/.rvm/rubies/ruby-2.1.4/lib/ruby/gems/2.1.0/gems/executable-hooks-1.3.2/lib/executable-hooks/regenate\u binstubs\u命令。rb:71:in`block in try\u to\u fix\u binstubs'
来自/home/ubuntu/.rvm/rubies/ruby-2.1.4/lib/ruby/gems/2.1.0/gems/executable-hooks-1.3.2/lib/executable-hooks/regenate\u binstubs\u命令。rb:69:in`map'
来自/home/ubuntu/.rvm/rubies/ruby-2.1.4/lib/ruby/gems/2.1.0/gems/executable-hooks-1.3.2/lib/executable-hooks/regenate\u-binstubs\u命令。rb:69:in'try\u-to\u-fix\u-binstubs'
来自/home/ubuntu/.rvm/rubies/ruby-2.1.4/lib/ruby/gems/2.1.0/gems/executable-hooks-1.3.2/lib/executable-hooks/regenate\u binstubs\u命令。rb:46:in`block in execute\u no\u包装器'
来自/home/ubuntu/.rvm/rubies/ruby-2.1.4/lib/ruby/gems/2.1.0/gems/executable-hooks-1.3.2/lib/executable-hooks/regenate\u binstubs\u命令。rb:44:in`each'
来自/home/ubuntu/.rvm/rubies/ruby-2.1.4/lib/ruby/gems/2.1.0/gems/executable-hooks-1.3.2/lib/executable-hooks/regenate\u binstubs\u命令。rb:44:in`execute\u no\u wrapper'
来自extconf.rb:19:in`'
捆扎机1.11.2
可执行钩子1.3.2
rake 10.1.0
RDOC4.1.0
extconf失败,退出代码1
Gem文件仍将安装在/home/ubuntu/.rvm/gems/ruby-2.1中。4@global/gems/gems-1.3.2用于检查。
结果记录到/home/ubuntu/.rvm/gems/ruby-2.1。4@global/extensions/x86_64-linux/2.1.0-static/executable-hooks-1.3.2/gem_make.out
(Gem::Ext::BuildError)
/usr/local/lib/ruby/2.1.0/rubygems/ext/builder.rb:89:in'run'
/usr/local/lib/ruby/2.1.0/rubygems/ext/ext\u conf\u builder.rb:38:in'block in build'
/usr/local/lib/ruby/2.1.0/tempfile.rb:324:in'open'
/usr/local/lib/ruby/2.1.0/rubygems/ext/ext\u conf\u builder.rb:17:in'build'
/usr/local/lib/ruby/2.1.0/rubygems/ext/builder.rb:161:in'block(2层)in build_extension'
/usr/local/lib/ruby/2.1.0/rubygems/ext/builder.rb:160:in`chdir'
/usr/local/lib/ruby/2.1.0/rubygems/ext/builder.rb:160:in'block in build_extension'
/usr/local/lib/ruby/2.1.0/rubygems/ext/builder.rb:159:in'synchronize'
/usr/local/lib/ruby/2.1.0/rubygems/ext/builder.rb:159:in'build\u extension'
/usr/local/lib/ruby/2.1.0/rubygems/ext/builder.rb:198:in'block in build_extensions'
/usr/local/lib/ruby/2.1.0/rubygems/ext/builder.rb:195:in'each'
/usr/local/lib/ruby/2.1.0/rubygems/ext/builder.rb:195:in'build_extensions'
/usr/local/lib/ruby/2.1.0/rubygems/specification.rb:1436:in'block in build_extensions'
/usr/local/lib/ruby/2.1.0/rubygems/user\u interaction.rb:45:in'use\u ui'
/usr/local/lib/ruby/2.1.0/rubygems/specification.rb:1434:in'build_extensions'
/usr/local/lib/ruby/2.1.0/rubygems/stub_规范。rb:60:in'build_extensions'
/usr/local/lib/ruby/2.1.0/rubygems/basic_specification.rb:56:in'contains_requireable_file'
/usr/local/lib/ruby/2.1.0/rubygems/specification.rb:925:in'block in find_inactive_by_path'
/usr/local/lib/ruby/2.1.0/rubygems/specification.rb:924:in'each'
/usr/local/lib/ruby/2.1.0/rubygems/specification.rb:924:in'find'
/usr/local/lib/ruby/2.1.0/rubygems/specification.rb:924:in'find_inactive_by_path'
/usr/local/lib/ruby/2.1.0/rubygems.rb:185:in'try_activate'
/usr/local/lib/ruby/2.1.0/rubygems/core\u ext/kernel\u require.rb:132:in'rescue in require'
/usr/local/lib/ruby/2.1.0/rubygems/core\u ext/kernel\u require.rb:144:in'require'
/usr/lib/ruby/vendor\u ruby/phusion\u passenger/native\u support.rb:423:in'load\u native\u extension'
/usr/lib/ruby/vendor\u ruby/phusion\u passenger/native\u support.rb:113:in'load\u from\u load\u path'
/usr/lib/ruby/vendor\u ruby/phusion\u passenger/native\u support.rb:40:in'try\u load'
/usr/lib/ruby/vendor\u ruby/phusion\u passenger/native\u support.rb:50:in'start'
/usr/lib/ruby/vendor\u ruby/phusion\u passenger/native\u support.rb:439:in`'
/usr/local/lib/ruby/2.1.0/rubygems/core\u ext/kernel\u require.rb:55:in'require'
/usr/local/lib/ruby/2.1.0/rubygems/core\u ext/kernel\u require.rb:55:in'require'
/usr/lib/ruby/vendor_ruby/phusion_passenger.rb:235:in'require_passenger_lib'
/usr/share/passenger/helper脚本/rack preload.rb:76:in'init_passenger'
/usr/share/passenger/helper脚本/rack preload.rb:155:in`'
/usr/share/passenger/helper脚本/rack preload.rb:30:in`'
/usr/share/passenger/helper脚本/rack preload.rb:29:in`'

检查您正在部署的用户是否具有安装gems的适当权限。要验证这一点,请以该用户的身份登录服务器,并尝试从
Gemfile
安装一些gems

如果缺少系统依赖项(如openssl、libxml等),某些gem可能无法安装。

权限被拒绝。。。检查权限。
ERROR: Failed to build gem native extension.

    /usr/local/bin/ruby extconf.rb
/home/ubuntu/.rvm/rubies/ruby-2.1.4/lib/ruby/gems/2.1.0/gems/executable-hooks-1.3.2/lib/executable-hooks/regenerate_binstubs_command.rb:71:in `initialize': Permission denied @ rb_sysopen - /usr/local/bin/ri (Errno::EACCES)
    from /home/ubuntu/.rvm/rubies/ruby-2.1.4/lib/ruby/gems/2.1.0/gems/executable-hooks-1.3.2/lib/executable-hooks/regenerate_binstubs_command.rb:71:in `open'
    from /home/ubuntu/.rvm/rubies/ruby-2.1.4/lib/ruby/gems/2.1.0/gems/executable-hooks-1.3.2/lib/executable-hooks/regenerate_binstubs_command.rb:71:in `block in try_to_fix_binstubs'
    from /home/ubuntu/.rvm/rubies/ruby-2.1.4/lib/ruby/gems/2.1.0/gems/executable-hooks-1.3.2/lib/executable-hooks/regenerate_binstubs_command.rb:69:in `map'
    from /home/ubuntu/.rvm/rubies/ruby-2.1.4/lib/ruby/gems/2.1.0/gems/executable-hooks-1.3.2/lib/executable-hooks/regenerate_binstubs_command.rb:69:in `try_to_fix_binstubs'
    from /home/ubuntu/.rvm/rubies/ruby-2.1.4/lib/ruby/gems/2.1.0/gems/executable-hooks-1.3.2/lib/executable-hooks/regenerate_binstubs_command.rb:46:in `block in execute_no_wrapper'
    from /home/ubuntu/.rvm/rubies/ruby-2.1.4/lib/ruby/gems/2.1.0/gems/executable-hooks-1.3.2/lib/executable-hooks/regenerate_binstubs_command.rb:44:in `each'
    from /home/ubuntu/.rvm/rubies/ruby-2.1.4/lib/ruby/gems/2.1.0/gems/executable-hooks-1.3.2/lib/executable-hooks/regenerate_binstubs_command.rb:44:in `execute_no_wrapper'
    from extconf.rb:19:in `<main>'
bundler 1.11.2
executable-hooks 1.3.2
rake 10.1.0
rdoc 4.1.0

extconf failed, exit code 1

Gem files will remain installed in /home/ubuntu/.rvm/gems/ruby-2.1.4@global/gems/executable-hooks-1.3.2 for inspection.
Results logged to /home/ubuntu/.rvm/gems/ruby-2.1.4@global/extensions/x86_64-linux/2.1.0-static/executable-hooks-1.3.2/gem_make.out
 (Gem::Ext::BuildError)
  /usr/local/lib/ruby/2.1.0/rubygems/ext/builder.rb:89:in `run'
  /usr/local/lib/ruby/2.1.0/rubygems/ext/ext_conf_builder.rb:38:in `block in build'
  /usr/local/lib/ruby/2.1.0/tempfile.rb:324:in `open'
  /usr/local/lib/ruby/2.1.0/rubygems/ext/ext_conf_builder.rb:17:in `build'
  /usr/local/lib/ruby/2.1.0/rubygems/ext/builder.rb:161:in `block (2 levels) in build_extension'
  /usr/local/lib/ruby/2.1.0/rubygems/ext/builder.rb:160:in `chdir'
  /usr/local/lib/ruby/2.1.0/rubygems/ext/builder.rb:160:in `block in build_extension'
  /usr/local/lib/ruby/2.1.0/rubygems/ext/builder.rb:159:in `synchronize'
  /usr/local/lib/ruby/2.1.0/rubygems/ext/builder.rb:159:in `build_extension'
  /usr/local/lib/ruby/2.1.0/rubygems/ext/builder.rb:198:in `block in build_extensions'
  /usr/local/lib/ruby/2.1.0/rubygems/ext/builder.rb:195:in `each'
  /usr/local/lib/ruby/2.1.0/rubygems/ext/builder.rb:195:in `build_extensions'
  /usr/local/lib/ruby/2.1.0/rubygems/specification.rb:1436:in `block in build_extensions'
  /usr/local/lib/ruby/2.1.0/rubygems/user_interaction.rb:45:in `use_ui'
  /usr/local/lib/ruby/2.1.0/rubygems/specification.rb:1434:in `build_extensions'
  /usr/local/lib/ruby/2.1.0/rubygems/stub_specification.rb:60:in `build_extensions'
  /usr/local/lib/ruby/2.1.0/rubygems/basic_specification.rb:56:in `contains_requirable_file?'
  /usr/local/lib/ruby/2.1.0/rubygems/specification.rb:925:in `block in find_inactive_by_path'
  /usr/local/lib/ruby/2.1.0/rubygems/specification.rb:924:in `each'
  /usr/local/lib/ruby/2.1.0/rubygems/specification.rb:924:in `find'
  /usr/local/lib/ruby/2.1.0/rubygems/specification.rb:924:in `find_inactive_by_path'
  /usr/local/lib/ruby/2.1.0/rubygems.rb:185:in `try_activate'
  /usr/local/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:132:in `rescue in require'
  /usr/local/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:144:in `require'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/native_support.rb:423:in `load_native_extension'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/native_support.rb:113:in `load_from_load_path'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/native_support.rb:40:in `try_load'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/native_support.rb:50:in `start'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/native_support.rb:439:in `<top (required)>'
  /usr/local/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
  /usr/local/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
  /usr/lib/ruby/vendor_ruby/phusion_passenger.rb:235:in `require_passenger_lib'
  /usr/share/passenger/helper-scripts/rack-preloader.rb:76:in `init_passenger'
  /usr/share/passenger/helper-scripts/rack-preloader.rb:155:in `<module:App>'
  /usr/share/passenger/helper-scripts/rack-preloader.rb:30:in `<module:PhusionPassenger>'
  /usr/share/passenger/helper-scripts/rack-preloader.rb:29:in `<main>'