Why is no Ruby script found in input (LoadError)?

R.Atim picture R.Atim · Feb 15, 2013 · Viewed 9k times · Source

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)

The 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 does not function. Is it a problem referencing the gem?

Answer

faddison picture faddison · Aug 17, 2013

I've got this error after cloning a rails repo:

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

The problem was in bin/rails and bin/rake. Top line was #!/usr/bin/env, but should have been #!/usr/bin/env ruby.