no such file to load -- autoprefixer-rails #129

Closed
matthewcarleton opened this Issue Nov 11, 2013 · 14 comments

Comments

Projects
None yet
5 participants

I've followed the instructions and installed everything. This is what I get when I tell compass to watch the directory.

no such file to load -- autoprefixer-rails
org/jruby/RubyKernel.java:1062:in require' file:/Applications/compass.app/Contents/Resources/Java/compass-app.jar!/require_patch.rb:6:inrequire'
/Applications/compass.app/Contents/Resources/lib/ruby/compass_0.12/compass-0.12.2/lib/compass/configuration/data.rb:161:in require' /Users/matthewcarleton/Desktop/prefix_test/config.rb:1:inparse_string'
org/jruby/RubyKernel.java:1112:in eval' /Applications/compass.app/Contents/Resources/lib/ruby/compass_0.12/compass-0.12.2/lib/compass/configuration/serialization.rb:24:inparse_string'
/Applications/compass.app/Contents/Resources/lib/ruby/compass_0.12/compass-0.12.2/lib/compass/configuration/serialization.rb:15:in _parse' org/jruby/RubyIO.java:1139:inopen'
org/jruby/RubyKernel.java:296:in open' file:/Applications/compass.app/Contents/Resources/Java/lib/java/jruby-complete.jar!/META-INF/jruby.home/lib/ruby/1.8/open-uri.rb:32:inopen'
/Applications/compass.app/Contents/Resources/lib/ruby/compass_0.12/compass-0.12.2/lib/compass/configuration/serialization.rb:14:in _parse' /Applications/compass.app/Contents/Resources/lib/ruby/compass_0.12/compass-0.12.2/lib/compass/configuration/file_data.rb:7:innew_from_file'
/Applications/compass.app/Contents/Resources/lib/ruby/compass_0.12/compass-0.12.2/lib/compass/configuration/inheritance.rb:204:in with_defaults' /Applications/compass.app/Contents/Resources/lib/ruby/compass_0.12/compass-0.12.2/lib/compass/configuration/file_data.rb:6:innew_from_file'
/Applications/compass.app/Contents/Resources/lib/ruby/compass_0.12/compass-0.12.2/lib/compass/configuration/helpers.rb:42:in configuration_for' /Applications/compass.app/Contents/Resources/lib/ruby/compass_0.12/compass-0.12.2/lib/compass/configuration/helpers.rb:97:inadd_project_configuration'
/Applications/compass.app/Contents/Resources/lib/ruby/compass_0.12/compass-0.12.2/lib/compass/commands/project_base.rb:31:in add_project_configuration' /Applications/compass.app/Contents/Resources/lib/ruby/compass_0.12/compass-0.12.2/lib/compass/commands/project_base.rb:25:inconfigure!'
/Applications/compass.app/Contents/Resources/lib/ruby/compass_0.12/compass-0.12.2/lib/compass/commands/project_base.rb:15:in initialize' /Applications/compass.app/Contents/Resources/lib/ruby/compass_0.12/compass-0.12.2/lib/compass/commands/update_project.rb:37:ininitialize'
file:/Applications/compass.app/Contents/Resources/Java/compass-app.jar!/ui/tray.rb:430:in watch' file:/Applications/compass.app/Contents/Resources/Java/compass-app.jar!/app.rb:207:intry'
file:/Applications/compass.app/Contents/Resources/Java/compass-app.jar!/ui/tray.rb:425:in watch' file:/Applications/compass.app/Contents/Resources/Java/compass-app.jar!/ui/tray.rb:142:incompass_switch_handler'
file:/Applications/compass.app/Contents/Resources/Java/compass-app.jar!/ui/tray.rb:71:in run' file:/Applications/compass.app/Contents/Resources/Java/compass-app.jar!/main.rb:116:inrun_tray'
file:/Applications/compass.app/Contents/Resources/Java/compass-app.jar!/main.rb:132:in (root)' org/jruby/RubyKernel.java:1062:inrequire'
file:/Applications/compass.app/Contents/Resources/Java/compass-app.jar!/main.rb:1:in `(root)'

Owner

ai commented Dec 6, 2013

Seems like some RubyGems issue in your JRuby.

Sorry, I can’t right now help your with this. Please, ask for some Ruby developer to check your environment.

ai closed this Dec 6, 2013

alycda commented Mar 24, 2014

$ compass compile --trace _/scss/evolve.scss 
LoadError on line 55 of /Library/Ruby/Site/1.8/rubygems/core_ext/kernel_require.rb: no such file to load -- autoprefixer-rails
  /Library/Ruby/Site/1.8/rubygems/core_ext/kernel_require.rb:55:in `require'
  /Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/configuration/data.rb:161:in `require'
  /Users/teamone/Web/Apps/2k-evolve/_/config.rb:4:in `get_binding'
  /Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/configuration/serialization.rb:20:in `get_binding'
  /Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/configuration/serialization.rb:23:in `parse_string'
  /Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/configuration/serialization.rb:15:in `_parse'
  /Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/configuration/serialization.rb:14:in `open'
  /Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/configuration/serialization.rb:14:in `_parse'
  /Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/configuration/file_data.rb:7:in `new_from_file'
  /Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/configuration/inheritance.rb:204:in `with_defaults'
  /Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/configuration/file_data.rb:6:in `new_from_file'
  /Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/configuration/helpers.rb:42:in `configuration_for'
  /Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/configuration/helpers.rb:97:in `add_project_configuration'
  /Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/commands/project_base.rb:31:in `add_project_configuration'
  /Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/commands/project_base.rb:25:in `configure!'
  /Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/commands/project_base.rb:15:in `initialize'
  /Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/commands/update_project.rb:37:in `initialize'
  /Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/exec/sub_command_ui.rb:42:in `new'
  /Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/exec/sub_command_ui.rb:42:in `perform!'
  /Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/exec/sub_command_ui.rb:15:in `run!'
  /Library/Ruby/Gems/1.8/gems/compass-0.12.2/bin/compass:30
  /Library/Ruby/Gems/1.8/gems/compass-0.12.2/bin/compass:44:in `call'
  /Library/Ruby/Gems/1.8/gems/compass-0.12.2/bin/compass:44
  /usr/bin/compass:23:in `load'
  /usr/bin/compass:23
Owner

ai commented Mar 24, 2014

@alycda please, show me your Compass config. And gem list output.

alycda commented Mar 25, 2014

config.rb

# Require any additional compass plugins here. (if installed as RUBY GEM and not imported into scss/vendor)
# require 'zen-grids'
require "autoprefixer-rails"

# http://compass-style.org/help/tutorials/configuration-reference/
css_dir = "css"
sass_dir = "scss"
images_dir = "css/img"
javascripts_dir = "js"
fonts_dir = "css/fonts"

# additional_import_paths = ["scss/vendor"]
add_import_path "scss/vendor" # this is a FUNCTION and does not require an EQUALS sign (=)

output_style = :compact #:expanded :nested :compact :compressed
environment = :development #:development :production

# To enable relative paths to assets via compass helper functions. Uncomment:
# relative_assets = true

# To disable debugging comments that display the original location of your selectors. Uncomment:
# line_comments = false
color_output = false

# If you prefer the indented syntax, you might want to regenerate this
# project again passing --syntax sass, or you can uncomment this:
# preferred_syntax = :sass
# and then run:
# sass-convert -R --from scss --to sass scss scss && rm -rf sass && mv scss sass
preferred_syntax = :scss

#require 'fileutils'
#on_stylesheet_saved do |file|
#  if File.exists?(file) && File.basename(file) == "style.css"
    #puts "Moving: file"
    #FileUtils.mv(file, File.dirname(file) + "css/" + File.basename(file))
#  end
#end

$ gem list

*** LOCAL GEMS ***

autoprefixer-rails (1.1.20140319)
CFPropertyList (2.2.4, 2.2.0)
execjs (2.0.2)
libxml-ruby (2.7.0, 2.6.0)
mini_portile (0.5.2)
nokogiri (1.6.0, 1.5.6)
rack (1.5.2)
rack-rewrite (1.5.0)
sqlite3 (1.3.8, 1.3.7)
thor (0.18.1)
Owner

ai commented Mar 25, 2014

Try to add write:

require "rubygems"
require "autoprefixer-rails"

alycda commented Mar 26, 2014

same error:

LoadError on line 55 of /Library/Ruby/Site/1.8/rubygems/core_ext/kernel_require.rb: no such file to     load -- autoprefixer-rails
Run with --trace to see the full backtrace
[Finished in 0.3s with exit code 1]
Owner

ai commented Mar 26, 2014

OK, next try:

require "rubygems"
gem "autoprefixer-rails"
require "autoprefixer-rails"

alycda commented Mar 26, 2014

$ compass compile --trace scss/evolve.scss 
Gem::LoadError on line 298 of /Library/Ruby/Site/1.8/rubygems/dependency.rb: Could not find 'autoprefixer-rails' (>= 0) among 5 total gem(s)
  /Library/Ruby/Site/1.8/rubygems/dependency.rb:309:in `to_spec'
  /Library/Ruby/Site/1.8/rubygems/core_ext/kernel_gem.rb:47:in `gem'
  /Users/teamone/Web/Apps/2k-evolve/_/config.rb:5:in `get_binding'
  /Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/configuration/serialization.rb:20:in `get_binding'
  /Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/configuration/serialization.rb:23:in `parse_string'
  /Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/configuration/serialization.rb:15:in `_parse'
  /Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/configuration/serialization.rb:14:in `open'
  /Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/configuration/serialization.rb:14:in `_parse'
  /Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/configuration/file_data.rb:7:in `new_from_file'
  /Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/configuration/inheritance.rb:204:in `with_defaults'
  /Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/configuration/file_data.rb:6:in `new_from_file'
  /Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/configuration/helpers.rb:42:in `configuration_for'
  /Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/configuration/helpers.rb:97:in `add_project_configuration'
  /Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/commands/project_base.rb:31:in `add_project_configuration'
  /Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/commands/project_base.rb:25:in `configure!'
  /Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/commands/project_base.rb:15:in `initialize'
  /Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/commands/update_project.rb:37:in `initialize'
  /Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/exec/sub_command_ui.rb:42:in `new'
  /Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/exec/sub_command_ui.rb:42:in `perform!'
  /Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/exec/sub_command_ui.rb:15:in `run!'
  /Library/Ruby/Gems/1.8/gems/compass-0.12.2/bin/compass:30
  /Library/Ruby/Gems/1.8/gems/compass-0.12.2/bin/compass:44:in `call'
  /Library/Ruby/Gems/1.8/gems/compass-0.12.2/bin/compass:44
  /usr/bin/compass:23:in `load'
  /usr/bin/compass:23

I think we are getting somewhere... the error above says autoprefixer can't be found in 5 total gems but my gem list shows 10. Doesn't that seem odd?

Owner

ai commented Mar 26, 2014

Yeap, Ruby doesn’t see all gems. Do you have Gemfile in your project?

alycda commented Mar 26, 2014

I do not, should I?

Owner

ai commented Mar 26, 2014

Nope. Now I have no idea, how to fix your Ruby.

Do you have any Ruby developer friend to look on your computer?

Or maybe it is good time to look into Grunt :-). It has Compass, Autoprefixer and many other really cool gems.

alycda commented Mar 26, 2014

Yeah, that's my next step (grunt). Thank you for your help!

You must add the gem in your Gemfile (see example below). And then run bundle exec compass compile again to compile the new gem.

source "https://rubygems.org"

gem "sass", "~>3.3"
gem "compass", "~>1.0"
gem "breakpoint", "~>2.5.0"
gem "singularitygs", "~>1.4"
gem "autoprefixer-rails", "~>5.1.0"

@theodorosploumis, thank you very much! Your answer was of great help for me :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment