简体   繁体   English

Compass不会在新的Ruby版本中创建或编译

[英]Compass will not create or compile in new Ruby version

I have been using Compass for a bit now, and just recently changed the environment on my mac to begin the Ruby on Rails 3 Tutorial . 我现在已经使用Compass了一段时间,最近才在Mac上更改了环境,开始了Ruby on Rails 3教程 After installing Ruby 1.9.3, and re-updating my Ruby Gems, I installed Compass once again. 安装Ruby 1.9.3之后,并重新更新Ruby Gems,我再次安装了Compass。 Now whenever I try to do any command with compass (create, watch, etc) it gives me the same error: 现在,每当我尝试使用指南针执行任何命令(创建,监视等)时,都会出现相同的错误:

You must compile individual stylesheets from the project directory.

I'm completely clueless. 我完全一无所知。 Thanks so much for any pointers. 非常感谢您的任何指点。

Edit: After further exploration, it seems it isn't reading any Compass commands. 编辑:经过进一步的探索,似乎没有读取任何Compass命令。 I can literally try 我可以尝试一下

compass whateverdude

and receive the same error. 并收到相同的错误。

Any ideas? 有任何想法吗?

A workaround would be a bash script setting the full path, something like: 解决方法是使用bash脚本设置完整路径,例如:

#!/bin/bash

name=$1
cd /Users/Envs/dev/
compass watch $name

But this only helps to run compass and doesnt let you do anything else. 但这仅有助于运行指南针,而不能让您执行其他任何操作。 A better solution would be to delete your local ruby 1.9.3 etc. and install rvm . 更好的解决方案是删除本地ruby 1.9.3等,然后安装rvm Use rvm to install ruby 1.9.3 (or different version if you still get the error). 使用rvm安装ruby 1.9.3(如果仍然收到错误,则安装其他版本)。 I recommend running sass/compass from its own rvm gemset for each project. 我建议为每个项目从其自己的rvm gemset运行sass / compass。 Do something like this: 做这样的事情:

$ rvm gemset create myproject
$ rvm gemset use myproject
$ rvm gem install sass
$ rvm gem install compass

After installing everything you start compass with 安装完所有内容后,您可以使用

$ rvm gemset use myproject
$ compass dosomething

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

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