bundler:找不到命令:发条

时间:2014-04-25 07:28:28

标签: ruby-on-rails gem clockwork

我想在我的ruby on rails项目中使用发条。 Ruby 1.9.3 Rails 3.0.9

我在root

中运行了bundle install
Installing clockwork (0.7.5)
....
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.

$ bundle show clockwork
/scratch/install/ruby193/lib/ruby/gems/1.9.1/gems/clockwork-0.7.5
$ bundle exec clockwork config/clock.rb
The source :gemcutter is deprecated because HTTP requests are insecure.
Please change your source to 'https://rubygems.org' if possible, or 'http://rubygems.org' if not.
bundler: command not found: clockwork
Install missing gem executables with `bundle install`

我不知道如何调用发条宝石。它始终给我"命令未找到:发条"。其他宝石都可以,除了这个发条宝石:(

实际上,我遇到与https://meta.discourse.org/t/how-to-run-clockwork-in-background/6176/4

相同的问题

请提前帮助并表示感谢!

2 个答案:

答案 0 :(得分:1)

首先,您需要在“Gemfile”中添加Daemons

gem 'daemons'

然后运行bundle以安装Daemons gem。你可以运行:

clockworkd -c YOUR_FILE.rb status
clockworkd -c YOUR_FILE.rb start
clockworkd -c YOUR_FILE.rb stop

或者:

bundle exec clockworkd -c YOUR_FILE.rb status
bundle exec clockworkd -c YOUR_FILE.rb start
bundle exec clockworkd -c YOUR_FILE.rb stop

答案 1 :(得分:0)

当我第一次像这样跑时钟时:

clockwork app/clock.rb

我得到了:

clockwork: command not found

然后我跑了这样的发条:

bundle exec clockwork app/clock.rb

即使我卸载了daemons gem,即使后来的运行没有bundle exec

,它仍然有效