Ubuntu 16.04在搭建Redis Cluster搭建时,使用gem install redis时出现:ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /var/lib/gems/2.3.0 directory.
2017-10-05 15:56
423 查看
注意:千万不要使用sudo来执行gem install redis。
解决方法:
最后安装
如果不想使用上面的方法,可以使用以下的投机取巧的方法,给上面错误的文件夹增加权限
说明:administrator为当前登录的用户,根据实际情况更改。
然后再次执行
参考:
https://gepolv.github.io/ubuntu/ruby/bundler/2016/06/21/gem-install-bundle-issue-on-ubuntu.html
解决方法:
sudo apt-get update 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 libffi-dev cd git clone https://github.com/rbenv/rbenv.git ~/.rbenv echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc echo 'eval "$(rbenv init -)"' >> ~/.bashrc exec $SHELL git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc exec $SHELL rbenv install 2.3.1 rbenv global 2.3.1 ruby -v
最后安装
gem install redis rbenv rehash
如果不想使用上面的方法,可以使用以下的投机取巧的方法,给上面错误的文件夹增加权限
sudo chmod 777 /var/lib/gems/2.3.0/
sudo chown -R administrator /var/lib/gems
说明:administrator为当前登录的用户,根据实际情况更改。
然后再次执行
gem install redis
参考:
https://gepolv.github.io/ubuntu/ruby/bundler/2016/06/21/gem-install-bundle-issue-on-ubuntu.html
相关文章推荐
- 使用redis-trib.rb搭建Redis集群(Ubuntu 16.04)
- Ubuntu系统 cmake 时出现错误:fatal error: pyconfig.h: No such file or directory
- ubuntu 编译是出现 error: openssl/rsa.h: No such file or directory
- MinGW在Win7下的按装、设置和使用,出现error: SDKDDKVer.h: No such file or directory
- Ubuntu 16.04出现:qmake: could not exec '/usr/lib/x86_64-linux-gnu/qt4/bin/qmake': No such file or directory
- (ubuntu) pip install scandir 时出现错误 fatal error: Python.h: No such file or directory
- ubuntu16.04 Error: libcudart.so.7.5: cannot open shared object file: No such file or directory最新解决方案
- python使用urllib.urlretrieve时出现“IOError:[Errno 2] No such file or directory”解决办法
- npm install命令运行中出现Error: ENOENT: no such file or directory解决方法
- Ubuntu 16.04使用NASM编译时用ld链接程序出现:i386 架构于输入文件 sandbox.o 与 i386:x86-64 输出不兼容(I386 architecture in the input file sandbox.o is not compatible with i386: x86-64 output)
- Ubuntu出现错误 ----Fatal error: Python.h: No such file or Directory
- ubuntu16.04 import caffe 出现libcblas.so.3:cannot open shared object file:NO such file or directory
- redis源码安装出现fatal error: jemalloc/jemalloc.h: No such file or directory
- [RK_2014_0920]ubuntu下,使用ldconfig解决:error while loading shared libraries: libpcap.so.1: cannot open shared object file: No such file or directory
- 安装Win7和Ubuntu12.04双系统后,意外删除Ubuntu12.04引导文件,出现error:unknown filesystem;grub rescue>错误的解决方案
- make时出现txc_dxtn.h:28:19: fatal error: GL/gl.h: No such file or directory的解决办法
- xcode修改代码目录结构出现clang: error: no such file or directory 解决方法
- 编译Linux内核时出现“fatal error: linux/netfilter/xt_dscp: No such file or directory”
- 当进行make命令学习是出现error trying to exec 'cc1': execvp: No such file or directory
- 在Ubuntu安装完成后更改默认的语言LANG,出现Cannot set LC_CTYPE to default locale: No such file or directory错误的解决办法