Which version of this gem am I using? - ruby-on-rails

I updated the shopify_api gem in my gem file to this:
gem 'shopify_api', '~>4.9'
When I do gem list I get
shopify_api (4.9.0, 4.3.2, 4.0.7)
When I do bundle show shopify_api I get
/home/user/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/shopify_api-4.9.0
In my Gemfile.lock I have the following entries
shopify_api (4.9.0)
activeresource (>= 3.0.0)
rack
shopify_app (7.2.8)
omniauth-shopify-oauth2 (~> 1.1.11)
rails (>= 4.2.6)
shopify_api (>= 4.3.2)
My question is which version of the shopify_api gem am I using? And is there a definitive way to find out?

The gem list command shows you all versions of the gem installed. As the gem tool doesn't have any way of knowing which you're using it can't tell you. All it can do is install, uninstall, or reinstall gems.
The bundle show command will tell you which one is being used as per your Gemfile and Gemfile.lock settings.

Related

Can't install sprockets-es6 gem because of sprockets dependecy

I'm new to Rails, and am trying to change an existing Rails app to use ES6 over Coffeescript. I've looked around online and seems like it should be as simple as adding the following to my Gemfile to get started with transpiling Babel:
gem 'sprockets'
gem 'sprockets-es6', require: 'sprockets/es6'
When I add this and then bundle install I get the following error:
Bundler could not find compatible versions for gem "sprockets":
In Gemfile:
rails (= 3.2.21) ruby depends on
railties (= 3.2.21) ruby depends on
actionpack (= 3.2.21) ruby depends on
sprockets (~> 2.2.1) ruby
sprockets (>= 3.0.0.beta) ruby
I'm really not all that familiar with Rails, but my understanding is that specified Rails gem is incompatible with the specified Sprockets gem, right? Can someone point me in the right direction about how I can resolve this?
Replace the following line in Gemfile
gem 'sprockets'
by
gem 'sprockets', '~>2.2.1'
This means that you have latest version of sprockets that is not supported by earlier version of action pack.

neo4j will_paginate gem installation issue

Running bundle install after including the gem gives me this
Bundler could not find compatible versions for gem "activesupport":
In Gemfile:
neo4j-will_paginate (>= 0) ruby depends on
activesupport (~> 3.0) ruby
rails (= 4.1.6) ruby depends on
activesupport (4.1.6)
I am on gem 'rails', '4.1.6' and the app was originally created without AR and added back in later.
I have seen some other example SO but don't want to do any gemlock changes without certainy
Suggestions on troubleshooting?
Use neo4j-will_paginate_redux, not that gem. We rereleased under this name because we could not get access to the original on Rubygems.

Rails gem for adding an on site tutorial supported for rails 4

I'm attempting to add an on boarding tutorial to my site. I've installed the joyride-rails gem and am getting this error when running bundle install.
Bundler could not find compatible versions for gem "rails":
In Gemfile:
joyride-rails (~> 0.0.14) ruby depends on
rails (~> 3.1) ruby
rails (4.1.6)
I've done some research and found this answer Dependency error while installing the gem "joyride-rails"
And this answer Simple Javascript Joyride plugin in rails
The problem is I think that the joyride gem just isn't compatible with rails 4 and when I down grade to 3.1 a bunch of my other gems are in conflict. I delte the gemfile.lock and run bundle install and get this error.
Bundler could not find compatible versions for gem "railties":
In Gemfile:
coffee-rails (~> 4.0.0) ruby depends on
railties (< 5.0, >= 4.0.0.beta) ruby
rails (= 3.1) ruby depends on
railties (3.1.0)
Any suggestions as to how I can implement this gem? Or do you know of another Gem that will accomplish the same goal?
Thanks!

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

rails 2.3.14 + google adwords api = trouble

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'.

Resources