I have to bring a fix that was made on rack 1.4.5 to my 1.36 rack. Can not upgrade rack as ruby is not happy with it
Bundler could not find compatible versions for gem "rack":
In Gemfile:
sass-rails (~> 3.1.4) ruby depends on
rack (~> 1.3.6) ruby
rack (1.4.5)
w/o this fix (https://github.com/rack/rack/blob/rack-1.4/lib/rack/deflater.rb), my app error is randomly throwing app errors.
What is the best way to just bring this change without having to change the version.
Thank you so much for your help!
Jagrati
2 ways comes to my mind
either monkey patching
or
creating a repo fork from 1.3.6 version patching that and using that repo.
Related
We want to prepare our app for Rails 6.
gem 'rails', git: 'https://github.com/rails/rails.git', tag: 'v6.0.0.beta2'
I ran bundle install.
Bundler could not find compatible versions for gem "actionpack":
In Gemfile:
rails was resolved to 6.0.0.beta2, which depends on
actionpack (= 6.0.0.beta2)
rails-controller-testing was resolved to 1.0.4, which depends on
actionpack (>= 5.0.1.x)
rspec-rails was resolved to 3.8.2, which depends on
actionpack (>= 3.0)
sprockets-rails (~> 3.2.1) was resolved to 3.2.1, which depends on
actionpack (>= 4.0)
Not sure how exactly to go forward (should I comment out all gems which are listed as problematic? It seems to me that all dependencies are are using >= operator - doesn't this mean that actionpack (= 6.0.0.beta2) should be OK too? Can I get some guidance?
I invested more time into this and learned how to solve those issues. I am pretty sure that I didn't post most important part of the output about dependencies.
Normally there are gems which are locked to some gem versions. You want to find them manually via output. Be careful about output like this:
gem_xyz was resolved to 3.8.2, which depends on
actionpack (< 3.0)
Then you can check whether there is a fix on specific Github branch for e.g. Rails 6 version and use the gem directly from that branch. Not super easy but you can go forward slowly and prepare you project to be Rails6 a little bit earlier ...
I had the same issue when I was trying to test 6.0.0.rc2. I solved by removing the gem minitest-rails-capybara from the Gemfile and by improving system tests according to
https://edgeguides.rubyonrails.org/testing.html
The issue is not with actionpack but the other gems you are trying to install, the versions are not compactible with actionpack (= 6.0.0.beta2)
rails-controller-testing was resolved to 1.0.4
rspec-rails was resolved to 3.8.2
sprockets-rails (~> 3.2.1) was resolved to 3.2.1
You need to find versions that are compactible with the version of your actionpack. The version of actionpack is determined by the version of rails you are using. I had similar experience with
rspec-rails (~>3.4.2) and,
factory_girl_rails (~>1.0.4)
Upgrading both resolves the issue.
I have tried to rebuild my gemlock file by removing it and running bundle install.
I have tried to remove the gem rack 1.6.1 and got this message:
You have requested to uninstall the gem:
rack-1.6.1
actionpack-4.2.1 depends on rack (~> 1.6)
I have done bundle update but it only updates rack to version 1.5.5
How can I resolve this conflict?
I turns out that I was using Rails 4.1.2 which used Rack 1.5.5. When I updated my Rails app to use Rails 4.2.6 the later version of rack was loaded and this conflict in the gems was solved.
I'm trying to get Helios (https://github.com/helios-framework/helios) to work with an existing Ruby on Rails 3.1 application. But there's a conflict regarding rack version; bundle install gives me this:
Bundler could not find compatible versions for gem "rack":
In Gemfile:
helios (>= 0) ruby depends on
rack (~> 1.4) ruby
rails (>= 3.1) ruby depends on
rack (1.3.9)
Any ideas on how to proceed?
How can I use rack 1.3.0 with rails. I tried putting gem 'rack', '1.3.0' in Gemfile and did bundle update rack but it says
Bundler could not find compatible versions for gem "rack":
In Gemfile:
rails (= 3.0.9) depends on
rack (~> 1.2.1)
rack (1.3.0)
I am having issues with rack version <= 1.2.3 here lib/rack/utils.rb#L495. I don't see this in rack 1.3.0, so wanted to give a try. But clearly rails is not allowing to use rack 1.3.
Is there any workaround?
The short answer is: you can't use rack 1.3 with Rails 3.0. As the error states, Rails 3.0.9 depends on Rack 1.2.x with x >= 1.
If you need rack 1.3, you should try Rails 3.1 which currently depends on rack ~> 1.3.2 (i.e. 1.3.x with x >= 2). An alternative could be to change the actionpack gemspec locally to require rack 1.3. But then you are on your own and there will probably be grues coming out of holes and eating all your loved ones...
There's this snazzy captcha that asks questions rather than displaying pictures. You can read about it at textcaptcha.com. Anyway. I want to use that with Ruby on Rails. A developer by the name of Matt Hutchinson wrote a Gem for easily connecting to the API. He has a set of instructions next to his source files on github. Anyway, It looks pretty simple but in trying to implement it I get this error every time:
undefined method `acts_as_textcaptcha' for #<Class:0x104098508>
Rails.root: /Users/cory/Documents/Learning/RoR/dpt
Application Trace | Framework Trace | Full Trace
app/models/citation.rb:20
app/controllers/citations_controller.rb:29:in `new'
The root of my question has a bit less to do with this specific gem, and a little more with how gems work. I've installed the gem, and then bundled it inside of my rails app, it should be accessible (as I understand it). I see references to the gem in the gemfile.rb and the gemfile.lock, but again and again it tells me I'm using and undefined method.
The gem should be defining the method for me, should it not? Or is there something that I manually have to do?
Just let me know if there is any other info that would be helpful, thanks!
Well, jeez. It's working now. It could be that I restarted the server, but I'm not positive. What I did was installed RubyMine to see if I could use it's debugger, in doing so it required that I run the bundle install (it chose some different versions of some dependancies) through there, and also stop my other webrick server, to run the one through the RubyMine console. I did so, it gave me errors, when when I went back to my other installer it worked!?
Anyway, I've got my question resolved, but in the event that anyone looks this up, these are my current gems:
$ bundle install
Using rake (0.8.7)
Using abstract (1.0.0)
Using activesupport (3.0.0)
Using builder (2.1.2)
Using i18n (0.4.2)
Using activemodel (3.0.0)
Using erubis (2.6.6)
Using rack (1.2.1)
Using rack-mount (0.6.13)
Using rack-test (0.5.7)
Using tzinfo (0.3.24)
Using actionpack (3.0.0)
Using mime-types (1.16)
Using polyglot (0.3.1)
Using treetop (1.4.9)
Using mail (2.2.15)
Using actionmailer (3.0.0)
Using arel (1.0.1)
Using activerecord (3.0.0)
Using activeresource (3.0.0)
Using bcrypt-ruby (2.1.4)
Using acts_as_textcaptcha (2.2.0)
Using bundler (1.0.10)
Using thor (0.14.6)
Using railties (3.0.0)
Using rails (3.0.0)
Using sqlite3-ruby (1.2.5)
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
Thanks all!
But if you are trying this, do try restarting the server first as suggested, I wish I knew if that would have worked :D