jhardy / Sassy-Buttons

MIT License
287 stars 59 forks source link

File to import not found #30

Closed ghost closed 11 years ago

ghost commented 11 years ago

Hi, First of all thanks for sharing Sassy-Buttons with us!

I am just posting this in case others have a similar problem. Here is the tale of how I finally got Sassy Buttons working on my Debian Squeeze system with http://rvm.io to run Ruby 1.9.3-p194 with Compass. and a bunch of other gems. I installed sassy-buttons like this:

gem install sassy-buttons
compass install sassy-buttons

I checked it had installed successfully. Looked like it had:

$ gem query

*** LOCAL GEMS ***

bundler (1.1.4)
chunky_png (1.2.5)
compass (0.12.2)
fssm (0.2.9)
rake (0.9.2.2)
rubygems-bundler (1.0.3)
rvm (1.11.3.5)
sass (3.2.3, 3.1.20)
sassy-buttons (0.1.4)

I included Sassy-Button in my project and rb files:

@import "sassy-buttons";
require 'sassy-buttons'

Running 'compass watch' failed when I made a file change. The error was:

File to import not found or unreadable: ...

I also tried the following, although I have to admit I was not quite sure what I was doing at this stage.

bundle install
bundle exec compass install sassy-buttons

both commands resulted in the same error:

Could not locate Gemfile

Thanks to dcheslow https://gist.github.com/jhardy/Sassy-Buttons/issues/16 I was able to fix it by copying ~/gems/ruby-1.9.3-p194/gems/sassy-buttons-0.1.4/stylesheets/sassy-buttons to my project sass directory. The path will be different for people not using rvm: /usr/lib/ruby/gems/1.8/gems/sassy-buttons-0.1.0/stylesheets/sassy-buttons

I'm not quite sure what's wrong with my installation as I am not a Ruby guru. At least this is working now.

I hope this helps someone. I anyone has anything to add regarding the dark arts of Ruby I'd appreciate it.

Thanks, Ruben

ghost commented 11 years ago

Aargh. It's still broken. Need to learn voodoo to fix it.

jhardy commented 11 years ago

Hey @tregeagle are you trying to get this to run in a rails environment or just stand alone with compass?

ghost commented 11 years ago

I believe I am just using compass.

jhardy commented 11 years ago

So if you run

compass create my_new_project
cd my_new_project

require sassy buttons in your configuration.rb file: require 'sassy-buttons' then

compass install sassy-buttons

Does that work for you?

ghost commented 11 years ago

Can't believe I never thought to test that. Yes, it does. Checking my project files now. Will let you know what I find.

ghost commented 11 years ago

The issue seems to be to do with the, @import "sassy-buttons".

There is the _sassybuttons.scss file in the project sass directory. It requires: @import "sassy-buttons"; and I think that is where it could be falling down?

jhardy commented 11 years ago

Does @import "sassybuttons" work?

ghost commented 11 years ago

No, I tried a few probably varieties. I think I must have stuffed up my RVM Gemset I'm going to remove and recreate it. But first I'm going out for swim.

You have been very helpful, thank you so much. I'll respond here when I get it working.

Ruben

jhardy commented 11 years ago

Let me know how it goes and maybe post some more info that you come across so I can help you get up and running.

ghost commented 11 years ago

Right, I finally fixed it. For real this time. I'm not sure how I got in such a tangle but essentially sassy-buttons was stuffed up on my original install. The error message was showing me a non-existent 'Load Path'. I gave up trying to figure out why and just reinstalled all my gems.

I am using RVM so this was just a case of:

# Back up my existing gemset (just in case).
rvm gemset export myproject.gems

# Remove the gems from my project
rvm gemset empty

# Reinstall Compass and Sassy-Buttons
rvm install compass
rvm install sassy-buttons

# Check you got what you need.
gem list

*** LOCAL GEMS ***

chunky_png (1.2.6)
compass (0.12.2)
fssm (0.2.9)
sass (3.2.3)
sassy-buttons (0.1.4)

# Back to work. Hurrah!
compass watch

I have checked my project includes and required files dozens of times so without further ado I jump in and apply this to my styles:

a.button { @include sassy-button("matte", 15px, 20px, rgba(11, 153, 194, 1)); }

We have buttons, now I can start to play.

Thanks for your help and patience jhardy. I hope this helps out other intrepid SASStronaughts.

Ruben