Question

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?

Was it helpful?

Solution

If you put sass-rails before rails in your Gemfile, it resolves correctly.

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top