Rails for Beginners Part 36: Background Jobs with Sidekiq Discussion
I had to change the timezone in config/application.rb. Rails default's timezone is UTC + 0 and my own timezone is UTC + 1. So at 8:00pm when I was trying to publish at 8:01pm, Time.current was returning 7:01pm and the guard clause "return if tweet.publish_at > Time.current" was therefore always true. Is there an easy way to manage multiple timezones ? I guess it is fine to have a timezone set in application.rb if all users are in the same timezone but background jobs would not work properly everytime a user would be in another timezone, right?
At 1:46 of the video you have a screen full of issues, as while I followed the directions it says there is an undefined method 'published?' for nil:NilClass"
I backed out sidekiq and tried to run on the activejobs and it worked fine, so it seems to be something with SideKiq which also claims some sort of issue with a gem called racc which i did install (didn't have it) and still claims an issue with older version even though I'm running newer version
Anyone run into the same issue?
yes this is happening to me, sidekiq uses racc and it says
WARN: Unresolved or ambiguous specs during Gem::Specification.reset:
racc (~> 1.4)
Available/installed versions of this gem:
- 1.5.2
- 1.5.1
WARN: Clearing out unresolved specs. Try 'gem cleanup '
Currently, I'm still trying solutions but at the moment, I got nothing.
so, I tried adding gem "racc", "~> 1.4.0" to the gem file, but I get the same error, tried uninstalling racc 1.5.x gems but the 1.5.1 is the default gem, so I don't get it. Search on many GitHub issues people have this problem before but I don't understand how they are fixing it.
Carlos, yes that's exactly my problem, so at least I'm not alone. So that's something
For linux I installed only redis , and start the redis manually, then rails s and then sidekiq
Linux / Ubuntu 20
If anyone has a problem when everything is started: Redis-> Sidekiq -> Rails Server and Sidekiq is doing nothing - no changes in the console - no posted tweet.
Create a file in config/initializers/sidekiq.rb
Copy/Paste inside and save:
Sidekiq.configure_server do |config|
config.redis = { url: 'redis://localhost:6379/0' }
end
Sidekiq.configure_client do |config|
config.redis = { url: 'redis://localhost:6379/0' }
Restart everything and run again.
Let me know if it does work for you.
there is any way to install redis in windows like newest versions because i have file contain redis 3.2.0 which is useless with new version of sidekiq
??????
I'm running WSL and I ran into this issue with sidekiq
WARN: Unresolved or ambiguous specs during Gem::Specification.reset:
zeitwerk (~> 2.3)
Available/installed versions of this gem:
- 2.5.3
- 2.5.1
minitest (>= 5.1)
Available/installed versions of this gem:
- 5.14.4
- 5.14.2
loofah (~> 2.3)
Available/installed versions of this gem:
- 2.13.0
- 2.12.0
racc (~> 1.4)
Available/installed versions of this gem:
- 1.6.0
- 1.5.1
rake (>= 0.13)
Available/installed versions of this gem:
- 13.0.6
- 13.0.3
WARN: Clearing out unresolved specs. Try 'gem cleanup '
Please report a bug if this causes problems.
/home/lincxx/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bundler-2.3.4/lib/bundler/runtime.rb:309:in check_for_activated_spec!': You have already activated activesupport 6.1.4.4, but your Gemfile requires activesupport 6.1.4.1. Prepending
bundle exec` to your command may solve this. (Gem::LoadError)
To get past this error, just run bundle exec sidekiq
Everything runs properly but the tweet is not posted. I have started redis, sidekiq and changed my timezone.
Can anyone help me?
I'm on the same problem, guess I'll just rollback right before this lesson.
My tweets don't publish on their scheduled date & time. Can anyone please help me with this issue? Everything else seems fine - this is the only issue i'm facing.