Why Ruby script not found in input (LoadError)?

Ruby is installed by rbenv.

$ ruby -v ruby 1.9.3p327 (2012-11-10 revision 37606) [i686-linux] $ which ruby /home/user/.rbenv/shims/ruby $ which sass /home/user/.rbenv/shims/sass $ gem list *** LOCAL GEMS *** bigdecimal (1.1.0) bundler (1.2.4) io-console (0.3) json (1.5.4) minitest (2.5.1) rake (0.9.2.2) rdoc (3.9.4) sass (3.2.5) 

This is my config.yml:

 # Assetic Configuration assetic: // ... ruby: /home/user/.rbenv/shims/ruby filters: cssrewrite: ~ sass: bin: /home/user/.rbenv/shims/sass // ... 

This is the error I get:

 [message] An error occurred while running: '/home/user/.rbenv/shims/ruby' '/home/user/.rbenv/shims/sass' '--load-path' '/path/to/symfony2/src/My/AnyBundle/Resources/public/css' '--cache-location' '/tmp' '/tmp/assetic_sassYbl6MI' Error Output: ruby: no Ruby script found in input (LoadError) 

Error in my other setup:

config.yml:

 # Assetic Configuration assetic: // ... ruby: /home/user/.rbenv/shims/ruby filters: cssrewrite: ~ sass: ~ // ... 

This is the error I get:

 Error Output: ruby: No such file or directory -- /usr/bin/sass (LoadError) 

Sass is not working. Is this a gem problem?

+8
ruby sass rbenv
source share
2 answers

I have this error after cloning a relay repository:

 $ rails server c:/RailsInstaller/Ruby1.9.3/bin/ruby.exe: no Ruby script found in input (LoadError) 

The problem was bin/rails and bin/rake . The top line was #!/usr/bin/env , but should be #!/usr/bin/env ruby .

+6
source share

Sf 2.1.7, rvm installed, compass installed, sass like a gem, especially based Unable to load Sass / Compass after installing RVM, use with Assetic in Symfony2

 parameters: # Assetic assetic.filter.compass.images_dir: %kernel.root_dir%/../web/images assetic.filter.compass.http_path: /images assetic.ruby.bin: 'pathToRubyBin' 

path to ruby ​​bin, which you can check:

 which ruby 

as mentioned above. For sass and scss use a compass filter:

 assetic: debug: "%kernel.debug%" use_controller: false bundles: [ FOSUserBundle, XcomplSomeBundle ] #java: /usr/bin/java filters: lessphp: file: %kernel.root_dir%/../vendor/leafo/lessphp/lessc.inc.php apply_to: "\.less$" sass: ~ compass: bin: 'pathtocompass' apply_to: "~\.(sass|scss)$~" cssrewrite: ~ 

And here is the warning! There is no need for 100,500 wrappers to create if you are using rvm or system ruby. Just:

 $ which compass 

And this is your pathtocompass.

And now:

 {% block stylesheets %} {% stylesheets 'css/general.scss(or .sass)' filter='compass, cssrewrite' output='css/general.css' %} <link rel="stylesheet" type="text/css" media="screen" href={{ asset_url }} /> {% endstylesheets %} {% endblock %} 

Finally, my gemlist:

 ~$ gem list *** LOCAL GEMS *** bigdecimal (1.1.0) bundler (1.2.4) chunky_png (1.2.7) compass (0.12.2) fssm (0.2.10) io-console (0.3) json (1.5.5) minitest (2.5.1) rake (10.0.3, 0.9.2.2) rdoc (3.9.5) rubygems-bundler (1.1.0) rvm (1.11.3.6) sass (3.2.6) 
+1
source share

All Articles