[英]Ubuntu 16.04: Error return on gem install bundler
I've been getting a return,我一直在得到回报,
~$ gem install bundler
ERROR: Loading command: install (LoadError)
cannot load such file -- zlib
ERROR: While executing gem ... (NoMethodError)
undefined method `invoke_with_build_args' for nil:NilClass
When trying to install Jekyll via gem bundler尝试通过 gem bundler 安装 Jekyll 时
I've found lots of resources of others getting this error such as,我发现其他人的很多资源都收到此错误,例如,
I've recompiled ruby after sudo apt-get libssl-dev
as well as a few other dep/libs I could think of,我在sudo apt-get libssl-dev
以及我能想到的其他一些 dep/libs 之后重新编译了 ruby,
but no results.但没有结果。 Any other ideas someone has?有人有其他想法吗?
Setup: Dell 2120 Ubuntu 16.04 LTS设置:戴尔 2120 Ubuntu 16.04 LTS
The package zlib is missing and causes the installer to fail.软件包 zlib 丢失并导致安装程序失败。
You need to install it like:您需要像这样安装它:
sudo apt-get install zlib1g-dev
What worked for me was following the respective issue on the official Jekyll repository in GitHub.对我有用的是关注 GitHub 中官方 Jekyll 存储库上的相应问题。
Remove any previously installed versions:删除任何以前安装的版本:
sudo apt-get purge jekyll
sudo apt-get purge ruby
Install ruby anew:重新安装 ruby:
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties
sudo apt-get install libgdbm-dev libncurses5-dev automake libtool bison libffi-dev
curl -L https://get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm
echo "source ~/.rvm/scripts/rvm" >> ~/.bashrc
rvm install
rvm install 2.4.1
rvm use 2.4.1 --default
Make sure you have, NodeJS and Python installed, if not - do so by:确保你已经安装了 NodeJS 和 Python,如果没有 - 这样做:
sudo apt-get install node
sudo add-apt-repository ppa:jonathonf/python-3.6
sudo apt-get update
sudo apt-get install python3.6
And at last,最后,
gem install jekyll
jekyll -v
jekyll 3.4.3
Of course, now you could execute gem install bundler
smoothly, too.当然,现在你也可以顺利执行gem install bundler
了。
Hope this helps!希望这可以帮助!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.