WebSpace上安装的指南针:未找到命令

时间:2015-11-19 08:42:19

标签: ruby linux bash gem compass

我想在托管服务器上的网站空间中使用Compass(无root访问权限)。我按照托管公司提供的教程但到目前为止没有成功:

在我的家庭目录中,我创建了一个.gem dir和一个.gemrc文件:

dependencies

.bashrc文件:

/* .gemrc in home dir */

gemhome: &GemHome /my/home/dir/.gem
gempath:
   - *GemHome
   - /usr/lib/ruby/gems/1.8

重新连接后的一些检查:

export GEM_HOME=/my/home/dir/.gem
export GEM_PATH=/my/home/dir/.gem:/usr/lib/ruby/gems/1.8

安装指南针

[~] echo $GEM_HOME
/my/home/dir/.gem

[~] echo $GEM_PATH
/my/home/dir/.gem:/usr/lib/ruby/gems/1.8

[~] echo $PATH
?/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin

检查安装

[~] gem install compass

Successfully installed compass-core-1.0.3
Successfully installed compass-import-once-1.0.5
Successfully installed chunky_png-1.3.5
Successfully installed rb-fsevent-0.9.6
Successfully installed ffi-1.9.10
Successfully installed rb-inotify-0.9.5
Successfully installed compass-1.0.3
7 gems installed

但是不能使用指南针:

[~] gem list compass -d

*** LOCAL GEMS ***

compass (1.0.3)
    Authors: Chris Eppstein, Scott Davis, Eric M. Suzanne, Brandon
    Mathis, Nico Hagenburger
    Homepage: http://compass-style.org
    Installed at: /my/home/dir/.gem

    A Real Stylesheet Framework

compass-core (1.0.3)
    Authors: Chris Eppstein, Scott Davis, Eric M. Suzanne, Brandon
    Mathis
    Homepage: http://compass-style.org/reference/compass/
    License: MIT
    Installed at: /my/home/dir/.gem

    The Compass core stylesheet library

compass-import-once (1.0.5)
    Author: Chris Eppstein
    Homepage:
    https://github.com/chriseppstein/compass/tree/master/import-once
    License: MIT
    Installed at: /my/home/dir/.gem

    Speed up your Sass compilation by making @import only import each
    file once.


[~] gem which compass
/my/home/dir/.gem/gems/compass-1.0.3/lib/compass.rb

知道我还需要做些什么来让指南针运行?我发现了有关此主题的其他几个讨论,但所有解决方案都针对具有超级访由于我没有服务器的root访问权限:任何其他解决方案?

编辑:更多信息

[~] compass
-bash: compass: command not found

1 个答案:

答案 0 :(得分:1)

您的.gem位置未附加到您的环境变量中。从输出echo $PATH可以看出,它不会附加到您的$PATH环境变量中。

尝试将其附加到$PATH变量

export GEM_HOME=/my/home/dir/.gem/bin
export GEM_PATH=/my/home/dir/.gem:/usr/lib/ruby/gems/1.8

PATH=$PATH:GEM_HOME:GEM_PATH
export PATH

最后做一个source ~/.bashrc

<强>更新

将正确的可执行路径附加到$PATH环境变量将使您的可执行文件在shell环境中可用。

在此特定方案中,可执行位置为/my/home/dir/.gem/bin