Ruby gems不可用 - mac,可能是PATH问题 [英] Ruby gems not available - mac, probably PATH issue

查看:371
本文介绍了Ruby gems不可用 - mac,可能是PATH问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题



我无法正确安装红宝石,下面是我尝试安装和运行厨师的操作:

  $ gem install chef&&厨师
成功安装厨师-11.6.0
为厨师-11.6.0解析文档
1安装了宝石
bash:厨师:找不到命令

我的路径是:

  $ echo $ PATH 
/Users/mcarey/.rvm/gems/ruby-2.0.0-p0/bin:/Users/mcarey/.rvm/gems/ruby-2.0.0-p0@global/bin:/用户/ mcarey / .rvm /红宝石/红宝石2.0.0-P0 /斌:/Users/mcarey/.rvm/bin:在/ usr / bin中:/ bin中:/ usr / sbin目录:/ sbin目录:在/ usr /本地/ bin:/Users/mcarey/.rvm/gems/ruby-2.0.0-p0/gems



背景/历史



直到我不小心(长话短说)创建了代字号(〜)目录,然后尝试用'rm -R〜 ',这当然开始删除我的主目录,但一旦它遇到了第一个要求许可的受保护文件,我就取消了它。我的老〜/ .bash_profile已被删除,但我不知道还有什么。



有什么想法?如果你删除了〜/ .bash_profile文件,我认为Gems会一直工作,直到你修复你的文件为止。这个新文件的路径。因此:


  1. 确保您已在主文件夹
    中重新创建了〜/ .bash_profile文件(终端命令: mate〜/ .profile

  2. 检查这行是否存在 export PATH =/ usr / local / bin: / usr / local / sbin:$ PATH

  3. 如果此行不存在,请将其添加到您的文件中。 >保存文件

  4. 检查文件是否正确输入。 〜/ .profile 在终端中

我想你的问题只是一个路径问题,但如果你面对另一个问题是链接在哪里可以找到更多信息



但是,如果您的路径正确,您可以尝试使用您的gem:


  1. 转到您的应用程序根文件夹
  2. 捆绑安装

  3. bundle exec bower
  4. code>

=>可能帮助:检查github和google中的文档ifound 本文
有可能使用凉亭

 宝石宝贝 -rails,〜> 0.4.4

我希望这可以帮助: p>

The Problem

I can't install ruby gems properly, here's what I get trying to install and run chef:

$ gem install chef && chef
Successfully installed chef-11.6.0
Parsing documentation for chef-11.6.0
1 gem installed
bash: chef: command not found

My path is:

$ echo $PATH
/Users/mcarey/.rvm/gems/ruby-2.0.0-p0/bin:/Users/mcarey/.rvm/gems/ruby-2.0.0-p0@global/bin:/Users/mcarey/.rvm/rubies/ruby-2.0.0-p0/bin:/Users/mcarey/.rvm/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/mcarey/.rvm/gems/ruby-2.0.0-p0/gems

Background/History

It was all working fine until I accidentally (long story short) created a tilde (~) directory and then tried to remove it with 'rm -R ~', this of course started deleting my home directory but once it hit the first protected file it asked for permission and I cancelled it. My old ~/.bash_profile was removed but I'm not sure what else went.

Any thoughts? Any extra info needed?

解决方案

If you deleted your ~/.bash_profile file, I think that Gems will work until you fix your path in this new file. So :

  1. Be sure that you have recreated your ~/.bash_profile file in your home folder (terminal command : mate ~/.profile)
  2. Check if this line exists export PATH="/usr/local/bin:/usr/local/sbin:$PATH"
  3. if this line does not exist, add this in your file
  4. save the file
  5. To check if the file is correct input . ~/.profile in the terminal

I guess your probleme is only a path problem but if you face with another problem here is a link where to find more info

But if your path is correct you can try to use your gem this way:

  1. Go to your application root folder
  2. bundle install
  3. bundle exec bower

=> MAYBE THIS CAN HELP : Checking documentation in github and google, ifound this article there is a possibility to use the bower-rails gem.

in your Gemfile:

gem "bower-rails", "~> 0.4.4"

I hope this will help :)

这篇关于Ruby gems不可用 - mac,可能是PATH问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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