Reputation: 800
I am running a rake task using whenever cron job but its giving error Bundler could not find compatible versions for gem "bundler": code sample is below
schedule.rb
set :output, {:error => "log/cron_error_log.log", :standard => "log/cron_log.log"}
every 1.minute do
rake "twitter:search"
end
/lib/tasks/twitter.rake
namespace :twitter do
desc "Search tweets for user"
task :search => :environment do
puts "searching for all users ......."
# my original code
end
end
when i run my rake tasks using following commands
whenever --update-crontab
crontab -l
it run successfully but when i see log file log/cron_log.log i got following error after every 1 minute
Bundler could not find compatible versions for gem "bundler":
In Gemfile:
rails (= 4.1.1) depends on
bundler (< 2.0, >= 1.3.0)
Current Bundler version:
bundler (1.0.15)
Note => when i run rake twitter:search in terminal it run successfully
Thank you for reading post and thanks a lot for suggestion
Upvotes: 1
Views: 495
Reputation: 646
The error is telling you that you have the wrong version of bundler installed.
rails (= 4.1.1) depends on bundler (< 2.0, >= 1.3.0)
Bundler gem version must be less than 2.0
but greater than or equal to 1.3.0
Current Bundler version: bundler (1.0.15)
The installed version of bundler is 1.0.15
(smaller than 2.0
, but not greater than or equal to 1.3.0
TL;DR install the right version of bundler
$ gem install bundler --version '<2.0, >= 1.3.0'
Upvotes: 1