如何使用gem在Ubuntu上安装Rails

编程入门 行业动态 更新时间:2024-10-10 14:30:22
本文介绍了如何使用gem在Ubuntu上安装Rails的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

错误消息:

Building native extensions. This could take a while... ERROR: Error installing rails: ERROR: Failed to build gem native extension. /usr/bin/ruby2.1 -r ./siteconf20150328-1540-hff2f0.rb extconf.rb checking if the C compiler accepts ... *** 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=/usr/bin/ruby2.1 --help --clean /usr/lib/ruby/2.1.0/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError) You have to install development tools first. from /usr/lib/ruby/2.1.0/mkmf.rb:571:in `block in try_compile' from /usr/lib/ruby/2.1.0/mkmf.rb:522:in `with_werror' from /usr/lib/ruby/2.1.0/mkmf.rb:571:in `try_compile' from extconf.rb:80:in `nokogiri_try_compile' from extconf.rb:87:in `block in add_cflags' from /usr/lib/ruby/2.1.0/mkmf.rb:621:in `with_cflags' from extconf.rb:86:in `add_cflags' from extconf.rb:337:in `<main>' extconf failed, exit code 1 Gem files will remain installed in /var/lib/gems/2.1.0/gems/nokogiri-1.6.6.2 for inspection. Results logged to /var/lib/gems/2.1.0/extensions/x86_64-linux/2.1.0/nokogiri-1.6.6.2/gem_make.out

配置:

  • Ubuntu 14.10(GNU/Linux 3.16.0-23-通用x86_64)
  • gcc(Ubuntu 4.9.1-16ubuntu6)4.9.1
  • 红宝石2.1.2p95(2014-05-08)[x86_64-linux-gnu]
  • 推荐答案

    在使用RVM在Ubuntu 14.04上升级到Rails 4.2.4之后,我需要这样做:

    After upgrading to Rails 4.2.4 on Ubuntu 14.04 using RVM I needed to do this:

    sudo apt-get install libgmp-dev

    sudo apt-get install libgmp3-dev

    完整的堆栈跟踪: ruby-on-rails-eq8.blogspot.co.uk/2015/10/solving-ubuntu-1404-ruby-c-dependancy.html

    更多推荐

    如何使用gem在Ubuntu上安装Rails

    本文发布于:2023-10-14 03:54:04,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1489949.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:如何使用   gem   Rails   Ubuntu

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!