- Gem无法更新
如遇到gem update --system异常时
more /etc/sysconfig/network-scripts/ifcfg-eth0
请先检查网络是否出错,配置使用DNS红色部分代码:
TYPE=Ethernet
DEVICE=eth0
HWADDR=xx:xx:xx:xx:xx:xx
GATEWAY=xxx.xxx.xxx.xxx
IPADDR=xxx.xxx.xxx.xxx
NETMASK=255.255.255.0
BOOTPROTO=none
ONBOOT=yes
PEERDNS=yes
IPV6INIT=no
USERCTL=yes
NAME=eth0
DNS1=8.8.8.8
DNS2=8.8.4.4
2. 安装Rmagick问题解决
gem install rmagick
当出现异常信息,内容如下时:
Building native extensions. This could take a while...
ERROR: Error installing rmagick:
ERROR: Failed to build gem native extension.
/usr/local/ruby-2.0/bin/ruby extconf.rb
checking for Ruby version >= 1.8.5... yes
checking for gcc... yes
checking for Magick-config... no
Can't install RMagick 2.13.2. Can't find Magick-config in /usr/local/ruby-2.0/bin:/usr/local/openssl/bin:/usr/lib/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/apache2/bin:/usr/local/svn/bin:/root/bin:/root/bin
*** 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
--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/local/ruby-2.0/bin/ruby
extconf failed, exit code 1
Gem files will remain installed in /usr/local/ruby-2.0/lib/ruby/gems/2.0.0/gems/rmagick-2.13.2 for inspection.
Results logged to /usr/local/ruby-2.0/lib/ruby/gems/2.0.0/extensions/x86-linux/2.0.0/rmagick-2.13.2/gem_make.out
依据错误信息进一步查询错误:
find / -name 'mkmf.log'
………………………
/usr/local/ruby-2.0/lib/ruby/gems/2.0.0/gems/rmagick-2.0.0/ext/RMagick/
……………………….
cd /usr/local/ruby-2.0/lib/ruby/gems/2.0.0/gems/rmagick-2.0.0/ext/RMagick/
more mkmf.log
提示信息:
checking for Ruby version >= 1.8.5... -------------------- yes
find_executable: checking for gcc... -------------------- yes
find_executable: checking for Magick-config... -------------------- no
Can't install RMagick 2.13.2. Can't find Magick-config in /usr/local/ruby-2.0/bin:/usr/local/openssl/bin:/usr/lib/qt-3.3/bin:/usr/lo
cal/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/apache2/bin:/usr/local/svn/bin:/root/bin:/root/bin
缺少Magick-config相关配置
解决办法:
#安装
ImageMagick-devel
,安装
ImageMagick-devel
之前需要安装,它所需要的支持工具。
yum install freetype-devel ghostscript-devel jasper-devel lcms-devel libpng-devel libtiff-devel zlib-devel libxml2-devel
然后安装
ImageMagick
yum install ImageMagick-devel
检查 convert -version
Version: ImageMagick 6.5.4-7 2012-05-07 Q16 OpenMP http://www.imagemagick.org
Copyright: Copyright (C) 1999-2009 ImageMagick Studio LLC
3. mysql数据源bundle编译redmine报错
Fetching gem metadata from https://rubygems.org/.........
Fetching additional metadata from https://rubygems.org/..
Resolving dependencies...
Using rake (10.1.1)
Using i18n (0.6.9)
Using multi_json (1.8.2)
Using activesupport (3.2.16)
Using builder (3.0.0)
Using activemodel (3.2.16)
Using erubis (2.7.0)
Using journey (1.0.4)
Using rack (1.4.5)
Using rack-cache (1.2)
Using rack-test (0.6.2)
Using hike (1.2.3)
Using tilt (1.4.1)
Using sprockets (2.2.2)
Using actionpack (3.2.16)
Using mime-types (1.25.1)
Using polyglot (0.3.3)
Using treetop (1.4.15)
Using mail (2.5.4)
Using actionmailer (3.2.16)
Using arel (3.0.3)
Using tzinfo (0.3.38)
Using activerecord (3.2.16)
Using activeresource (3.2.16)
Using bundler (1.5.1)
Using coderay (1.1.0)
Using rack-ssl (1.3.3)
Using json (1.8.1)
Using rdoc (3.12.2)
Using thor (0.18.1)
Using railties (3.2.16)
Using jquery-rails (2.0.3)
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/usr/local/ruby-2.0/bin/ruby extconf.rb
checking for mysql_ssl_set()... *** 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
--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/local/ruby-2.0/bin/ruby
--with-mysql-config
--without-mysql-config
/usr/local/ruby-2.0/lib/ruby/2.0.0/mkmf.rb:434:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /usr/local/ruby-2.0/lib/ruby/2.0.0/mkmf.rb:519:in `try_link0'
from /usr/local/ruby-2.0/lib/ruby/2.0.0/mkmf.rb:534:in `try_link'
from /usr/local/ruby-2.0/lib/ruby/2.0.0/mkmf.rb:720:in `try_func'
from /usr/local/ruby-2.0/lib/ruby/2.0.0/mkmf.rb:1004:in `block in have_func'
from /usr/local/ruby-2.0/lib/ruby/2.0.0/mkmf.rb:895:in `block in checking_for'
from /usr/local/ruby-2.0/lib/ruby/2.0.0/mkmf.rb:340:in `block (2 levels) in postpone'
from /usr/local/ruby-2.0/lib/ruby/2.0.0/mkmf.rb:310:in `open'
from /usr/local/ruby-2.0/lib/ruby/2.0.0/mkmf.rb:340:in `block in postpone'
from /usr/local/ruby-2.0/lib/ruby/2.0.0/mkmf.rb:310:in `open'
from /usr/local/ruby-2.0/lib/ruby/2.0.0/mkmf.rb:336:in `postpone'
from /usr/local/ruby-2.0/lib/ruby/2.0.0/mkmf.rb:894:in `checking_for'
from /usr/local/ruby-2.0/lib/ruby/2.0.0/mkmf.rb:1003:in `have_func'
from extconf.rb:50:in `<main>'
extconf failed, exit code 1
Gem files will remain installed in /usr/local/ruby-2.0/lib/ruby/gems/2.0.0/gems/mysql-2.8.1 for inspection.
Results logged to /usr/local/ruby-2.0/lib/ruby/gems/2.0.0/extensions/x86-linux/2.0.0/mysql-2.8.1/gem_make.out
An error occurred while installing mysql (2.8.1), and Bundler cannot continue.
Make sure that `gem install mysql -v '2.8.1'` succeeds before bundling.
遇到执行报错,依据提示信息,需要配置ruby 扩展mysql工具
解决办法:
可以find 找到ruby安装目录,找到gems 向下找到 ext最后找到 mysql_api目录.
cd /usr/local/ruby-2.0/lib/ruby/gems/2.0.0/gems/mysql-2.8.1/ext/mysql_api
ruby extconf.rb --with-mysql-config=/usr/local/mysql/bin/mysql_config
checking for mysql_ssl_set()... yes
checking for rb_str_set_len()... yes
checking for rb_thread_start_timer()... no
checking for mysql.h... yes
…………………
creating Makefile
成功。
4. postgres异常报错
/usr/local/ruby-2.0/bin/ruby extconf.rb
checking for pg_config... no
No pg_config... trying anyway. If building fails, please try again with
--with-pg-config=/path/to/pg_config
checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header
*** 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
--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/local/ruby-2.0/bin/ruby
--with-pg
--without-pg
--with-pg-config
--without-pg-config
--with-pg_config
--without-pg_config
--with-pg-dir
--without-pg-dir
--with-pg-include
--without-pg-include=${pg-dir}/include
--with-pg-lib
--without-pg-lib=${pg-dir}/
extconf failed, exit code 1
解决办法:
yum install postgresql-devel