windows下Rails应用执行bundle install报错无法安装racc1.5.2

Installing racc 1.5.2 with native extensions                                            
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.                      
                                                                                        
current directory:                                                                      
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/racc-1.5.2/ext/racc/cparse                       
C:/Ruby26-x64/bin/ruby.exe -r ./siteconf20210704-9368-nxt58n.rb extconf.rb              
checking for rb_ary_subseq()... *** extconf.rb failed ***                               
Could not create Makefile due to some reason, probably lack of necessary                
libraries and/or headers.  Check the mkmf.log file for more details.  You may           
need configuration options.                                                             
                                                                                        
Provided configuration options:                                                         
        --with-opt-dir                                                                  
        --without-opt-dir                                                               
        --with-opt-include                                                              
        --without-opt-include=${opt-dir}/include                                        
        --with-opt-lib                                                                  
        --without-opt-lib=${opt-dir}/lib                                                
        --with-make-prog                                                                
        --without-make-prog                                                             
        --srcdir=.                                                                      
        --curdir                                                                        
        --ruby=C:/Ruby26-x64/bin/$(RUBY_BASE_NAME)                                      
C:/Ruby26-x64/lib/ruby/2.6.0/mkmf.rb:467:in `try_do': The compiler failed to            
generate an executable file. (RuntimeError)                                             
You have to install development tools first.                                            
        from C:/Ruby26-x64/lib/ruby/2.6.0/mkmf.rb:552:in `try_link0'                    
        from C:/Ruby26-x64/lib/ruby/2.6.0/mkmf.rb:570:in `try_link'                     
        from C:/Ruby26-x64/lib/ruby/2.6.0/mkmf.rb:782:in `try_func'                     
        from C:/Ruby26-x64/lib/ruby/2.6.0/mkmf.rb:1069:in `block in have_func'          
        from C:/Ruby26-x64/lib/ruby/2.6.0/mkmf.rb:959:in `block in checking_for'        
        from C:/Ruby26-x64/lib/ruby/2.6.0/mkmf.rb:361:in `block (2 levels) in postpone' 
        from C:/Ruby26-x64/lib/ruby/2.6.0/mkmf.rb:331:in `open'                         
        from C:/Ruby26-x64/lib/ruby/2.6.0/mkmf.rb:361:in `block in postpone'            
        from C:/Ruby26-x64/lib/ruby/2.6.0/mkmf.rb:331:in `open'                         
        from C:/Ruby26-x64/lib/ruby/2.6.0/mkmf.rb:357:in `postpone'                     
        from C:/Ruby26-x64/lib/ruby/2.6.0/mkmf.rb:958:in `checking_for'                 
        from C:/Ruby26-x64/lib/ruby/2.6.0/mkmf.rb:1068:in `have_func'                   
        from extconf.rb:6:in `<main>'                                                   
                                                                                        
To see why this extension failed to compile, please check the mkmf.log which can        
be found here:                                                                          
                                                                                        
C:/Ruby26-x64/lib/ruby/gems/2.6.0/extensions/x64-mingw32/2.6.0/racc-1.5.2/mkmf.log      
                                                                                        
extconf failed, exit code 1                                                             
                                                                                        
Gem files will remain installed in                                                      
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/racc-1.5.2 for inspection.                       
Results logged to                                                                       
C:/Ruby26-x64/lib/ruby/gems/2.6.0/extensions/x64-mingw32/2.6.0/racc-1.5.2/gem_make.out  
                                                                                        
An error occurred while installing racc (1.5.2), and Bundler cannot                     
continue.                                                                               
Make sure that `gem install racc -v '1.5.2' --source 'https://rubygems.org/'`           
succeeds before bundling.                                                               
                                                                                        
In Gemfile:                                                                             
  rails was resolved to 5.2.6, which depends on                                         
    actioncable was resolved to 5.2.6, which depends on                                 
      actionpack was resolved to 5.2.6, which depends on                                
        actionview was resolved to 5.2.6, which depends on                              
          rails-dom-testing was resolved to 2.0.3, which depends on                     
            nokogiri was resolved to 1.11.7, which depends on                           
              racc                                                                      

报错信息如上,经过查询资料,断定为ruby安装时未安装DEVKIT.

图中原文链接
大致意思在Windows下可以试试安装带有DEVKIT的ruby安装包.


Windows下选择with devkit下的安装包进行安装,重装之后问题完美解决.
下载ruby安装包

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值