I'm updating the rails version of my application from '4.2' to '6.0'. There are multiple engines in my application. The new rails version is not reflecting in the gemfile.lock of engine which is causing the following error on running bundle update rails command:
Bundler could not find compatible versions for gem "rails":
In Gemfile:
rails (>= 6.0.3, ~> 6.0)
admin was resolved to 0.0.1, which depends on
customer was resolved to 0.0.1, which depends on
emails was resolved to 0.0.1, which depends on
rails (~> 4.2)
Does anyone know how to resolve this error or simply how to update the rails version in gemfile.lock of an engine?
Related
I'm trying to upgrade an old project into new versions of ruby and rails.
ruby 2.5.1 -> ruby 3.1.2
rails 5.2.8.1 -> rails 6.0.3
This is the error im getting:
$ bundle
Fetching gem metadata from https://rubygems.org/..........
Resolving dependencies.....
Bundler could not find compatible versions for gem "actionpack":
In snapshot (Gemfile.lock):
actionpack (= 5.2.8.1)
In Gemfile:
rails (~> 6.0.3) was resolved to 6.0.3, which depends on
actionpack (= 6.0.3)
devise_token_auth (= 1.0.0) was resolved to 1.0.0, which depends on
devise (> 3.5.2, < 4.6) was resolved to 4.5.0, which depends on
railties (>= 4.1.0, < 6.0) was resolved to 5.2.8.1, which depends on
actionpack (= 5.2.8.1)
Deleting your Gemfile.lock file and running `bundle install` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.
$ rails s
Could not find gem 'rails (~> 6.0.3)' in locally installed gems.
The source contains the following gems matching 'rails':
* rails-5.2.8.1
Run `bundle install` to install missing gems.
I was hoping to update my old rails project into newer versions of ruby and rails including working dependencies.
The Devise gem didn't support Ruby on Rails 6.0 until version 4.7. That means when you want to update Rails to 6.0 then you need to update Devise at the same time.
I would try running:
bundle update rails device devise_token_auth
Btw. Rubygems is a great resource to investigate version dependencies. Here, for example, you can see that Devise 4.6.2 only support railties < 6.0 but Devise 4.7.0 had that limitation removed.
i m using rails-portfolio my ruby version is 2.3.1 and rails version is 5.1.4
after adding gem 'rails-portfolio' and on running bundle install it gives following error:-
even on running bundle update is shows same error on console without any luck
Bundler could not find compatible versions for gem "rails": In
snapshot (Gemfile.lock):
rails (= 5.1.4)
In Gemfile:
rails (~> 5.1.4)
rails-portfolio (~> 0.0.5) was resolved to 0.0.5, which depends on
rails (~> 4.2)
Running bundle update will rebuild your snapshot from scratch, using
only the gems in your Gemfile, which may resolve the conflict.
You'll need to downgrade your Rails version, or you could fork the Gem, modify portfolio.gemspec to reflect your version and hope it acts as expected — a quick inspection indicates shows that there's nothing glaring obviously that would break.
Im literaly bumping my head into a wall and I can not find a solution by myself about this problem.
I'm starting a project with Solidus , a Spree commerce fork. I played around with the gem for a litle while and now that I am ready to get serious and start to develop , I create a new project ad I'm bumping into this nasty error :
Bundler could not find compatible versions for gem "rails":
In snapshot (Gemfile.lock):
rails (= 5.1.2)
In Gemfile:
rails (~> 5.1.2)
solidus was resolved to 1.0.0, which depends on
solidus_core (= 1.0.0) was resolved to 1.0.0, which depends on
rails (~> 4.2.0)
Running `bundle update` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.
and bundle update is not solving my problem... I am running out of solution and will appreciate some hands in help in how to fix this problem.
Thanks
Bundler is doing you a favor here by showing you that you have incompatible version requirements for the rails gem.
You have rails (~> 5.1.2) listed in your gemfile and the solidus gem has a dependency on rails (~> 4.2.0), so there is a conflict about which version of rails your app should use.
Is there a reason you are using solidus version 1.0.0? It looks like the latest version of solidus is 2.0.2 at present. Later versions of solidus will have a more recent dependency listed for rails, which will allow your application to use rails 5+.
Update the version of solidus in your gemfile to something more recent and see if that allows bundler to install successfully.
As per rbenv -global my ruby version is 2.3.3
The versions of Rails I have:
*** LOCAL GEMS ***
rails (5.1.1, 5.0.0)
Initially, my goal was to create a Rails with Spree. Like usual I began with:
rails new spree_app
Following the Spree README I then added the following gems to my gemfile:
gem 'spree', '~> 3.2.0'
gem 'spree_auth_devise', '~> 3.2.0.beta'
gem 'spree_gateway', '~> 3.2.0.beta'
Then, when I ran bundle install I'm met with the following errors:
Bundler could not find compatible versions for gem "rails":
In snapshot (Gemfile.lock):
rails (= 5.1.1)
In Gemfile:
rails (~> 5.1.1)
spree (~> 3.2.0) was resolved to 3.2.0, which depends on
spree_frontend (= 3.2.0) was resolved to 3.2.0, which depends on
canonical-rails (~> 0.1.0) was resolved to 0.1.2, which depends on
rails (< 5.1, >= 4.1)
spree (~> 3.2.0) was resolved to 3.2.0, which depends on
spree_core (= 3.2.0) was resolved to 3.2.0, which depends on
deface (~> 1.0) was resolved to 1.2.0, which depends on
rails (>= 4.1)
spree (~> 3.2.0) was resolved to 3.2.0, which depends on
spree_core (= 3.2.0) was resolved to 3.2.0, which depends on
rails (~> 5.0.0)
Running `bundle update` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.
Running bundle update as suggested yields me this:
Bundler could not find compatible versions for gem "rails":
In Gemfile:
rails (~> 5.1.1)
spree (~> 3.2.0) was resolved to 3.2.0, which depends on
spree_core (= 3.2.0) was resolved to 3.2.0, which depends on
rails (~> 5.0.0)
So it seems to me that Spree depends on Rails 5.0.0 and my 5.1.1 is causing problems. In light of this I changed gem 'rails', '~> 5.1.1' to gem 'rails', '~> 5.0.0', ran bundle update and bundle install and everything worked properly bundler-wise.
The issue is that this seems to have broken my rails app. Running, any rails generate commands or rails s gives me the following error:
/usr/local/opt/rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.0.3/lib/rails/railtie/configuration.rb:95:in `method_missing': undefined method `load_defaults' for #<Rails::Application::Configuration:0x0055a1cd5a36f0> (NoMethodError)
For the life of me, I have no idea what is the matter here.
My final attempt was to try and generate a new Rails app in 5.0.0 with:
rails _5.0.0_ new spree_app_2
But for whatever reason, this seems to make no difference. The gemfile of this app still contains gem 'rails', '~> 5.1.1' and I am met with all the same errors that I got before hand.
So it seems that I either, don't know how to manage different versions of Rails, I'm not installing Spree correctly, or both. Any help is appreciated, thanks.
Update: Partial Solution
I still don't know how to generate a Rails app in any version other than 5.1.1, and simply changing the version in the gemfile still doesn't work for me. It seems to me that some other changes are need.
I switched the version of rails in the gemfile from 5.1.1 to 5.0.3. looked at the /config/application.rb files from Rails apps using 5.0.2 and found that they had a different setup.
Mine looked had this:
module AppName
class Application < Rails::Application
config.load_defaults 5.1
end
end
And the rails app generated in 5.0.2 had like this:
module AppName
class Application < Rails::Application
config.generators do |generate|
generate.assets false
end
end
end
So I swapped out what I had with that and it worked! I don't really know why it worked and I still don't know why I can just generate a 5.0.3 Rails app from the get go.
I am by no means a Spree expert, but from what it looks like, 5.1.1 is not compatible with Spree.
spree (~> 3.2.0) was resolved to 3.2.0, which depends on
spree_frontend (= 3.2.0) was resolved to 3.2.0, which depends on
canonical-rails (~> 0.1.0) was resolved to 0.1.2, which depends on
rails (< 5.1, >= 4.1)
In your Gemfile, go ahead and put gem 'rails', '5.0.3' at the top (replacing any other rails gems), then rm Gemfile.lock followed by a bundle
Should do the trick.
please help me with this bundle install error....
Resolving
dependencies...............................................................
Bundler could not find compatible versions for gem "actionpack":
In Gemfile:
irwi was resolved to 0.5.0, which depends on
actionpack (>= 4.0)
rails (= 3.1.4) was resolved to 3.1.4, which depends on actionpack
(= 3.1.4)
You must either update your Rails version (this will update your actionpack) or downgrade irwi to an old version which is compatible with Rails 3.1.4
I strongly recommend updating Rails
According to docs for irwi (README) and gemspec
Irwi is a Ruby on Rails 4 plugin which adds wiki functionality to your application.
it seems like it will work only with RoR 4+