Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rails 4 Susy 2 Incompatible #339

Closed
axebox opened this issue May 1, 2014 · 26 comments
Closed

Rails 4 Susy 2 Incompatible #339

axebox opened this issue May 1, 2014 · 26 comments

Comments

@axebox
Copy link

axebox commented May 1, 2014

I've got a brand new Rails 4 project and when I add gem 'susy', '>= 2.1.2' I get this:

Bundler could not find compatible versions for gem "sass":
In snapshot (Gemfile.lock):
sass (3.2.19)

In Gemfile:
susy (>= 2.1.2) ruby depends on
sass (~> 3.3.0) ruby

I don't think susy 2.1.2 is compatible with Rails 4?

@axebox axebox changed the title Rails 4 Susy 3 Incompatible Rails 4 Susy 2 Incompatible May 1, 2014
@axebox
Copy link
Author

axebox commented May 1, 2014

I think there should be documentation to get sass 3.3.0 into a Rails 4 project. Rails 4 ships with sass-rails (which wraps sass 3.2.0) and there is no 3.3.0 sass rails wrapper.

@kulte
Copy link

kulte commented May 2, 2014

@ericam If you can point me to a changelog or something to that nature that shows what part of 3.3 you need that isn't included in 3.2, I'd be more than happy to do a PR for you 😄

@mirisuzanne
Copy link
Member

I don't know much about rails, but it seems like someone found a workaround? See #316.

@kulte Thanks for the generous offer, but it's not realistic. Sass 3.3 adds the "map" data-type to sass-script (this is different from "source maps"). Susy 2 relies on maps internally for nearly all the data management, and also in the public syntax. Making Susy 2 work with Sass 3.2 would require writing a completely new version of Susy, with new syntax and new logic (e.g. "Not Susy"). :)

You're welcome to do it. It's been done before. But we won't be merging that in any time soon. You should really be submitting a PR on the Sass-Rails project. Why haven't they updated?

@donpinkus
Copy link

Has anyone found a way to get Susy (new or old) working with Rails 4?

Really want to use it for an application, but tried #316 and still no luck. Even tried just copying and pasting the sass files into my application, but then I started getting missing compass scss files.

@mirisuzanne
Copy link
Member

There should be no problem running Susy 1 versions on Rails 4. The issue here is that Susy 2 requires Sass 3.3, which is not supported yet by Sass-Rails.

@eddie-ruva
Copy link

Sass-rails gem version 4.0.2 & 4.0.3 add a dependency on sass "~>3.2.0" which does not play well with Susy dependency on sass 3.3

The fix for this would be to use Sass-rails gem version 4.0.1 which depends on sass ">= 3.1.10"

To make this change in your rails project you could go to your Gemfile and specify your sass-rails gem version like this: gem 'sass-rails', '4.0.1'

Hope this helps!

@iamricard
Copy link

Hi, I don't know if it is relevant but I've been struggling with getting Susy to work with Rails 4.0.1 and I finally managed with the following Gemfile:

gem 'rails', '4.0.1'
gem 'sass-rails', '~> 4.0.0'
gem 'compass-rails', '1.1.7'
gem 'breakpoint', '2.4.2'
gem 'susy', '2.1.0'

Granted it uses 2.1.0, but it's better than nothing!

@metaskills
Copy link

The sass-rails gem allows Sass v3.3. Can this issue be closed?
rails/sass-rails#214

@iamricard
Copy link

@metaskills where'd you get the idea that sass-rails allows 3.3?

https://github.com/rails/sass-rails/blob/master/sass-rails.gemspec#L18

edit: nevermind, I think it does work sorry

@metaskills
Copy link

The ~> 3.2 means >= 3.2 and < 4.0

@iamricard
Copy link

Yep, just edited

@metaskills
Copy link

👍 :)

@mirisuzanne
Copy link
Member

yay!

@donpinkus
Copy link

Hey so it sounds like we're good to go with Suzy 2 on Rails 4 now? (super excited if so!)

@mirisuzanne
Copy link
Member

I don't have rails to test on, but that's my understanding. Let me know if that doesn't work for you.

@donpinkus
Copy link

Awesome, looks like this works with Rails 4! For anyone else who comes across this and looking for the set up, it's below.

Still some incompatibilities with the "listen" gem if you're using Spork or Guard. Had to remove those to use susy but so be it

Gemfile:

gem 'sass-rails', '~> 4.0.0'
gem 'compass-rails', '1.1.7'
gem 'breakpoint', '2.4.2'
gem 'susy', '2.1.0'

application.rb:

require File.expand_path('../boot', __FILE__)
(...)
require 'compass'
require 'susy'

# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(:default, Rails.env)
(...)

application.css.scss (using sprockets)

(...)
 *= require_tree ./global
 */

@import "susy";
(...)

@metaskills
Copy link

Bundler will require all your gems for you, so those should not be needed.

require 'compass'
require 'susy'

@ramschmaerchen
Copy link

Compatibility with sass-rails and compass is still broken. Although it may work on some setups it's nightmare with others. Hopefully sass-rails will be patched to a useable state "soon"

@trev
Copy link
Contributor

trev commented Sep 30, 2014

Hey guys, here's an update for those of you trying to use Compass, Susy 2 and Rails 4.1.
This would probably work with other versions of Rails but I haven't tested. Please note that I've only done preliminary testing and you'll be using a beta version of sass-rails so use at your own risk.

In your Gemfile:

gem 'sass-rails', '5.0.0.beta1' # This is the important bit since it supports Sass 3.3    
gem 'susy'
gem 'compass-rails', '~> 2.0.0'

In your application.rb:

...
require 'rails/all'
require 'susy'
...

In your stylesheet:

@import 'compass';
@import 'susy';

.container { @include container; }
...

@samusgray
Copy link
Collaborator

@trev Win! This absolutely works! Thank you so much for figuring that out. Do you want to send a PR to add this to the docs? If not, I will do it tonight.

@ramschmaerchen
Copy link

I am ready to donate beer.

@samusgray
Copy link
Collaborator

@ramschmaerchen Yes, @trev deserves a beer for this. So stocked that sass-rails finally caught up with Sass 3.3, too, as they were the reason this couldn't happen before.

@trev
Copy link
Contributor

trev commented Oct 2, 2014

No worries, I got this!
Thanks for the beer

@trev
Copy link
Contributor

trev commented Oct 2, 2014

There you go: #391

@samusgray
Copy link
Collaborator

Woop woop! Merged. Thanks again.

@HectorLS
Copy link

HectorLS commented Dec 8, 2015

@trev one question, is it necessary add require 'susy' to the application.rb file ? because with the rails/all suppose to add all the gems listed in the gemfile right ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests