gpt4 book ai didi

ruby-on-rails - GemNotFound 在开发中使用时抽取

转载 作者:行者123 更新时间:2023-12-05 07:47:15 24 4
gpt4 key购买 nike

在开发模式下使用 gem 'whenever' 时,我遇到了一个我不明白的错误(我对 Rails 还很陌生)。

我所做的是更新 config/schedule.rb 并运行

whenever --update-crontab --set environment='development'

crontab -l 列出:

* * * * * /bin/bash -l -c 'cd /home/vic/Desktop/WorkflowProject && bundle exec bin/rails runner -e development '\''Task.new2'\'' >> log/whenever.log 2>&1'

在 config/schedule.rb

set :output, 'log/whenever.log'

every 1.minute do
runner "Task.new2"
end

在日志/whenever.log

bundler: failed to load command: bin/rails (bin/rails)
Bundler::GemNotFound: Your bundle is locked to rake (11.3.0), but that version could not be found in any of the sources listed in your Gemfile. If you haven't changed sources, that means the author of rake (11.3.0) has removed it. You'll need to update your bundle to a different version of rake (11.3.0) that hasn't been removed in order to install.
/home/vic/.rvm/gems/ruby-2.3.1/gems/bundler-1.13.2/lib/bundler/definition.rb:179:in `rescue in specs'
/home/vic/.rvm/gems/ruby-2.3.1/gems/bundler-1.13.2/lib/bundler/definition.rb:173:in `specs'
/home/vic/.rvm/gems/ruby-2.3.1/gems/bundler-1.13.2/lib/bundler/definition.rb:233:in `specs_for'
/home/vic/.rvm/gems/ruby-2.3.1/gems/bundler-1.13.2/lib/bundler/definition.rb:222:in `requested_specs'
/home/vic/.rvm/gems/ruby-2.3.1/gems/bundler-1.13.2/lib/bundler/runtime.rb:118:in `block in definition_method'
/home/vic/.rvm/gems/ruby-2.3.1/gems/bundler-1.13.2/lib/bundler/runtime.rb:19:in `setup'
/home/vic/.rvm/gems/ruby-2.3.1/gems/bundler-1.13.2/lib/bundler.rb:99:in `setup'
/home/vic/.rvm/gems/ruby-2.3.1/gems/bundler-1.13.2/lib/bundler/setup.rb:20:in `<top (required)>'
/home/vic/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/home/vic/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'

非常感谢您的帮助,非常感谢!

最佳答案

尝试以下命令。

gem install rubygems-bundler
gem regenerate_binstubs

引用:this

关于ruby-on-rails - GemNotFound 在开发中使用时抽取,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40022328/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com