如何在OS 10.6.6 Ruby 1.8和Rails 3上更改安装ruby gem的路径 [英] How to change the path where ruby gems are installed on OS 10.6.6 Ruby 1.8 and Rails 3

查看:102
本文介绍了如何在OS 10.6.6 Ruby 1.8和Rails 3上更改安装ruby gem的路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的宝石是否使用 gem install bundle install ,它们不起作用。有时候 sudo gem install 让gem工作。我运行了 gem list -d 这是gem 命令,而且似乎我的系统配置为所有gem会被安装到/Library/Ruby/Gems/1.8中,但我的环境希望它们位于/ usr / bin / gem中。我怎么能正确地纠正这一点?我的印象是'bundle'应该能够安装gem的本地应用程序特定副本吗?

会建议使用RVM(Ruby版本管理器)来控制你正在安装宝石的Ruby版本。它还有助于将所有包和宝石数据保存在您的主目录中的文件夹中。


Whether I use gem install or bundle install for my gems, they don't work. Sometimes sudo gem install gets gems to work. I ran the gem list -d and which gem commands, and it seems that my system is configured such that all the gems get installed into " /Library/Ruby/Gems/1.8" but my environment expects them in "/usr/bin/gem". How could I properly correct this? I was under the impression that 'bundle' should be able to install a local, application specific copy of a gem?

解决方案

I would suggest using RVM (Ruby Version Manager) to control which version of Ruby you are installing your gems into. It will also help keep all the bundle and gem data in a folder in your home directory.

这篇关于如何在OS 10.6.6 Ruby 1.8和Rails 3上更改安装ruby gem的路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆