Error with Gitlab: Sidekiq; gemfile syntax error
I’ve been breaking my head over this error for hours now, and still haven’t found a fix. When I run sidekiq using
sudo -u root -H RAILS_ENV=production script/background_jobs start I’m getting this error in the sidekiq.log:
Gemfile syntax error: /home/website/git/gitlab/Gemfile:20: syntax error, unexpected ':', expecting $end gem "mysql2", group: :mysql
I’ve installed Ruby 2.1.0 and am running CentOS. I’ve seen other posts with this error, and their problem was that they were running Ruby 1.8, however, I’m running Ruby 2.1.0 and also getting this error.
Any help is greatly appreciated.
EDIT: My gemfile http://pastebin.com/T5z4GZ3a
Your bundle is complete! Gems in the groups development, test, postgres, puma and aws were not installed. It was installed into ./vendor/bundle
background_jobs script http://pastebin.com/kdicTFqk
bundle show bundler returns
EDIT3: I think I have found the problem, not sure how to solve it though. I added
p RUBY_VERSION as first line of my Gemfile, then I changed every line written like this:
group: :mysql to this
:group => :mysql (because that is working on older versions).
However, when I run Sidekiq now, this shows up in the sidekiq.log:
"1.8.7" bundler: command not found: sidekiq Install missing gem executables with `bundle install`
I am really, really confused now. Here it clearly says my Ruby version is 1.8.7, but that’s not right.
ruby -v or
rvm list rubies only show that Ruby 2.1.0 is installed, and set as default.
One Solution collect form web for “Error with Gitlab: Sidekiq; gemfile syntax error”
Make sure, that when you issue
bundle install you have picked up the ruby 2.1.0, just do as follows:
Enter into app’s folder, then edit the Gemfile to a few lines, inserting into it
bundle install, and see the ruby version output, it shell be 2.1.0, and the form of
gem "mysql2", group: :mysqlshould work.
Then add line one-by-one, or group-by-group, issuing the
So make sure that the Gemfile will be fully restored at the end.
Then you should do a proper setup shell environment in your run script. So if you use the rvm just replace the first line with:
Add sourcing to rvm:
Before starting the script, add shell command to set proper version of ruby to 2.1.0
rvm use ruby-2.1.0@global
NOTE: Probably you have to use an other gemset not the