I am using Administrate in my rails app, it is upgraded from 0.9.0 to 0.15.0 version. After that rack is upgraded to 2.2.3 as following.
I also using grape and wine_bouncer with Doorkeeper for authorization.
wine_bouncer requires Grape > 0.10 and < 1.2
Due to this incompatible version issue, I want to keep my rack version as 2.0.8 and grape is 1.2.5. How can I force rack down to 2.0.8? I don't see rack in gemfile.
Add to Gemfile gem 'rack', '= 2.0.8' and after run bundle command. Now rack version is 2.0.8
Related
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 am trying to install jimson gem in my Rails 4.2 app :
Gemfile :
gem 'jimson', '~> 0.10.0'
After bundle, I get this error :
Fetching gem metadata from https://rubygems.org/.........
Fetching version metadata from https://rubygems.org/..
Resolving dependencies...
Bundler could not find compatible versions for gem "rack":
In snapshot (Gemfile.lock):
rack (1.6.0)
In Gemfile:
jimson (~> 0.10.0) ruby depends on
rack (~> 1.4.5) ruby
As the error says, jimson depends on rack 1.4.5, and my current rack version is 1.6.0
(I already get the same error with multi_json gem and I downgrade it from 1.11.0 to 1.7.6 and now it asks me to downgrade to rack 1.4.5 !!)
Is it a good idea to replace rack 1.6.0 with rack 1.4.5 ? I am not sure if there is another solution to use jimson without modifying the installed gems !!
Downgrading rack wouldn't work because rails 4.2 requires rack 1.6.
It is entirely possible that this gem would work with newer versions of rack - 1.4.5 was probably just the current version at the time.
To test this theory you would need to fork the gem and update the dependency. I'd check that the gems tests/specs still run and you can then add your fork of the gem to your app as a :git dependency. Also consider sending a pull request to the original author.
In this case you don't need to do any of this because someone has already created such a pull request, and the travis specs pass for that pull request, so you'd just need to merge the changes from that pull request into your fork
Project rails 2.3.14
gem 'google-adwords-api', '0.7.2'
bundle install
The error:
Bundler could not find compatible versions for gem
"rack": In Gemfile:
google-adwords-api (= 0.7.2) ruby depends on
rack (~> 1.4) ruby
rails (= 2.3.14) ruby depends on
rack (1.1.0)
Is it possible to fix this issue without using newer version of Rails?
try this..
bundle exec bundle install
You could try it without a specific version, to see if there are any compatable versions, like this gem 'google-adwords-api' instead of gem 'google-adwords-api', '0.7.2'.
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...
My setup: Rails 3.0.9, Ruby 1.9.2
I want to check the gem version for my app through the Rails console. In my gemfile, I have
gem 'rack', '1.2.3'
Ran bundle install after. In the Rails console,
>> Rack.version
=> "1.1"
Any idea why?
UPDATE
Gemfile.lock
GEM
remote: http://rubygems.org/
specs:
actionpack (3.0.9)
...
rack (~> 1.2.1)
...
rack (1.2.3)
rack-mount (0.6.14)
rack (>= 1.0.0)
warden (1.0.4)
rack (>= 1.0)
DEPENDENCIES
...
rack (= 1.2.3)
...
There are several rack versions listed in gemfile.lock.
Rack.version
will return the protocol version,
Rack.release
is probably what you are you looking for.
https://github.com/rack/rack/blob/master/lib/rack.rb#L14
Otherwise:
Gem.loaded_specs["rack"]
Example:
Gem.loaded_specs["rack"]
# => #<Gem::Specification name=rack version=1.3.2>
Gem.loaded_specs["rack"].version
# => #<Gem::Version "1.3.2">
Gem.loaded_specs["rack"].version.to_s
# => "1.3.2"
Every gem has ::VERSION constant..
so just use Rack::VERSION or OpenSSL::VERSION in console which should give you the version of gem loaded in that console.
we can use bundle list or bundle show to list all Gems included by the bundle.
Maybe you have multiple version of rack installed, try running gem uninstall rack and see if it offers you two options to choose from, Rack 1.1 and Rack 1.2.3. If so, choose to uninstall Rack 1.1.
If this still does not work, just uninstall Rack and try running bundle update.
I had this problem when I was using multiple rake versions 0.8.7 and 0.9.2, this helped me.