我用gulp构建了一个html项目。对于一些css工作人员,我用罗盘来建造。 我的任务如下
gulp.task('compass',function(){
gulp.src('public_html/app/scss/style.scss')
//.pipe(plumber())
.pipe(compass({
config_file: './config.rb',
css: 'public_html/app/css',
sass: 'public_html/app/scss',
require: ['susy']
}))
//.pipe(autoprefixer('last 2 versions'))
.pipe(gulp.dest('public_html/app/css'))
.pipe(reload({stream:true}));
});
当我构建为gulp指南针时,我有错误
LoadError on line ["55"] of ~/.rbenv/versions/2.3.1/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb: cannot load such file -- susy
Run with --trace to see the full backtrace
events.js:72
throw er; // Unhandled 'error' event
^
Error: Compass failed
我在确切文件夹中有该文件kernel_require.rb。 我将PATH导出为
export PATH=$PATH:~/.rbenv/versions/2.3.1/lib
export PATH=$PATH:~/.rbenv/versions/2.3.1/lib/ruby/site_ruby/2.3.0/rubygems/core_ext
但是没有用。如何解决这个错误?
由于
编辑:
gem list
*** LOCAL GEMS ***
cairo (1.12.8)
chunky_png (1.3.7)
compass-core (1.0.3)
compass-import-once (1.0.5)
execjs (2.7.0)
gettext (3.0.3)
locale (2.1.0)
multi_json (1.12.1)
rb-fsevent (0.9.7)
rdoc (3.9.4)
sass (3.4.22)
susy (2.2.12)
text (1.2.1)
nyan@nyan-Inspiron-7537:~$ susy -v
susy: command not found
答案 0 :(得分:1)
您错误地解释了错误消息:
LoadError
第一部分require 'this/file/does/not/exist'
告诉您遇到了什么类型的错误; the documentation for LoadError个州,
当需要的文件(Ruby脚本,扩展库,...)无法加载时引发。
LoadError: no such file to load -- this/file/does/not/exist
提出异常:
on line ["55"] of ~/.rbenv/versions/2.3.1/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:
错误消息的下一部分cannot load such file -- susy
告诉您发生错误的位置,也就是说,某段代码称为另一段代码,它调用另一段代码,最终导致文件' kernel_require.rb'的第55行,这是RubyGems基础结构的一部分。该行最终是触发LoadError的原因。
错误消息的最后一部分require: ['susy']
为您提供有关问题的详细信息;特别是,在这样的LoadError的情况下,它告诉你它试图加载(和失败)的文件:' susy'。
这一切都归结为你的gulp文件gem install susy
中有一个指令,但没有' susy'宝石安装。正如您所发现的,安装' susy' (susy -v
)解决了这个问题。
您还注意到命令行上的public class CR2 {
public static void main( String args[] )
{
Scanner input = new Scanner( System.in );
int amountdue;
int amountreceived;
System.out.print( "Enter the amount due: " );
if (input.hasNextInt() )
{
{
amountdue = input.nextInt();
System.out.print( "Enter the amount you are paying: " ); // prompt
amountreceived = input.nextInt(); // read second number from user
}
if ( amountdue > amountreceived )
System.out.println( "The amount due must be less then or equal to th amount you are paying");
int change = amountreceived - amountdue;
int fifty =5000; int twenty = 2000; int ten = 1000; int five = 500;
int two = 200; int one = 100; int fiftycent= 50; int twentycent = 20; int tencent = 10;
int fivecent = 5; int twocent = 2; int onecent = 1;
if (change > fifty)
{ int changefifty = (change/fifty);
int leftover = change - fifty * changefifty;
System.out.println( "50 euro notes amount " + changefifty );
System.out.println(leftover);
}
}else { System.out.println("Enter an integer next time"); }
}
}
发出错误,但这是一个红色的鲱鱼; the susy gem不安装任何命令行工具,只安装Ruby代码。