【问题标题】:bundler: command not found: clockwork捆绑器:找不到命令:发条
【发布时间】:2014-06-10 19:02:05
【问题描述】:

我想在我的 ruby​​ on rails 项目中使用发条。 红宝石 1.9.3 导轨 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有同样的问题

请帮助并提前感谢您!

【问题讨论】:

  • 不,我没有使用 RVM。
  • ...ruby193/bin中是否有clockwork文件?

标签: ruby-on-rails gem clockwork


【解决方案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

【讨论】:

  • 我已经用bundle install --deployment --binstubs 尝试过这个,但我的app/bin 目录中没有clockworkd 命令。是否需要一些额外的魔法?
【解决方案2】:

当我第一次这样运行发条时:

clockwork app/clock.rb

我明白了:

clockwork: command not found

然后我像这样运行发条:

bundle exec clockwork app/clock.rb

即使我卸载了daemons gem,即使后来的运行没有bundle exec,它也能正常工作

【讨论】:

    猜你喜欢
    • 2011-04-24
    • 1970-01-01
    • 2022-06-14
    • 2015-07-08
    • 1970-01-01
    • 2023-03-18
    • 2012-12-03
    • 1970-01-01
    • 2013-07-03
    相关资源
    最近更新 更多