Rails 6 + Mongoid 6.1.0 not compatible versions for gem "activemodel" - activemodel

Trying to use Rails 6.0.0 with Mongoid 6.1.0
gem 'rails', '~> 6.0.0'
gem 'mongoid', '~> 6.1.0'
Tried already to not set the mongoid version in Gemfile, but still not working.
Bundler could not find compatible versions for gem "activemodel":
In Gemfile:
mongoid (~> 6.1.0) was resolved to 6.1.1, which depends on activemodel (~> 5.0
rails (~> 6.0.0) was resolved to 6.0.0, which depends on activemodel (= 6.0.0)

I´ve just found a simple way to fix this until mongoid release the latest version that is compatible
Replace the mongoid gem to:
gem 'mongoid', git: 'https://github.com/mongodb/mongoid.git', branch: 'master'
Than
bundle update

Related

Error loading the 'mysql2' Active Record adapter

I am trying to upgrade my app and this is the error I am getting while deploying the app:
Error loading the 'mysql2' Active Record adapter. Missing a gem it depends on? can't activate mysql2 (< 0.6.0, >= 0.4.4), already activated mysql2-0.3.21. Make sure all dependencies are added to Gemfile.
here is my Gemfile:
https://github.com/BI-CTSICN/sparc-request/blob/master/Gemfile
gem 'mysql2', '~> 0.3.18'
gem 'rails', '~> 5.1', '>= 5.1.4'
I am using ruby 2.4.2
Your mysql2 version you use (0.3.21, checked in Gemfile.lock) is too old, required one is newer than 0.4.4.
Upgrade your mysql2 gem by changing version in Gemfile and running bundle update mysql2. Of course before that check what changed between versions and then run your tests to check if upgrade didn't break anything.
Just lock the mysql2 gem version not work for me. The only thing that work was match the rails gem version with mysql2 gem version, comparing both by it's release date.
Ex: I'm updating now my rails version from 5.1 to 5.2, so I want to put mysql 0.5.3 on my application (the most recent version). But I can put only the 0.4.10 version, because of it's release date match with rails 5.2.0.rc2 version that I installed right now (both are from march, 2018, with one day of difference).
I don't know why this working, but I guess that's a incompatibility problem between the rails and mysql2 versions that I tried to install.

Rails Setup: mysql2 gem always causing problems

I'm fairly new when it comes to commandline or Rails, but work on a rails project where I'm doing the frontend.
I've installed all gems that are needed for the project, but lately some errors occur when doing a rake:db migrate or today when trying to deploy the current version via cap production deploy
The problem I'm facing seems to have todo with the mysql2 gem. At least that is what the console says.
When running cap production deploy I get this error:
rake stdout: Nothing written
rake stderr: rake aborted!
Gem::LoadError: Specified 'mysql2' for database adapter, but the gem is not loaded. Add `gem 'mysql2'` to your Gemfile.
and further down this …
Gem::LoadError: can't activate mysql2 (~> 0.3.10), already activated mysql2-0.4.2. Make sure all dependencies are added to Gemfile.
What do I have todo here? When I do gem list I see that mysql2 is installed.
Thank you,
Matt
Rails used to have the mysql2 gem locked down to ~>0.3 in the codebase.
So that is what it looks for but your Gemfile will simply state
gem "mysql2"
Pretty sure they've updated this in the latest release of rails 4 so either:
Update to the latest version of rails 4 or use a specific version of the mysql2 gem
gem "mysql2", "~> 0.3.20"

Rails 4.1.6 Could not find generator bootstrap:install

I am getting the message Could not find generator bootstrap:install on Rails 4.1.6
My gem file looks like this:
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails'
gem 'rails', '4.1.6'
# Use postgresql as the database for Active Record
gem 'pg'
# Use SCSS for stylesheets
gem 'sass-rails'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster.
gem 'turbolinks'
# Build JSON APIs with ease.
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
# Spring speeds up development by keeping your application running in the background.
gem 'spring', group: :development
gem 'devise'
gem "therubyracer"
gem "less-rails" #Sprockets (what Rails 3.1 uses for its asset pipeline) supports LESS
# twitter bootstrap css & javascript toolkit
gem 'twitter-bootstrap-rails', :git => 'git://github.com/seyhunak/twitter-bootstrap-rails.git'
# twitter bootstrap css & javascript toolkit
gem 'twitter-bootswatch-rails', '~> 3.2.0'
# twitter bootstrap helpers gem, e.g., alerts etc...
gem 'twitter-bootswatch-rails-helpers'
twitter-bootstrap-rails version is 3.2.0
therubyracer version is 0.12.1
execjs version is 2.2.2
When I run rails generate bootstrap:install less in command line, I get the above error. I do not understand what am I doing wrong.

Cannot resolve gem dependencies - doorkeeper, sass-rails - on jruby using Rails 4

I have googled around a lot to find answers and cannot find one. How do I resolve this dependency issue. If I remove sass-rails (which isn't practical but just for testing issues) then the problem just rolls down the Gemfile to coffee-rails having the dependency conflict.
Bundler could not find compatible versions for gem "railties":
In Gemfile:
doorkeeper (~> 0.6.7) java depends on
railties (~> 3.1) java
sass-rails (~> 4.0.0.beta1) java depends on
railties (4.0.0.beta1)
I have tried deleting the Gemfile.lock and redoing the bundle install. No joy.
I checked applicake/doorkeeper issues on GitHub.
This gem does not support Rails 4 yet, and 0.6.x will not support.
https://github.com/applicake/doorkeeper/pull/200
We won't plan to support versions less than 1.0 for rails 4.
But someone already forked for Rails 4 like this https://github.com/applicake/doorkeeper/pull/213 .
You can use these forks as below.
# Gemfile
gem 'doorkeeper', github: 'kaznum/doorkeeper', branch: 'support_rails4'
Hope to help you.
I would use most recent fork with only ahead commits
gem 'doorkeeper', github: 'stas/doorkeeper', branch: 'rails4'

Ruby gem version compatibility issues

I am trying to use Ruby with MySql and two more gems, composite_primary_keys and ActiveRecord, however, I am seeing version compatibility issues. Following are the details of the system and tools versions:
OS: CentOS 4.9
gcc: 3.4.6
mysql: mysql Ver 14.7 Distrib 4.1.22, for redhat-linux-gnu (x86_64) using readline 4.3
ruby: ruby 1.9.3p0 (2011-10-30) [x86_64-linux]
Gems versions:
mysql: 2.8.1
composite_primary_keys: 4.1.1
activerecord: 3.1.3
Is there any documentation that shows a version compatibility chart or something for gems?
Gems has the gem dependency command, which shows what a particular gem expects:
gem depend mysql activerecord composite_primary_keys
Gem activerecord-3.1.3
activemodel (= 3.1.3)
activesupport (= 3.1.3)
arel (~> 2.2.1)
tzinfo (~> 0.3.29)
Gem composite_primary_keys-4.1.1
activerecord (~> 3.1)
Gem mysql-2.8.1
hoe (>= 2.3.3, development)
rake-compiler (~> 0.5, development)
You can use gem dependency by itself to see all dependencies of all gems if you want to wade through the list.
There is not such a documentation because the gem themselves declare which versions of the required gems are compatible with them. They may be wrong but so is any kind of documentation, implicit or explicit.
Anyway, which kind of problem do you have? It would be simpler if you report your issue to the gem authors or you post a question here so that other people can help you solve it or work around it.