Rails and authlogic, Not able to solve dependencies - ruby-on-rails

This is my Gemfile:
gem "rails", "~> 2.3.8"
gem "rake", "0.9.2"
gem 'mysql', '2.8.1'
gem 'aasm', '2.1.5'
gem "authlogic", "2.1.6"
gem "acl9", "0.12.0"
gem "formtastic", "1.2.5"
But bundle install reports:
Bundler could not find compatible versions for gem "activesupport":
In Gemfile:
rails (~> 2.3.8) ruby depends on
activesupport (= 2.3.8) ruby
authlogic (= 2.1.6) ruby depends on
activesupport (1.0.0)
UPDATE
I've tried different combinations of gem versions.
And finally found a row without the version specification... that I didn't saw between comments. So the code snippet above was already correct.

Do you really need to use those versions?
Why not simply replace
gem "authlogic", "2.1.6"
with
gem "authlogic"
and let the bundle solve version dependencies?
Sometimes after doing so in the gemfile you get an error from the bundler and you have to run bundle update authlogic before the general bundle install

Related

Rail Can't find Railites - RBENV

RUBY 2.7.6
Bundler version 2.1.4
No matter what version of rails I use in the GEMFILE
I get the following error
undler could not find compatible versions for gem "railties":
In Gemfile:
rails (= 6.0.0) was resolved to 6.0.0, which depends on
railties (= 6.0.0)
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '6.1.0'
# Use mysql as the database for Active Record
gem 'mysql2', '~> 0.3.18'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.3'
This is maybe because you have an outdated version of sass-rails.
Try the followings steps:
Remove gem versions for sass-rails from Gemfile.lock and run bundle update
If above didnt work, delete the Gemfile.lock and run bundle install, if you have no conflicting explicit gem version in your Gemfile to start with. So if this fails, remove version numbers from the Gemfile.
Hope this helps!

Bundler could not find compatible versions for gem "haml":

I got following error after "bundle install"
Bundler could not find compatible versions for gem "haml":
In Gemfile:
haml-rails (>= 0) ruby depends on
haml (< 5.0, >= 4.0.6) ruby
haml (= 4.0.3) ruby
In the Gemfile:
gem "haml-rails", :git => "git://github.com/indirect/haml-rails.git"
how could I resolve this issue?
I think your Gemfile contains something like:
gem 'haml', '4.0.3'
change it to:
gem 'haml', '~> 4.0.3'
and run bundle install.

Decoupling Gemfile bundle errors

Given a gemfile of :
source 'https://rubygems.org'
gem 'rails', '4.1.1'
group :development, :test do
gem 'railroady'
gem 'sqlite3'
gem 'jasmine'
# For linux support
gem 'therubyracer'
end
group :production do
gem 'pg'
gem 'thin'
end
gem 'sass-rails'
# gem 'coffee-rails'
gem 'uglifier', '>= 1.0.3'
gem 'colorize'
gem 'jquery-ui-rails'
gem 'jquery-rails'
gem 'rails-backbone'
# gem 'backbone-on-rails'
gem 'bootstrap-sass'
gem 'requirejs-rails', git: 'git://github.com/jwhitley/requirejs-rails.git'
gem 'ejs'
gem 'devise'
gem 'better_errors', '>= 0.2.0', :group => :development
gem 'binding_of_caller', '>= 0.6.8', :group => :development
gem 'd3_rails'
gem 'font-awesome-sass-rails'
# for a better way of looking at the rake routes by calling rake color_routes in the console
gem 'color_routes'
# lets us know which user is logged in, and store in a global variable gon{}
gem 'gon'
#browser detection
gem 'browser'
# FOR EASY TRANISTION TO Rails 4
gem 'protected_attributes'
gem 'rails-observers'
gem 'actionpack-page_caching'
gem 'actionpack-action_caching'
and when running bundle, getting the following error:
Bundler could not find compatible versions for gem "jquery-rails":
In Gemfile:
rails-backbone (>= 0) ruby depends on
jquery-rails (~> 2.1.3) ruby
jquery-rails (3.1.2)
Bundler could not find compatible versions for gem "ejs":
In Gemfile:
rails-backbone (>= 0) ruby depends on
ejs (~> 1.0.0) ruby
ejs (1.1.1)
Bundler could not find compatible versions for gem "rails":
In Gemfile:
rails-backbone (>= 0) ruby depends on
rails (~> 3.1.0.beta1) ruby
rails (4.1.1)
The errors aren't making sense. Taking the first part with jquery-rails, i get that it is saying another gem rails-backbone of a version greater than or equal to 0 depends on jquery-rails of around 2.1.3.
What does ruby mean after the versions?
What is `jquery-rails (3.1.2) mean?
Basically, you have dependency errors in your gemfile, and it seems that rails-backbone is causing most of them, consider removing it, as the latest version works with rails 3.1 - it hasn't been updated for long time
Here is info about the gem: https://rubygems.org/gems/rails-backbone
Bundler could not find compatible versions for gem "ejs":
In Gemfile:
rails-backbone (>= 0) ruby depends on
ejs (~> 1.0.0) ruby
ejs (1.1.1)
This error literally means that you are using ejs version 1.1.1 (probably a dependency of some other gem), but rails-backbone (version greater or equal 0, so any version) requires ejs in version 1.0.*
you can use rails-backbone from the git with
gem 'rails-backbone', git: 'https://github.com/codebrew/backbone-rails.git', tag: 'v1.1.2'
Version 1.1.2 depends on any version of jquery-rails and mocha, so it shouldn't cause any problems. Using git without tag will get the latest version from master, but I would advise against using development version (may cause more trouble than good)
The rubygem seems outdated, the github repository states that it works with rails 4
As a workaround, get the gem directly from github :
gem 'rails-backbone', :git => 'https://github.com/codebrew/backbone-rails.git'
jquery-rails (~> 2.1.3) means it is dependent on all jquery-rails versions between 2.1.3 and below 2.2.0.
jquery-rails (3.1.2) is already installed in the app; it can be verified by looking at Gemfile.lock contents.
Try bundle update; it will try to update all the gem versions where there are no specific version specified, and possibly succeed in getting the dependency conflict resolved.

Is it necessary to update the line of gem in Gemfile when using bundle update gem-name?

I want to update my jquery_rails gem, actual version is 3.0.4, the following command will update it
bundle update jquery_rails
so, what about my Gemfile, it is necessary to update version of jquery_rails too ? ("i work currently in local")
in my Gemfile i have version 2.2.1
gem 'jquery-rails', '2.2.1'
Update
i change gem 'jquery-rails', '2.2.1' in my Gemfile to gem 'jquery-rails', '3.0.4', and i tried to execute bundle update jquery-railsbut an error is occur :
Bundler could not find compatible versions for gem "railties":
In Gemfile:
rails (= 4.0.0) ruby depends on
railties (= 4.0.0) ruby
sass-rails (= 4.0.0) ruby depends on
railties (4.0.1)
Firstly, you should update your gem file and specify required version of the gem, then run bundle update jquery_rails.
Error tells you, that you have gems which required different version of railties. Try to change versions of rails to 4.0.1, sass-rails to 4.0.1 and railties to 4.0.1 and update these gems via bundle.
To answer your question directly, in this case yes it is necessary to update the version in Gemfile, but it is not always.
Running bundle update <gem> will cause Bundler to find the most recent version of the gem and its dependencies that satisfies all of the requirements of the Gemfile. Since you have specified a requirement of a specific version, Bundler will only allow that version. You can also specify a more flexible version in your Gemfile: gem 'jquery-rails', '~> 2.2.0' would allow it to use any 2.2.x version, or '~> 2.2' would allow any 2.x.
The issue with sass-rails is separate. You can solve it by updating to sass-rails 4.0.1. See can't get gemfile to allow for bundle update

Adding 2 versions of a gem in bundler

I'm trying to add searchlogic 2.5.5 and rails 2.3.5 in my bundle. Here's my Gemfile
source :rubygems
gem "activerecord", ">= 2.3.5"
gem "prawn", "0.6.3"
gem "searchlogic", "2.5.5"
gem "declarative_authorization", "0.5.2"
gem "test-unit", "1.2.3"
gem "hoe", "1.5.1"
gem "rake", "0.8.7"
gem "rails", "2.3.5"
But whenever I try to execute
bundle install
it says
Bundler could not find compatible versions for gem "activerecord":
In Gemfile:
searchlogic (= 2.5.5) depends on
activerecord (~> 2.3.11)
rails (= 2.3.5) depends on
activerecord (2.3.5)
Is it possible to install 2 versions of the activerecord?
I'm somewhat of a RoR newbie, so I might be wrong but I don't think so. I know with rvm you can make different gemsets, but that's not what you want.
Any reason you can't upgrade Rails or downgrade searchlogic instead?
"rails", "~> 2.3.11"
or
gem "searchlogic", "2.4.28"
?

Resources