简体   繁体   English

OSX优胜美地Ruby和指南针问题

[英]OSX Yosemite Ruby and Compass Issue

I setup Ruby through Homebrew and had Compass and Sass installed on my machine which was running 10.9 (Mavericks). 我通过Homebrew设置了Ruby,并在运行10.9(Mavericks)的计算机上安装了Compass和Sass。 Since I've done the update to 10.10 (Yosemite), when I run grunt serve on my Yeoman project, I get this error: 因为我已经完成了对10.10(Yosemite)的更新,所以当我在Yeoman项目上运行grunt serve时,出现以下错误:

You need to have Ruby and Compass installed and in your system PATH for this task to work. More info: https://github.com/gruntjs/grunt-contrib-compass Use --force to continue.

Any idea what could have borked this? 知道是什么让这个烦恼吗? It worked perfectly before. 以前效果很好。

UPDATE: 更新:

which ruby returns this: which ruby返回此:

/Users/realph/.rbenv/shims/ruby

$PATH returns this: $PATH返回以下内容:

-bash: /Users/realph/.rbenv/shims:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin: No such file or directory

I've never really understood the whole $PATH thing, I just remember reading somewhere that it's good to change it from where OSX points it by default. 我从来没有真正理解过整个$PATH的内容,我只是记得读过某个地方,将其更改为默认情况下OSX指向它的位置是件好事。 And I decided to go the Homebrew route. 我决定走自制路线。

If anyone could help also explain this, I would really appreciate it. 如果有人可以帮助解释这一点,我将非常感谢。

I have this in my bash_profile. 我的bash_profile中有这个。 I get to it by opening up terminal, then: 我通过打开终端来实现,然后:

nano ~/.bash_profile

Add this to the very top: 将此添加到最顶部:

export PATH="/usr/local/bin:$PATH"
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"

To save and exit: 要保存并退出:

ctrl + x

then 然后

press y to save and hit enter to exit

Close your terminal and reopen then try running your rails commands 关闭终端并重新打开,然后尝试运行rails命令

If for some reason you do not have a bash profile, create one: http://redfinsolutions.com/blog/creating-bashprofile-your-mac 如果由于某种原因您没有bash配置文件,请创建一个: http : //redfinsolutions.com/blog/creating-bashprofile-your-mac

I follow instructions like this, but it always amuses me...I had followed an earlier tutorial that had slightly different instructions...from gorails...but it didn't quite work then I tried your path method, still no go finally the gem install compass fixed my sitch. 我遵循这样的指示,但是它总是让我感到很开心。。。终于,宝石安装指南针固定了我的脚。 (i'm only using compass and not anything else, so there was prob an easier way) (我只使用指南针,而没有其他任何东西,所以有一种更简单的方法)

I'm on Yosemite 我在优胜美地

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM