Gem activemerchant 的 gem 一直安装不成功?

runup · 2014年04月10日 · 最后由 jiang 回复于 2016年03月15日 · 5722 次阅读

把最新的 agile web development with rails 代码下来,运行项目时 gem activemerchant 一直安装不成功。

Bundler::GemspecError: Could not read gem at /usr/local/rvm/gems/ruby-2.0.0-p451@railstutorial_rails_4_0/cache/activemerchant-1.42.8.gem. It may be corrupted.
An error occurred while installing activemerchant (1.42.8), and Bundler cannot
continue.
Make sure that `gem install activemerchant -v '1.42.8'` succeeds before
bundling.

求解?是否是因为缺少源?换成了淘宝镜像也不成功。系统是 ubuntu13.10,项目是 rails4,ruby2.

删掉 /usr/local/rvm/gems/ruby-2.0.0-p451@railstutorial_rails_4_0/cache/activemerchant-1.42.8.gem 重装看看?

#1 楼 @lulalala railstutorial_rails_4_0 这个东西是我做其他项目用的,不知道为什么会出现在这里?

#1 楼 @lulalala 问题解决,非常感谢前辈,不过不知道是因为什么原因

#3 楼 @runup 原因是 gem 下载了一半断掉了,再次安装的时候以为有 cache

#3 楼 @runup 求你的解决办法,我也遇到这个问题了。 Gem::FilePermissionError: You don't have write permissions for the /Users/os/.rvm/gems/ruby-1.9.3-p547/bin directory. An error occurred while installing activemerchant_patch_for_china (0.1.6), and Bundler cannot continue. Make sure that gem install activemerchant_patch_for_china -v '0.1.6' succeeds before bundling. 愁人呀。希望有时间给个解决的办法,非常感谢!

#4 楼 @huacnlee 请问您是怎么清除 gem 的 cache 的? 我现在的错误是 Gem::FilePermissionError: You don't have write permissions for the /Users/os/.rvm/gems/ruby-1.9.3-p547/bin directory. An error occurred while installing activemerchant_patch_for_china (0.1.6), and Bundler cannot continue. Make sure that gem install activemerchant_patch_for_china -v '0.1.6' succeeds before bundling. 希望能得到您的解决。非常感谢。

#8 楼 @zhaghe You don't have write permissions for the /Users/os/.rvm/gems/ruby-1.9.3-p547/bin directory

没权限

#7 楼 @zhaghe 删除 cache 就可以,我的是这样的

#10 楼 @runup 具体怎么操作呀?不是太懂,也查了好多。没找到。谢谢你了。

#9 楼 @huacnlee 那具体怎么操作呢?谢谢你了。

#12 楼 @zhaghe

提示你 ~/.rvm 那个目录没有权限

os 这个是你系统帐号么?

试试这样:

sudo chown -r `whoami` ~/.rvm

#13 楼 @huacnlee 我按照你写的运行了命令是这样的: zhang:idea os$ sudo chown -r whoami ~/.rvm chown: illegal option -- r usage: chown [-fhv] [-R [-H | -L | -P]] owner[:group] file ... chown [-fhv] [-R [-H | -L | -P]] :group file ... 可是我 bundle 还是不行,提示: zhang:idea os$ bundle /Users/os/.rvm/gems/ruby-1.9.3-p547@global/gems/bundler-1.6.2/lib/bundler.rb:301: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777 Fetching source index from http://ruby.taobao.org/ Using rake 0.9.2.2 Using Platform 0.4.0 Using open4 1.3.0 Using POpen4 0.1.4 Using RedCloth 4.2.9 Using multi_json 1.3.6 Using activesupport 3.1.4 Using builder 3.0.0 Using i18n 0.6.0 Using activemodel 3.1.4 Using erubis 2.7.0 Using rack 1.3.6 Using rack-cache 1.2 Using rack-mount 0.8.3 Using rack-test 0.6.1 Using hike 1.2.1 Using tilt 1.3.3 Using sprockets 2.0.4 Using actionpack 3.1.4 Using active_utils 1.0.4 Using json 1.7.4 Using money 5.0.0 Using nokogiri 1.5.5 Using activemerchant 1.27.0

Gem::FilePermissionError: You don't have write permissions for the /Users/os/.rvm/gems/ruby-1.9.3-p547/bin directory. An error occurred while installing activemerchant_patch_for_china (0.1.6), and Bundler cannot continue. Make sure that gem install activemerchant_patch_for_china -v '0.1.6' succeeds before bundling.

不好意思,还得麻烦您。感谢。

#13 楼 @huacnlee 真的感谢你,谢谢你耐心的解答,我自己弄好了。谢谢。

#1 楼 @lulalala Mac 也出现这个问题,去哪里删除这个

@vkongkong 要先看看你的 error log

#15 楼 @zhaghe 您好,您的这个问题怎么解决了呀????求解答,,,,我的扣扣:::3208059778

需要 登录 后方可回复, 如果你还没有账号请 注册新账号