I'm a ruby/rails newbie.
Here is my gemfile:
source 'https://rubygems.org'
ruby '2.0.0'
#ruby-gemset=railstutorial_rails_4_0
gem 'rails', '4.0.0'
group :development do
gem 'sqlite3', '1.3.8'
gem 'ruby-debug-ide'
end
gem 'sass-rails', '4.0.0'
gem 'uglifier', '2.1.1'
gem 'coffee-rails', '4.0.0'
gem 'jquery-rails', '3.0.4'
gem 'turbolinks', '1.1.1'
gem 'jbuilder', '1.0.2'
gem 'wash_out', :git => 'git://github.com/inossidabile/wash_out.git'
gem 'haml'
gem "railties", "~> 4.0.0"
group :doc do
gem 'sdoc', '0.3.20', require: false
end
On bundle update, I get this:
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.rc1)
The sass-rails issue should be solved since I'm using ~> correct? How can I have both rails and sass-rails installed at the same time?
If you put sass-rails before rails in your Gemfile, it resolves correctly.
Your problem is that you can only use one version of a gem at a time. the ~> will only allow for version changes on that gem.
You need to change the version of sass-rails you're requiring to 4.0.1.
You should update the following line in your Gemfile:
gem 'rails', '4.0.0'
to
gem 'rails', '~> 4.0.0'
and then run bundle update.
Related
When i try bundle update command retrieve this error
Resolving dependencies....
Bundler could not find compatible versions for gem "actionpack":
In Gemfile:
twitter-bootstrap-rails was resolved to 3.2.2, which depends on
less-rails (>= 2.5.0) was resolved to 3.0.0, which depends on
actionpack (>= 4.0)
rails (= 4.2.5.1) was resolved to 4.2.5.1, which depends on
actionpack (= 4.2.5.1)
twitter-bootstrap-rails was resolved to 3.2.2, which depends on
actionpack (>= 3.1)
In the first gem "actionpack" i have a compatible version for rails but still getting the dependency error
I was looking in rubygems.org and the versions matches in almost all log report cases. Bundle interprets that '>=' matches with the gem which depends?
Gemfile.
source 'https://rubygems.org'
ruby "2.2.4"
gem 'rails', '4.2.5.1'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.1.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'puma'
gem 'puma_worker_killer'
gem 'rack-handlers'
group :development, :test do
gem 'byebug'
end
group :development do
gem 'web-console', '~> 2.0'
gem 'spring'
gem 'xray-rails'
end
group :production do
gem 'unf'
gem 'rails_12factor'
gem 'sprockets', '3.7.2'
end
gem 'spree', git: 'https://github.com/spree/spree.git', branch: '3-0-stable'
gem 'spree_gateway', github: 'spree/spree_gateway', branch: '3-0-stable'
gem 'pg'
gem 'rest-client'
gem 'spree_auth_devise', github: 'spree/spree_auth_devise', branch: '3-0-stable'
git "https://#{ENV['BITBUCKET_USERNAME']}:#{ENV['BITBUCKET_PASSWORD']}#bitbucket.org/Gothmogh/spree_gems.git" do
gem 'spree_i18n'
gem 'spree_social'
gem 'spree_reviews'
gem 'spree_product_zoom'
gem 'spree_social_products'
gem 'spree_recently_viewed'
gem 'spree_zaez_banner'
gem 'spree_product_assembly'
gem 'spree_asset_variant_options'
end
git "https://#{ENV['BITBUCKET_USERNAME']}:#{ENV['BITBUCKET_PASSWORD']}#bitbucket.org/Gothmogh/spree_custom_extensions.git" do
gem 'spree_product_pre_posting'
end
gem 'less-rails'
gem 'therubyracer'
gem 'twitter-bootstrap-rails'
gem 'browser'
gem 'aws-sdk', '< 2.0'
gem 'spree_html_invoice', git: 'https://github.com/vinsol-spree-contrib/spree-html-invoice', branch: '3-0-stable'
I am attempting to update my app to Rails 5.0.1. After attempting to run bundle update, the error below appears, but there is no rack gem.
How can I get this to resolve?
Error:
Bundler could not find compatible versions for gem "rack":
In Gemfile:
rails (= 5.0.1) x86-mingw32 was resolved to 5.0.1, which depends on
actionpack (= 5.0.1) x86-mingw32 was resolved to 5.0.1, which depends on
rack (~> 2.0)
rails (= 5.0.1) x86-mingw32 was resolved to 5.0.1, which depends on
actionpack (= 5.0.1) x86-mingw32 was resolved to 5.0.1, which depends on
rack (~> 2.0) x86-mingw32
sprockets (= 2.11.3) was resolved to 2.11.3, which depends on
rack (~> 1.0)
sprockets (= 2.11.3) was resolved to 2.11.3, which depends on
rack (~> 1.0) x86-mingw32
gemfile:
source 'http://rubygems.org'
ruby '2.4.0' # '1.9.3'
#ruby-gemset=railstutorial_rails_4_0
gem 'rails', '5.0.1'#'4.2.6'
#gem 'pg', '0.15.1'
gem 'mysql2', '0.4.5'#'0.4.4'
gem 'bootstrap-sass', '2.3.2.0'#'3.3.6'
gem 'bcrypt', '3.1.11'
gem 'faker', '1.1.2'
gem 'will_paginate', '3.1.0'
gem 'bootstrap-will_paginate', '0.0.10'
gem 'geocoder', '1.3.7'
gem 'nested_form', '0.3.2'
gem 'utf8-cleaner', '0.2.4'
gem 'sprockets', '2.11.3' #2.11.3
gem 'json', '1.8.6'#'1.8.3'
gem 'ffi'
gem 'iconv', '1.0.4'
gem 'chosen-rails', '1.5.2'
gem 'compass-rails', github: 'Compass/compass-rails'
# For image uploads
gem 'carrierwave', '0.11.2'
# For uploading CSV
gem 'roo', '2.4.0'
# DataTables
gem 'jquery-datatables-rails', '3.4.0' # git: 'git://github.com/rweng/jquery-datatables-rails.git'
gem 'jquery-ui-rails', '5.0.5'
# Editing in line:
gem 'best_in_place', '3.1.0'
# Passing data from controller to coffeescript
gem 'gon', '6.0.1'
#gem 'jquery-turbolinks' '2.1.0'
# For searching and webservice queries-NO LONGER USED
#gem 'sunspot_rails', '2.1.0'
#gem 'sunspot_solr', '2.1.0'
gem 'progress_bar', '1.0.5'
gem 'responders', '2.2.0'
# Calendar Date and Validation
gem 'bootstrap-datepicker-rails'
# For Google Maps overlays
gem 'gmaps4rails', '~> 2.1.2'
gem 'underscore-rails', '~> 1.8.3'
group :development, :test do
gem 'rspec-rails', '3.4.2'
gem 'guard-rspec', '4.7.2'
gem 'spork-rails', '4.0.0'
gem 'childprocess', '0.5.9'
gem 'guard-spork', '2.1.0'
end
group :test do
gem 'selenium-webdriver', '2.53.3'
gem 'capybara', '2.7.1'
gem 'factory_girl_rails', '4.7.0'
end
gem 'sass-rails', '4.0.1'
gem 'uglifier', '3.0.0'
gem 'coffee-rails', '4.1.1'
gem 'jquery-rails', '4.1.1'
gem 'turbolinks', '2.5.3'
gem 'jbuilder', '2.5.0'
group :doc do
gem 'sdoc', '0.4.1', require: false
end
gem 'rails_12factor', '0.0.3'
It's all in the error message:
You ave specified gems in your Gemfile which have conflicting dependencies on the rack gem. Rails 5 (via actionpack) required rack 2 which your pinned version of sprockets requires rack 1.
Thus, you have two options:
You could downgrade your rails requirement to Rails 4 which then depends on rack 1. For that, replace the line in your Gemfile where you specify rails with this:
gem 'rails', '< 5'
Alternatively (and this is probably your desired option), you could upgrade the version of sprockets you are using. For that, you can simply remove the explicit pinned version to sprockets in your Gemfile. Since Rails already depends on a suitable version of sprockets, you don't need to specify it as a version youself. Generally, in order to use sprockets with Rails 5, you need at least sprockets 3.3.5.
I am following Michael Hartl's ruby on rails tutorial and while deploying my first app, I am getting the following error:
Bundler could not find compatible versions for gem "railties":
In Gemfile:
rails (= 4.0.0) x86-mingw32 depends on
railties (= 4.0.0) x86-mingw32
sass-rails (= 4.0.0) x86-mingw32 depends on
railties (4.0.1.rc3)
My Gemfile looks like the following:
source 'https://rubygems.org'
ruby '1.9.3'
gem 'rails', '4.0.0'
group :development do
gem 'sqlite3', '1.3.8'
end
gem 'sass-rails', '4.0.0'
gem 'uglifier', '2.1.1'
gem 'coffee-rails', '4.0.1'
gem 'jquery-rails', '3.0.4'
gem 'turbolinks'
gem 'jbuilder', '~> 1.2'
group :doc do
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', require: false
end
Any idea what I'm missing here?
I would reinstall the railties gem again then
gem install railties
Try running bundle update
If that doesn't work, delete Gemfile.lock and run
bundle install.
And restart server
I tried putting sass-rails before rails suggested in the post Bundler gem compatibility issues when deploying to heroku. but it didn't work.
Heroku Error Message
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.rc1)
Failed to install gems via Bundler.
Gemfile
source 'https://rubygems.org'
ruby '2.0.0'
gem 'sass-rails', '4.0.0'
gem 'rails', '4.0.0'
gem 'pg', '0.15.1'
gem 'bcrypt-ruby', '3.0.1'
group :development, :test do
gem 'rspec-rails', '2.13.1'
end
group :test do
gem 'selenium-webdriver', '2.35.1'
gem 'capybara', '2.1.0'
gem 'factory_girl_rails', '4.2.1'
end
gem 'uglifier', '2.1.1'
gem 'coffee-rails', '4.0.0'
gem 'jquery-rails', '3.0.4'
gem 'turbolinks', '1.1.1'
gem 'jbuilder', '1.0.2'
group :doc do
gem 'sdoc', '0.3.20', require: false
end
group :production do
gem 'rails_12factor', '0.0.2'
end
Change the sass entry to :
gem 'sass-rails', '~> 4.0.0'
Then run bundle update, commit and redeploy
I receive the following error message is when deploying to heroku:
Bundler could not find compatible version 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.1.rc1)
Failed to install gems via Bundler
Gemfile
source 'https://rubygems.org'
ruby '1.9.3'
gem 'rails', '4.0.0'
gem 'bcrypt-ruby', '3.0.1'
gem 'faker', '1.1.2'
gem 'will_paginate', '3.0.4'
gem 'will_paginate-bootstrap'
group :development, :test do
gem 'sqlite3', '1.3.7'
gem 'rspec-rails', '2.13.1'
end
group :test do
gem 'selenium-webdriver', '2.0.0'
gem 'capybara', '2.1.0'
gem 'factory_girl_rails', '4.2.1'
end
gem 'sass-rails', '4.0.0'
gem 'uglifier', '2.1.1'
gem 'coffee-rails', '4.0.0'
gem 'jquery-rails', '3.0.4'
gem 'turbolinks', '1.1.1'
gem 'jbuilder', '1.0.2'
group :doc do
gem 'sdoc', '0.3.20', require: false
end
group :production do
gem 'pg', '0.15.1'
gem 'rails_12factor', '0.0.2'
end
I've tried many different things like running bundle update, changing gem versions etc. but so far nothing seems to work. I have been deploying to heroku for a while now without changing any of the gems, so how can this suddenly happen?
Is this caused by the release of rails 4.0.1.rc1?