gpt4 book ai didi

sass - 'grunt compass' 抛出它不在系统路径中的错误

转载 作者:行者123 更新时间:2023-12-04 21:42:19 24 4
gpt4 key购买 nike

我对使用 grunt、compass 和 sass 很陌生,并且无法使其正常工作。我使用 Drupal 7 安装了 Redhat,当我尝试从站点的主题目录中运行“grunt compass”时,出现以下错误:

Running "compass:dist" (compass) task
Warning: 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.

Aborted due to warnings.

我已经安装了 Grunt、Bower,并使用 'bundle install' 来安装所需的 gem。当我运行“ gem 列表”时,我得到以下信息:
bigdecimal (1.2.4)
breakpoint (2.0.7)
bundler (1.6.2)
bundler-unload (1.0.2)
chunky_png (1.3.1)
compass (0.12.6)
compass-normalize (1.4.3)
executable-hooks (1.3.1)
fssm (0.2.10)
gem-wrappers (1.2.4)
io-console (0.4.2)
json (1.8.1)
kss (0.5.0)
minitest (4.7.5)
psych (2.0.3)
rake (10.1.0)
rdoc (4.1.0)
ruby (0.1.0)
rubygems-bundler (1.4.3)
rubygems-update (2.2.2)
rvm (1.11.3.9)
sass (3.2.19)
test-unit (2.1.1.0)
zurb-foundation (4.3.2)

所以看来我拥有所有需要的 gem 。然后我通过“echo $PATH”查看了我的 PATH 设置并得到以下信息:
/home/ec2-user/.rvm/gems/ruby-2.1.1/bin:/home/ec2-user/.rvm/gems/ruby-2.1.1@global/bin:/home/ec2-user/.rvm/rubies/ruby-2.1.1/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/aws/bin:/home/ec2-user/bin:/home/ec2-user/.rvm/bin

我查看了路径,发现在/usr/bin 中有 ruby​​2.0,在/home/ec2-user/bin 中有 compass,所以安装似乎在系统 PATH 中。

当我从命令行运行“ruby2.0”时,我得到以下信息:
/usr/local/share/ruby/site_ruby/2.0/rubygems/ext/builder.rb:12:in `<class:Builder>':  uninitialized constant Gem::UserInteraction (NameError)
from /usr/local/share/ruby/site_ruby/2.0/rubygems/ext/builder.rb:10:in `<top (required)>'
from /usr/local/share/ruby/site_ruby/2.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/share/ruby/site_ruby/2.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/share/ruby/site_ruby/2.0/rubygems/ext.rb:13:in `<top (required)>'
from /usr/local/share/ruby/site_ruby/2.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/share/ruby/site_ruby/2.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/share/ruby/site_ruby/2.0/rubygems/specification.rb:1431:in `build_extensions'
from /usr/local/share/ruby/site_ruby/2.0/rubygems/stub_specification.rb:60:in `build_extensions'
from /usr/local/share/ruby/site_ruby/2.0/rubygems/basic_specification.rb:56:in `contains_requirable_file?'
from /usr/local/share/ruby/site_ruby/2.0/rubygems/specification.rb:925:in `block in find_inactive_by_path'
from /usr/local/share/ruby/site_ruby/2.0/rubygems/specification.rb:924:in `each'
from /usr/local/share/ruby/site_ruby/2.0/rubygems/specification.rb:924:in `find'
from /usr/local/share/ruby/site_ruby/2.0/rubygems/specification.rb:924:in `find_inactive_by_path'
from /usr/local/share/ruby/site_ruby/2.0/rubygems.rb:185:in `try_activate'
from /usr/local/share/ruby/site_ruby/2.0/rubygems/core_ext/kernel_require.rb:132:in `rescue in require'
from /usr/local/share/ruby/site_ruby/2.0/rubygems/core_ext/kernel_require.rb:144:in `require'
from /usr/local/share/ruby/site_ruby/2.0/rubygems/user_interaction.rb:8:in `<top (required)>'
from /usr/local/share/ruby/site_ruby/2.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/share/ruby/site_ruby/2.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/share/ruby/site_ruby/2.0/rubygems/config_file.rb:7:in `<top (required)>'
from /usr/local/share/ruby/site_ruby/2.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/share/ruby/site_ruby/2.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/share/ruby/site_ruby/2.0/rubygems/specification.rb:1430:in `build_extensions'
from /usr/local/share/ruby/site_ruby/2.0/rubygems/stub_specification.rb:60:in `build_extensions'
from /usr/local/share/ruby/site_ruby/2.0/rubygems/basic_specification.rb:56:in `contains_requirable_file?'
from /usr/local/share/ruby/site_ruby/2.0/rubygems/specification.rb:925:in `block in find_inactive_by_path'
from /usr/local/share/ruby/site_ruby/2.0/rubygems/specification.rb:924:in `each'
from /usr/local/share/ruby/site_ruby/2.0/rubygems/specification.rb:924:in `find'
from /usr/local/share/ruby/site_ruby/2.0/rubygems/specification.rb:924:in `find_inactive_by_path'
from /usr/local/share/ruby/site_ruby/2.0/rubygems.rb:185:in `try_activate'
from /usr/local/share/ruby/site_ruby/2.0/rubygems/core_ext/kernel_require.rb:132:in `rescue in require'
from /usr/local/share/ruby/site_ruby/2.0/rubygems/core_ext/kernel_require.rb:144:in `require'
from <internal:abrt_prelude>:2:in `<compiled>'

当我简单地运行“ ruby ”时,什么也没有发生。 'grunt compass' 是否正在寻找 'ruby' 而我有 'ruby2.0'?我需要用 ruby​​ -> ruby​​2.0 创建一个符号链接(symbolic link)吗?

当我从命令行运行“指南针”时,我得到:

用法:指南针帮助[命令]
Description:
The Compass Stylesheet Authoring Framework helps you
build and maintain your stylesheets and makes it easy
for you to use stylesheet libraries provided by others.

等等。

任何想法将不胜感激

最佳答案

我已经对此进行了一些研究,以下内容对我有用...

如果您通过 CLI 安装了带有 Ruby 和 Compass 的 Windows 版本,请尝试;

  • 控制面板 > 系统 > 高级系统设置
  • 高级 > 环境变量
  • 在系统变量下搜索“路径”变量,其值应为
  • 最后点击编辑添加;C:\Ruby193\bin在变量值的最后。

  • 这应该可以解决问题。

    请注意 ;C:\Ruby193\bin指在你的机器上安装 Ruby > Compass。

    如果你有一个 Mac 版本,那么类似的修复版本可能适用于 Mac,但我无法为你映射,谷歌搜索可能会有所帮助......

    关于sass - 'grunt compass' 抛出它不在系统路径中的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23388558/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com