vladh / lein-sassy

Use Sass with Clojure.
Eclipse Public License 1.0
33 stars 7 forks source link

Specifying a gem version breaks lein-sassy #11

Open dankreek opened 8 years ago

dankreek commented 8 years ago

In my project.clj I have specified the following config:

  :sass {:src "dev-resources/styles/auth"
         :dst "resources/auth-ui/dist/styles"
         :gem-version "3.2.19"}

And now lein-sassy can't find the gem at all. I end up with this stack trace:

Caused by: org.jruby.exceptions.RaiseException: (LoadError) no such file to load -- sass/util
 at org.jruby.RubyKernel.require (org/jruby/RubyKernel.java:1065)
    RUBY.require (/Users/justin/.m2/repository/org/jruby/jruby-complete/1.7.16/jruby-complete-1.7.16.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:55)
    RUBY.(root) (<script>:1)
    leiningen.lein_sassy.ruby$run_ruby.invoke (ruby.clj:59)
    leiningen.lein_sassy.ruby$require_gem.invoke (ruby.clj:68)
    leiningen.lein_sassy.renderer$init_gems.invoke (renderer.clj:18)
    leiningen.lein_sassy.renderer$init_renderer.invoke (renderer.clj:27)
    leiningen.sass$sass.doInvoke (sass.clj:49)
    clojure.core$apply.invoke (core.clj:632)
    leiningen.core.main$partial_task$fn__6030.doInvoke (main.clj:261)
    clojure.core$apply.invoke (core.clj:632)
    leiningen.core.main$apply_task.invoke (main.clj:311)
    leiningen.core.main$resolve_and_apply.invoke (main.clj:317)
    leiningen.core.main$_main$fn__6096.invoke (main.clj:390)
    leiningen.core.main$_main.doInvoke (main.clj:383)
    clojure.core$apply.invoke (core.clj:630)
    clojure.main$main_opt.invoke (main.clj:316)
    clojure.main$main.doInvoke (main.clj:421)

The gem is definitely in my .m2 repository and I added it to my project's dependencies like so:

:dependencies [[org.rubygems/sass "3.2.19"]]

Am I doing something wrong?

dankreek commented 8 years ago

After some further investigation is looks like the problem lies in using an actual gem file (downloaded from torquebox). Still poking at it to try and find a solution.

vladh commented 8 years ago

Hi, sorry you're having this issue. Does everything work if you do not specify :gem-version in the options, and remove org.rubygems/sass from your :dependencies?

dankreek commented 8 years ago

Yeah everything works great as long as I specify a :gem-version which is available on gemjars. But if I specify "3.4.21" as the :gem-version, the dependency is successfully downloaded from torquebox and put into my local maven repo, but JRuby can't seem to find the gem.

vladh commented 8 years ago

Hm, I'll try to take a look at this. Working with gems is always so fiddly. Can you use the gemjars version in the meantime?

dankreek commented 8 years ago

Unfortunately, the gemjars repo hasn't been maintained in a long time so it doesn't have any artifacts for sass version 3.3+. Which I need to take advantage of Sass's hashmaps.

vladh commented 8 years ago

I would love to fix this (and #12), but I'm afraid I really don't know how to go about it. I can't really figure out why getting the gems from Torquebox doesn't work, and I don't know of another place to get them from. If anyone has any suggestions I'd be happy to work on this.

bostonaholic commented 8 years ago

@vladh I'm looking at this currently. The gems seem to exist in the Torquebox rubygems proxy (http://rubygems-proxy.torquebox.org/releases/rubygems/sass/) so I might look deeper into how leiningen is getting gems (instead of jars).