试图安装Way Guard Laravel

时间:2013-12-27 12:03:49

标签: ruby laravel gem laravel-4 guard

我正在尝试安装Way / Guard-laravel

我在终端收到一个巨大的错误。我对ruby和Gems一无所知,我也不想冒险尝试调试这个问题。

这是错误

Joels-iMac:work2 joelcox$ art guard:make
Ensuring that you have all required plugins...
Installing guard-phpunit...
ERROR:  While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /usr/bin directory.
The guard-phpunit gem has been installed.
Do you require CSS preprocessing? [yes|no]no 
What about CoffeeScript support? [yes|no]no
Created Guardfile
Joels-iMac:work2 joelcox$ php artisan guard:watch
05:37:46 - ERROR - Could not load 'guard/phpunit' or find class Guard::Phpunit
05:37:46 - ERROR -/Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'

[#] /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
[#] /Library/Ruby/Gems/2.0.0/gems/guard-2.2.5/lib/guard/plugin_util.rb:100:in `plugin_class'
[#] /Library/Ruby/Gems/2.0.0/gems/guard-2.2.5/lib/guard/plugin_util.rb:57:in `initialize_plugin'
[#] /Library/Ruby/Gems/2.0.0/gems/guard-2.2.5/lib/guard.rb:167:in `add_plugin'
[#] /Library/Ruby/Gems/2.0.0/gems/guard-2.2.5/lib/guard/dsl.rb:176:in `block in guard'
[#] /Library/Ruby/Gems/2.0.0/gems/guard-2.2.5/lib/guard/dsl.rb:174:in `each'
[#] /Library/Ruby/Gems/2.0.0/gems/guard-2.2.5/lib/guard/dsl.rb:174:in `guard'
[#] /Applications/MAMP/htdocs/work2/Guardfile:10:in `_instance_eval_guardfile'
[#] /Library/Ruby/Gems/2.0.0/gems/guard-2.2.5/lib/guard/guardfile/evaluator.rb:121:in `instance_eval'
[#] /Library/Ruby/Gems/2.0.0/gems/guard-2.2.5/lib/guard/guardfile/evaluator.rb:121:in `_instance_eval_guardfile'
[#] /Library/Ruby/Gems/2.0.0/gems/guard-2.2.5/lib/guard/guardfile/evaluator.rb:37:in `evaluate_guardfile'
[#] /Library/Ruby/Gems/2.0.0/gems/guard-2.2.5/lib/guard/setuper.rb:144:in `evaluate_guardfile'
[#] /Library/Ruby/Gems/2.0.0/gems/guard-2.2.5/lib/guard/setuper.rb:62:in `setup'
[#] /Library/Ruby/Gems/2.0.0/gems/guard-2.2.5/lib/guard/commander.rb:24:in `start'
[#] /Library/Ruby/Gems/2.0.0/gems/guard-2.2.5/lib/guard/cli.rb:96:in `start'
[#] /Library/Ruby/Gems/2.0.0/gems/thor-0.18.1/lib/thor/command.rb:27:in `run'
[#] /Library/Ruby/Gems/2.0.0/gems/thor-0.18.1/lib/thor/invocation.rb:120:in `invoke_command'
[#] /Library/Ruby/Gems/2.0.0/gems/thor-0.18.1/lib/thor.rb:363:in `dispatch'
[#] /Library/Ruby/Gems/2.0.0/gems/thor-0.18.1/lib/thor/base.rb:439:in `start'
[#] /Library/Ruby/Gems/2.0.0/gems/guard-2.2.5/bin/guard:6:in `<top (required)>'
[#] /usr/bin/guard:23:in `load'
[#] /usr/bin/guard:23:in `<main>'

05:37:46 - ERROR - Invalid Guardfile, original error is:

[#] undefined method `superclass' for nil:NilClass

/Library/Ruby/Gems/2.0.0/gems/guard-2.2.5/lib/guard/plugin_util.rb:57:in 
`initialize_plugin': undefined method `superclass' for nil:NilClass 
(NoMethodError)
  from /Library/Ruby/Gems/2.0.0/gems/guard-2.2.5/lib/guard.rb:167:in `add_plugin'
  from /Library/Ruby/Gems/2.0.0/gems/guard-2.2.5/lib/guard/dsl.rb:176:in `block in guard'
  from /Library/Ruby/Gems/2.0.0/gems/guard-2.2.5/lib/guard/dsl.rb:174:in `each'
  from /Library/Ruby/Gems/2.0.0/gems/guard-2.2.5/lib/guard/dsl.rb:174:in `guard'
  from /Applications/MAMP/htdocs/work2/Guardfile:10:in `_instance_eval_guardfile'
  from /Library/Ruby/Gems/2.0.0/gems/guard-2.2.5/lib/guard/guardfile/evaluator.rb:121:in `instance_eval'
  from /Library/Ruby/Gems/2.0.0/gems/guard-2.2.5/lib/guard/guardfile/evaluator.rb:121:in `_instance_eval_guardfile'
  from /Library/Ruby/Gems/2.0.0/gems/guard-2.2.5/lib/guard/guardfile/evaluator.rb:37:in `evaluate_guardfile'
  from /Library/Ruby/Gems/2.0.0/gems/guard-2.2.5/lib/guard/setuper.rb:144:in `evaluate_guardfile'
  from /Library/Ruby/Gems/2.0.0/gems/guard-2.2.5/lib/guard/setuper.rb:62:in `setup'
  from /Library/Ruby/Gems/2.0.0/gems/guard-2.2.5/lib/guard/commander.rb:24:in `start'
  from /Library/Ruby/Gems/2.0.0/gems/guard-2.2.5/lib/guard/cli.rb:96:in `start'
  from /Library/Ruby/Gems/2.0.0/gems/thor-0.18.1/lib/thor/command.rb:27:in `run'
  from /Library/Ruby/Gems/2.0.0/gems/thor-0.18.1/lib/thor/invocation.rb:120:in `invoke_command'
  from /Library/Ruby/Gems/2.0.0/gems/thor-0.18.1/lib/thor.rb:363:in `dispatch'
  from /Library/Ruby/Gems/2.0.0/gems/thor-0.18.1/lib/thor/base.rb:439:in `start'
  from /Library/Ruby/Gems/2.0.0/gems/guard-2.2.5/bin/guard:6:in `<top (required)>'
  from /usr/bin/guard:23:in `load'
  from /usr/bin/guard:23:in `<main>'

1 个答案:

答案 0 :(得分:1)

消息

"You don't have write permissions for the /usr/bin directory."

告诉您需要以root身份运行它:

sudo art guard:make

我有一个问题显示如何在Ubuntu上安装它,如果有任何进一步的问题,它可能会帮助你在Mac上:https://github.com/JeffreyWay/Laravel-Guard/issues/9

修改

在安装Way / Guard之前,您可能需要安装Ruby和Guard,所以,

看看Guard项目:https://github.com/guard/guard

这将告诉您在Mac OS上为Ruby添加正确的Readline支持:https://github.com/guard/guard/wiki/Add-Readline-support-to-Ruby-on-Mac-OS-X