源码安装ruby时 ERROR: Loading command: install (LoadError) cannot load such file -- zlib 解决方法
2018-04-04 11:23
691 查看
一、执行步骤
1、wget http://www.ruby-lang.org/en/downloads/ 下载最新版本源码,tar -zxvf 解压。
2、cd ruby-2.5.1目录,执行 ./configure 、make 、makeinstall等命令。
3、ruby -v可查看到版本信息。
4、执行gem install --no-rdoc --no-ri tprov,报错如下:
ERROR: Loading command: install (LoadError) cannot load such file -- zlib
ERROR: While executing gem ... (NoMethodError) undefined method `invoke_with_build_args' for nil:NilClass
二、找解决方法
1、cd ruby-2.5.1/ext/zlib目录,执行 ruby ./extconf.rb、make 、make install命令。
2、make时报错(chmod +x Makefile):make: *** No rule to make target `/include/ruby.h', needed by `zlib.o'. Stop.
3、更改Makefile文件, zlib.o: $(top_srcdir)/include/ruby.h 改成 zlib.o: ../../include/ruby.h;到这里就可以make成功了。
4、进入/ruby-2.5.1/ext/openssl目录执行 ruby ./extconf.rb、make 、make install命令。
5、yum install zlib-devel && rvm reinstall 2.5.1
6、这里提示-bash: rvm: command not found,然后执行 curl -L get.rvm.io | bash -s stable,报错为gpg: Can't check signature: No public key,然后执行了gpg2 --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3,再执行curl -L get.rvm.io | bash -s stable,到这里rvm安装成功!
7、然后提示执行source /etc/profile/rvm.sh,执行后rvm -v可以正常输出了。
8、执行gem install --no-rdoc --no-ri tprov,此时就可以成功了。
参考了: https://stackoverflow.com/questions/9727908/cannot-load-such-file-zlib-even-after-using-rvm-pkg-install-zlib http://rensanning.iteye.com/blog/1927921
等等
1、wget http://www.ruby-lang.org/en/downloads/ 下载最新版本源码,tar -zxvf 解压。
2、cd ruby-2.5.1目录,执行 ./configure 、make 、makeinstall等命令。
3、ruby -v可查看到版本信息。
4、执行gem install --no-rdoc --no-ri tprov,报错如下:
ERROR: Loading command: install (LoadError) cannot load such file -- zlib
ERROR: While executing gem ... (NoMethodError) undefined method `invoke_with_build_args' for nil:NilClass
二、找解决方法
1、cd ruby-2.5.1/ext/zlib目录,执行 ruby ./extconf.rb、make 、make install命令。
2、make时报错(chmod +x Makefile):make: *** No rule to make target `/include/ruby.h', needed by `zlib.o'. Stop.
3、更改Makefile文件, zlib.o: $(top_srcdir)/include/ruby.h 改成 zlib.o: ../../include/ruby.h;到这里就可以make成功了。
4、进入/ruby-2.5.1/ext/openssl目录执行 ruby ./extconf.rb、make 、make install命令。
5、yum install zlib-devel && rvm reinstall 2.5.1
6、这里提示-bash: rvm: command not found,然后执行 curl -L get.rvm.io | bash -s stable,报错为gpg: Can't check signature: No public key,然后执行了gpg2 --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3,再执行curl -L get.rvm.io | bash -s stable,到这里rvm安装成功!
7、然后提示执行source /etc/profile/rvm.sh,执行后rvm -v可以正常输出了。
8、执行gem install --no-rdoc --no-ri tprov,此时就可以成功了。
参考了: https://stackoverflow.com/questions/9727908/cannot-load-such-file-zlib-even-after-using-rvm-pkg-install-zlib http://rensanning.iteye.com/blog/1927921
等等
相关文章推荐
- Ruby on Rails 安装出现`require’: cannot load such file — openssl (LoadError)的解决方法
- ERROR: Loading command: search (LoadError) no such file to load -- zlib
- 出现 ruby cannot load such file -- zlib 问题的解决方法
- memcached安装报错 error while loading shared libraries: libevent-2.0.so.5: cannot open shared object file: No such file or directory解决
- mac下安装mysql-python包报unable to execute llvm-gcc-4.2: No such file or directory error: command 'llvm-gcc-4.2' failed with exit status 1解决方法
- error while loading shared libraries: libevent-1.3.so.1:cannot open shared object file :No such file or directory解决方法
- Ruby on Rails安装过程中出现"no such file to load -- mkmf"错误的解决方法。
- error while loading shared libraries: libnet.so.9: cannot open shared object file: No such **解决方法
- mono-3.4.0 源码安装时出现的问题 [do-install] Error 2 [install-pcl-targets] Error 1 解决方法
- 解决:CentOS下的 error while loading shared libraries: libmysqlclient.so.16: cannot open shared object file: No such file or dir
- 解决Linux: error while loading shared libraries: ...: cannot open shared object file: No such file or directory 类似问题
- Ubuntu12.04安装64位系统出现编译错误error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or dir
- Atlas系列一:【已解决】error while loading shared libraries: libcrypto.so.6: cannot open shared object file: No such file or directory
- 错误解决error while loading shared libraries: libXXX.so.X: cannot open shared object file: No such file
- Redis 2.8.18 安装报错 error: jemalloc/jemalloc.h: No such file or directory解决方法
- Ruby 'require' error: cannot load such file
- Ubuntu上安装gem包时报`require': cannot load such file -- openssl (LoadError)
- 错误解决 error while loading shared libraries: libxml2.so.2: cannot open shared object file: No such fil
- install rubyonrails( no such file to load -- zlib )
- Redis 安装报错 error: jemalloc/jemalloc.h: No such file or directory解决方法