rails 2.3.14 + google adwords api = trouble - ruby-on-rails

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

Related

Upgrading from Rails 5.2.8.1 to Rails 6

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.

Which version of this gem am I using?

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.

bundle install error Bundler could not find compatible versions for gem "actionpack": In GemFile: irwi was resolved to 0.5.0

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+

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!

How to install Refinery CMS using Rails 4

I previously never had a problem with Refinery. I was refreshing my knowledge by following along to the tutorial http://railscasts.com/episodes/332-refinery-cms-basics .Then when I created a new app with Refinery CMS, I got this error
Bundler could not find compatible versions for gem "actionmailer":
In Gemfile:
refinerycms (~> 2.1.0) ruby depends on
actionmailer (< 3.3, >= 3.1.3) ruby
rails (= 4.0.0) ruby depends on
actionmailer (4.0.0)
But should not these things be there by default with the CMS? why would there be errors only now?
The latest code supports Rails 4; the gem must be sourced from the master branch, until a release is made.
Git Issue #2428 - Rails 4 support
Add to your Gemfile:
gem 'refinerycms-i18n', github: 'refinery/refinerycms-i18n', branch: 'master'
gem 'refinerycms', github: 'refinery/refinerycms', branch: "master"
# Strong parameters is a new feature not used by Refinery
gem 'protected_attributes'
Do a:
$ bundle install
Create a new Refinery app, the command will be different depending on what you want to do. For that there are a few guides that you can follow. In my case, I added it to an existing app with:
$ rails generate refinery:cms --fresh-installation
Start your server and go to: http://localhost:3000/refinery
Well, my five cents are that Refinery is not yet available for Rails 4:
Is there any cms for Rails 4?
http://refinerycms.com/
http://refinerycms.com/blog/refinery-cms-210-released
Best,
Ben.
Simply initialize the application using:
rails new my_new_application -m http://refinerycms.com/t/edge
Behind the scenes:
This command makes your application use the master branch of refinery, which supports Rails 4.
Update
Although the above is the easiest and official way, it didn't totally work for me. I had to manually run the following command after the above one:
rails generate refinery:cms --fresh-installation
Looks like the rails4 branch has been getting a bit of love over the past few days:
https://github.com/refinery/refinerycms/tree/rails4
I will try it out and update with how I get on.
OK, let's try and answer this one. This is the route I went down.
First, I installed the refinerycms gem.
gem install refinerycms
I then did a:
rbenv rehash
Then I followed the guide:
refinerycms rickrockstar
Bundler complained:
Bundler could not find compatible versions for gem "refinerycms-core":
In Gemfile:
refinerycms (~> 3.0) ruby depends on
refinerycms-images (= 3.0.0) ruby depends on
refinerycms-core (= 3.0.0) ruby
refinerycms (~> 3.0) ruby depends on
refinerycms-images (= 3.0.0) ruby depends on
refinerycms-core (= 3.0.0) ruby
refinerycms (~> 3.0) ruby depends on
refinerycms-images (= 3.0.0) ruby depends on
refinerycms-core (= 3.0.0) ruby
refinerycms (~> 3.0) ruby depends on
refinerycms-images (= 3.0.0) ruby depends on
refinerycms-core (= 3.0.0) ruby
refinerycms-wymeditor (>= 1.0.6, ~> 1.0) ruby depends on
refinerycms-core (>= 3.0.0, ~> 3.0) ruby
refinerycms-acts-as-indexed (>= 1.0.0, ~> 1.0) ruby depends on
refinerycms-core (~> 2.1.0) ruby
In my gemfile, I changed the following lines:
gem 'rails', '4.2.4'
gem 'refinerycms'
gem 'refinerycms-acts-as-indexed'
gem 'refinerycms-wymeditor'
And this solved the issue.
I had to then do a:
bundle install
Then a:
rails generate refinery:cms --fresh-installation
I posted an issue on github and got the following answer from the RefineryTeam:
It looks like the culprit was refinerycms-acts-as-indexed version - it should be ~> 2.0.1 to work with Refinery 3.0.0
https://github.com/refinery/refinerycms/issues/3072
Please also see this page where things might be running more smoothly than following the guide on Refinery's website. What is to be seen there is similar to Zuhaib Ali's answer above (in a bit more details).
Hope this helps

Resources