开发者

Ruby Gem Guard on Ubuntu, no 'guard' command

Trying to install Guard 开发者_开发技巧on my ubuntu machine, but when I try to run it from command line I get this error:

No command 'guard' found, did you mean:
 Command 'guards' from package 'quilt' (main)
guard: command not found

All my other gems work fine from command line, so the gems path is good. gem list shows guard (0.5.1) and guard-rspec (0.4.0). I also installed libnotify and rb-inotify

What am I missing?


Try bundle exec guard [rest of command].


I had no issues setting up the guard-rspec gem on Ubuntu. I assume you do not use sudo to install your gems. This would cause a problem.

Update in response to comment regarding installing gems using sudo.

If you sudo gem install - which you really should not do - then your terminal will have no access to the gem. If this is the case then uninstall all your gems then re-install using bundle, rvm or whatever without the sudo command. On Ubuntu when you use the command shell you are not logged in as root.

I highly recommend you use rvm to manage your gems. They will be installed to your home folder See here for more details https://rvm.io End of update

If your really have to sudo install your gems then you will have to sudo run them as well and as your app is not run under a sudo shell this will cause issues.

I suggest you check the name of your gem in your gemfile.rb it should be gem "guard-rspec"

define this in your test group and make sure you run bundle install.

One major benefit of using Ubuntu is that you can also use the libnotify and libnotify-rails gems which work beautifully well. You will see a message about this after you have run guard rspec:install and then guard for the first time. Check the messages carefully you will be very pleasantly surprised.

The libnotify gems give you a popup window that tells you the state of your tests every time they run. It's totally awesome


Try

gem install guard

or add

gem 'guard', '~> 2.14', '>= 2.14.1'

to the Gemfile. Run

bundle install

See Guard docs

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜