ruby gemfile rest-client version conflict - ruby-on-rails

I mean, users are encouraged to upgrade to rest-client 2.0, I need to upgrade for some mail api only support 2.0 version, but now I meet this problem.
When I change rest-client version to 2.0.2 in my Gemfile, and I meet this problem.
Bundler could not find compatible versions for gem "rest-client":
it seems that rest-client 2.0 version is conflict with docverter which depends on rest-client (~> 1.6.7)
So how should I do to solve? I need rest-client version to be above 2.0.
here's my Gemfile:
source 'https://rubygems.org'
ruby '2.4.1'
gem 'rails'
# Forms
gem 'wicked'
gem 'localstorageshim-rails'
gem 'simple_form'
# Monitoring
gem 'newrelic_rpm'
gem 'slack-notifier'
gem 'puma_worker_killer'
# Assets
gem 'sass-rails'
gem 'haml-rails'
gem 'uglifier'
gem 'autoprefixer-rails'
# Design
gem 'bootstrap-sass'
gem 'font-awesome-sass'
gem 'nprogress-rails'
gem 'normalize-rails'
# Markdown
gem 'marked-rails'
gem 'rdiscount'
# Javascript
gem 'react-rails'
gem 'coffee-rails'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jquery-turbolinks'
# Authentication
gem 'devise'
gem 'pundit'
# Data
gem 'pg'
# Payments
gem 'stripe'
gem 'braintree'
# Crypto
gem 'hashids'
# Images
gem 'lazyload-rails'
# Files
gem 'rest-client', '>= 2.0'
gem 'docverter'
# Utils
gem 'annotate'
gem 'jbuilder'
gem 'sdoc', group: :doc
group :development do
gem 'spring'
gem 'spring-commands-rspec'
gem 'better_errors'
gem 'binding_of_caller', :platforms=>[:mri_21]
gem 'html2haml'
gem 'hub', :require=>nil
gem 'quiet_assets'
gem 'rails_layout'
end
group :development, :test do
gem 'factory_girl_rails'
gem 'faker'
gem 'rspec-rails'
end
group :production do
gem 'rails_12factor'
gem 'puma'
gem 'heroku_rails_deflate'
gem 'rack-timeout'
end
group :test do
gem 'capybara'
gem 'database_cleaner'
gem 'launchy'
gem 'selenium-webdriver'
end

Unfortunately you can only have one version of a gem activated at a time. So when there are conflicting version dependencies like this, you have to pick one.
The latest Docverter code requires rest-client 1.x:
https://github.com/Docverter/docverter-ruby/blob/5775e5a8bc00610d3168141cc44a83b4af41717a/docverter.gemspec#L20
In this situation, your best bet is probably to make a fork changing the dependency to ~> 2.0 and issue a pull request. In the best case, the maintainers will merge your pull request quickly.
In the worst case, you can use your forked version by specifying a git URL in the Gemfile. http://bundler.io/v1.15/guides/git.html

run
bundle update rest-client
and then bundle install once rest-client is updated.

Related

how to fix ruby bundle install error?

Everytime I try to run bundle install inside a local copy of this RoR project directory, I get an error. I have rvm installed with ruby 2.1.2 and 2.2.2, rails is installed as well. I am running via vagrant on this box, Ubuntu 14.04 with 1gb of ram tho I don't think any of this is relevant? I can't seem to find the missing file the error is pointing to as well?
Update: Here is the Gemfile
source 'https://rubygems.org'
ruby '2.2.2'
gem 'rails', '~> 4.1.6'
#gem 'catarse_api', path: '~/code/catarse_api'
gem 'catarse_api', github: 'catarse/catarse_api'
gem 'protected_attributes'
gem 'rails-observers'
gem 'sidekiq', '~> 3.1.3'
# Turns every field on a editable one
gem "best_in_place", :git => "git://github.com/bernat/best_in_place", ref: "ee95961e639022e6aa528704b8cb4789596ea61b"
# State machine for attributes on models
gem 'state_machine', require: 'state_machine/core'
# Database and data related
gem 'pg', '0.17.1'
gem 'dbhero', '>= 1.1.6'
gem 'postgres-copy'
gem 'pg_search'
gem 'i18n_alchemy'
gem 'schema_plus'
gem 'chartkick'
gem 'catarse_settings_db', '>= 0.1.0'
# Notifications
gem 'user_notifier', '~> 0.0.5'
# Mixpanel for backend tracking
gem 'mixpanel-ruby'
gem 'mixpanel_client'
# Payment engines
gem 'catarse_moip', '~> 3.2.0'
gem 'catarse_pagarme', '2.6.8'
#gem 'catarse_pagarme', path: '../catarse_pagarme'
# Decorators
gem 'draper'
# Frontend stuff
gem 'slim-rails'
gem 'jquery-rails'
gem 'browser'
gem "cocoon"
# Static pages
gem 'high_voltage'
# Authentication and Authorization
gem 'omniauth'
gem 'omniauth-twitter'
gem 'omniauth-facebook'
gem 'devise'
gem 'ezcrypto'
gem 'pundit'
# Email marketing
gem 'catarse_monkeymail', '>= 0.1.6'
# HTML manipulation and formatting
gem 'simple_form'
gem 'mail_form'
gem "auto_html"
gem 'kaminari'
gem 'redactor-rails', github: 'catarse/redactor-rails'
# Uploads
gem 'carrierwave', '~> 0.10.0'
gem "mini_magick"
# Other Tools
gem 'to_xls'
gem 'ranked-model'
gem 'feedjira'
gem 'inherited_resources'
gem 'has_scope', '>= 0.6.0.rc'
gem 'spectator-validates_email', require: 'validates_email'
gem 'video_info', '>= 1.1.1'
gem 'httparty', '~> 0.6.1' # this version is required by moip gem, otherwise payment confirmation will break
# Translations
gem 'http_accept_language'
gem 'routing-filter', '~> 0.4.0.pre'
# Payment
gem 'moip', github: 'catarse/moip-ruby', ref: 'c0225ad71645cd1df35dafa1e45c9f092b3abb9e'
gem 'httpclient', '>= 2.2.5'
group :production do
# Gem used to handle image uploading
gem 'fog', '>= 1.3.1'
# Workers, forks and all that jazz
gem 'unicorn'
# Enabling Gzip on Heroku
# If you don't use Heroku, please comment the line below.
gem 'heroku-deflater', '>= 0.4.1'
# Make heroku serve static assets and loggin with stdout
#gem 'rails_on_heroku'
gem 'rails_12factor'
# Monitoring with the new new relic
gem 'newrelic_rpm'
# Using dalli and memcachier have not presented significative performance gains
# Probably this is due to our pattern of cache usage
# + the lack of concurrent procs in our deploy
#gem 'memcachier'
#gem 'dalli'
end
group :development do
gem "letter_opener"
gem 'foreman'
gem 'better_errors'
gem 'binding_of_caller'
gem 'thin'
# Uncomment only for optimization, should be commented on master branch
# gem 'rack-mini-profiler'
# gem 'ruby-prof'
end
group :test, :development do
gem 'rspec-rails', '~> 3.1'
gem 'rspec-mocks'
gem 'rspec-its'
gem 'rspec-collection_matchers'
gem 'pry'
gem 'jasmine-rails'
end
group :test do
gem 'zonebie'
gem 'fakeweb'
gem 'poltergeist'
gem 'launchy'
gem 'database_cleaner'
gem 'shoulda'
gem 'factory_girl_rails'
gem 'capybara', '~> 2.2.0'
gem 'selenium-webdriver'
end
gem 'sass-rails'
gem 'coffee-rails'
gem 'compass-rails'
gem 'uglifier'
gem 'compass-960-plugin'
gem 'sprockets'
# FIXME: Not-anymore-on-development
# Gems that are with 1 or more years on the vacuum
gem 'weekdays'
ps: please point out any relevant info i should provide as well to help determine the cause.
Apparently there was an issue with bundler, here's how this worked out for me:
cleanup by running gem cleanup bundler
reinstall bundler via gem install bundler

Removing therubyracer dependency on windows using execjs

I've read an amazing solution to solve therubyracer on windows problem: therubyracer gem on windows, but I don't exactly know how to remove the dependency of therubyracer from less-rails gem. After I bundle install a gemfile without therubyracer, it still display an error
[WARNING] Please install gem 'therubyracer' to use Less...
This is what I wrote for my gemfile:
source 'https://rubygems.org'
ruby '2.0.0'
gem 'rails'
gem 'execjs'
group :development do
gem 'sqlite3'
end
group :production do
gem 'rails_12factor'
gem 'pg'
end
gem 'sass-rails'
gem 'coffee-rails'
gem 'uglifier'
gem 'less'
gem 'less-rails'
gem 'haml'
gem 'haml-rails'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder'
gem 'twitter-bootstrap-rails'
gem 'jquery-rails'
gem 'jquery-ui-rails'
gem 'designmodo-flatuipro-rails'
gem 'protected_attributes'
gem 'angularjs-rails'
group :doc do
gem 'sdoc', require: false
end
You could try therubyracer_for_windows, it packages the v8 dll.

bundle install error activeadmin ransack

Am trying to install my own project onto a secondary computer - both are macosx 10.8.4, both setup using macports and RVM.
For some reason as I'm trying to bundle install I'm getting this error:
```
Bundler could not find compatible versions for gem "ransack":
In Gemfile:
activeadmin (>= 0) ruby depends on
ransack (>= 1.0.0) ruby
ransack (0.7.3)
Bundler could not find compatible versions for gem "actionpack":
In Gemfile:
ransack (>= 0) ruby depends on
actionpack (>= 4.0.0) ruby
sass-rails (~> 4.0.0) ruby depends on
actionpack (4.0.0.beta1)
```
Not sure why bundle install works fine on one computer and not the other; I recently participated in this ransack issue on with activeadmin on github and it seemed to be fixed; unsure why it's popping up again.
UPDATE: gem file:
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 4.0.0'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 1.2'
gem 'ZenTest'
# Add Foundation Here
#gem 'compass-rails' # you need this or you get an err
# gem 'compass-rails', github: 'milgner/compass-rails', branch: 'rails4'
# gem 'zurb-foundation', '~> 4.0.0'
gem 'paperclip', '>= 3.4.0' # image upload
gem 'aws-sdk'
# gem 'bootstrap-sass', '~> 2.3.2.1'
gem 'anjlab-bootstrap-rails', :require => 'bootstrap-rails',
:github => 'anjlab/bootstrap-rails',
:branch => '3.0.0'
gem 'devise', github: 'plataformatec/devise'
gem 'devise_security_extension', :github => 'phatworx/devise_security_extension' # security questions
# administration
gem 'activeadmin', github: 'gregbell/active_admin', branch: 'rails4'
gem 'ransack', github: 'ernie/ransack', branch: 'rails-4'
gem 'inherited_resources', github: 'josevalim/inherited_resources'
gem 'formtastic', github: 'justinfrench/formtastic'
gem "rich", github: 'bastiaanterhorst/rich'
# gem 'active_admin_editor'
gem 'survey', :git => 'git://github.com/runtimerevolution/survey.git'
# voting
# gem 'acts_as_votable', github: 'ryanto/acts_as_votable'
gem "acts_as_votable", "~> 0.7.1"
gem 'friendly_id', '5.0.0.beta4' # Note: You MUST use 5.0.0 or greater for Rails 4.0+
group :doc do
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', require: false
end
# Use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# Use unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano', group: :development
# Use debugger
# gem 'debugger', group: [:development, :test]
group :development do
gem 'better_errors'
gem 'binding_of_caller'
gem 'meta_request'
gem 'rspec-rails'
gem 'spork'
gem 'spork-rails', :github => 'sporkrb/spork-rails'
gem 'annotate'
end
group :test do
gem 'rspec'
gem 'autotest'
gem 'autotest-growl'
gem 'autotest-fsevent'
end
I think you don't want to use the rails-4 branch of ransack. It looks like the current master version supports Rails 4.
The dependency on the rails4 branch of activeadmin says that it needs ransack >= 1.0.0, but the version of ransack on the rails-4 branch is 0.7.3.
It is probably a better idea to use the released versions of gems from Rubygems unless you need specific unreleased fixes in the Git repo.

ZenTest 4.9.3 shows as invalid gemspec

I keep getting this error when trying to run ZenTest
Invalid gemspec in [/usr/local/rvm/gems/ruby-1.9.3-p194/specifications/ZenTest-4.9.3.gemspec]: Illformed requirement ["< 2.1, >= 1.8"].
I have tried removing the ZenTest 4.9.3 and gem instal ZenTest 4.8.3 but that version cannot be found in any repositories so it automatically installs ZenTest 4.9.3 which keeps having an error and hence I cant run spork or autotest. Is there any way around this? Thanks!
Here is my gemfile:
source 'https://rubygems.org'
gem 'rails', '3.2.11'
gem 'spork'
gem 'rspec-core'
gem 'autotest', '4.4.6'
gem 'autotest-rails', '4.1.2'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
group :development, :test do
gem 'sqlite3'
gem 'rspec-rails'
gem 'webrat'
gem 'capybara'
gem 'Zentest', '4.8.3'
end
group :production do
gem 'pg'
end
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platforms => :ruby
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# To use Jbuilder templates for JSON
# gem 'jbuilder'
# Use unicorn as the app server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'debugger'
I had the same problem. After digging, I found the solution. The problem is most likely to be with the version of RubyGems installed in your system. (It would be <1.8.25)
Till that version, RubyGems didn't roundtrip gemspecs properly and thus couldn't parse "< 2.1, >= 1.8" correctly.
So, go through these steps:
gem uninstall ZenTest
gem update --system
gem install ZenTest
The problem should get solved and you should no longer receive the warnings.

Bundler could not find compatible versions for gem “railties” for Rails 4.0.0

I am trying to upgrade to Rails 4.0.0, and I changed the gem versions of sass-rails and coffee-rails. I need to resolve this gem conflict between rails and coffee-rails before I can upgrade to Rails 4.
When I ran bundle update this is the output I got:
$ bundle update
Updating git://github.com/pilu/web-app-theme.git
Fetching source index from https://rubygems.org/
Resolving dependencies..............
Bundler could not find compatible versions for gem "railties":
In Gemfile:
rails (= 4.0.0) ruby depends on
railties (= 4.0.0) ruby
coffee-rails (= 4.0.0) ruby depends on
railties (4.0.0.rc2)
My Gemfile:
source 'https://rubygems.org'
gem 'rails', '4.0.0'
gem 'cancan'
gem 'client_side_validations'
gem 'devise', '~> 1.5.3'
gem 'dynamic_form'
gem 'execjs'
gem 'haml'
gem 'httparty'
gem 'jquery-rails'
gem 'mysql2'
gem 'paperclip', '~> 2.4'
gem 'prawn'
gem 'rails3-jquery-autocomplete'
gem 'rake', '0.9.2'
gem 'remotipart', '~> 1.0'
gem 'simple_datatables'
gem 'therubyracer'
gem 'validates_timeliness', '~> 3.0.2'
gem 'will_paginate', '~> 3.0'
gem 'turbolinks'
gem 'jquery-turbolinks'
gem 'noty-rails'
gem 'font-awesome-rails'
gem 'socket.io-rails'
gem 'attr_encrypted'
gem 'bullet', :group => 'development'
#temp for demo.managetherapy.com
#gem 'faker'
group :test do
gem 'capybara'
gem 'cucumber-rails', :require => false
gem 'database_cleaner'
gem 'factory_girl_rails'
# gem 'faker'
gem 'guard-rspec'
gem 'selenium-webdriver', '2.7.0'
gem 'webrat'
end
group :development, :test do
gem 'faker'
gem 'haml-rails'
gem 'hpricot'
gem 'rspec-rails'
gem 'ruby_parser'
#gem 'web-app-theme', '~> 0.8.0'
gem 'web-app-theme', :git =>'git://github.com/pilu/web-app-theme.git'
end
gem 'sass-rails', '4.0.0'
gem 'compass-rails', '1.0.3'
gem 'coffee-rails', '4.0.0'
gem 'uglifier', '>= 2.1.1'
gem 'bootstrap-sass-rails'
# Use unicorn as the web server
#gem 'unicorn'
# Deploy with Capistrano
gem 'capistrano'
gem 'rvm-capistrano'
gem 'passenger'
Also bundle update only allows you to update one gem at a time, which is hard if you are updating to Rails 4 and a whole lot of gems have to be updated at the same time.
I solved this by deleting the Gemfile.lock and doing bundle install.
This is of course assuming you have no conflicting explicit gem version in your Gemfile to start with. So if this fails, remove version numbers from the Gemfile.
Just remove gem versions (coffee-rails and sass-rails) from Gemfile and run bundle update
Run gem update rails first, then bundle update
You have an outdated version of Devise, use Rails 4 compatible
gem 'devise', '~> 3.0.0.rc'
Also change coffee-rails to
gem 'coffee-rails', '~> 4.0.0'
and try doing
bundle update coffee-rails
You have gems that aren't supported by Rails 4. Comment out all the gems except for Rails 4 and uncomment them one at a time after running bundle install to find the culprits. You might need to undo some of your version locks.
Delete the Gemfile.lock file
refer here for basic gemfile changes
run bundle install
Everything will work fine. :)

Resources