Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"There was an error while trying to load the gem 'mysql2'. (Bundler::GemRequireError)" error shows up after redmine installation

I'm transferring redmine from our office's local server to an online server so that anyone who deals with bug management doesn't need to have a VPN account to access redmine.

So, We've chosen to use Bluehost.com because we saw their default Ruby version is 1.9.3(which works with redmine) while other hosts we've checked out were at 1.8.7

Okay I'm done establishing the backstory, now to the main storyline:

I'm trying for several days to install redmine on the server with no success. The error I'm getting is this: Error Message:

There was an error while trying to load the gem 'mysql2'. (Bundler::GemRequireError)

Exception Class: PhusionPassenger::UnknownError

Here are some details:

Ruby version 1.9.3 Redmine version 3.2.2 Rails Version 4.2.5.2(installed as part of the bundle for redmine) MySQL version 5.5.42

I've used a few guides on the web on how to install redmine on the server. one of whom was bluehost's guide: https://my.bluehost.com/cgi/help/redmine

What I've tried after thoroughly searching StackOverflow:

  • I read that sometimes mysql2 gems have a problem and need to be reinstalled again after the bundle so I did gem install mysql2
  • I tried installing a specific version as well when someone here said that the mysql2 gem was working with bluehost on version 0.3.16 or other similar versions. Didn't work.
  • I even tried installing a local newer version of Ruby 2.3.1 but that didn't work either and only after I realized that the gems are not necessarily affected by the ruby version installed on the system.
  • I can't even use the test feature (like with WEBrick or Thin) because Bluehost wants you to own a dedicated server in order to open up special ports for you. We're using a shared host.

Anyway, after around 4 days of dealing with this I came to the conclusion that I need to seek out help. Sure I did learn practically the syntax of Ruby on Rails while dealing with this problem(which I was clueless on and have no knowledge in Ruby itself) but I need to get this done.

Does anyone have any insight on things I can try to get this working? Here's a shot of the error: Passenger Error

production.log data:

Migrating to InsertAllowedStatusesForNewIssues (20150725112753)
Migrating to CreateImports (20150730122707)
Migrating to CreateImportItems (20150730122735)
Migrating to ChangeTimeEntriesCommentsLimitTo1024 (20150921204850)
Migrating to ChangeWikiContentsCommentsLimitTo1024 (20150921210243)
Migrating to ChangeAttachmentsFilesizeLimitTo8 (20151020182334)
Migrating to FixCommaInUserFormatSettingValue (20151020182731)
Migrating to ChangeIssueCategoriesNameLimitTo60 (20151021184614)
Migrating to ChangeAuthSourcesFilterToText (20151021185456)
Migrating to ChangeUserPreferencesHideMailDefaultToTrue (20151021190616)
Migrating to AddTokensUpdatedOn (20151024082034)
Migrating to CreateCustomFieldEnumerations (20151025072118)
Migrating to AddProjectsDefaultVersionId (20151031095005)

in comparison, development.log is huge so I'll add a portion of it just to demonstrate the type of things written there. I can access the cpanel and donwload the entire file if needed:

'  ^[[1m^[[36m (0.2ms)^[[0m  ^[[1mSHOW CREATE TABLE `wikis`^[[0m
  ^[[1m^[[35m (0.3ms)^[[0m  SELECT fk.referenced_table_name as 'to_table'
      ,fk.referenced_column_name as 'primary_key'
      ,fk.column_name as 'column'
      ,fk.constraint_name as 'name'
FROM information_schema.key_column_usage fk
WHERE fk.referenced_column_name is not null
  AND fk.table_schema = 'skredmin_redmine2'
  AND fk.table_name = 'workflows'

Thanks for any insight!

like image 761
Oren_C Avatar asked Feb 06 '23 20:02

Oren_C


2 Answers

Try 'bundle update mysql2'

I'm new to the server side of redmine but I experienced this issue when we updated mysql on our server. This did the trick for me, hope it helps.

like image 124
dstana Avatar answered Apr 08 '23 04:04

dstana


I had to downgrade my version of mysql2 gem in the gemfile:

gem 'mysql2', '~> 0.3.18'

Then using a bundle update to downgrade the version.

like image 40
Mark Davies Avatar answered Apr 08 '23 04:04

Mark Davies