为什么在输入(LoadError)中找不到Ruby脚本?

前端之家收集整理的这篇文章主要介绍了为什么在输入(LoadError)中找不到Ruby脚本?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
Ruby由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)

这是我的config.yml:

# Assetic Configuration
assetic:
    // ...

    ruby: /home/user/.rbenv/shims/ruby

    filters:
        cssrewrite: ~
        sass:
            bin: /home/user/.rbenv/shims/sass

        // ...

这是我得到的错误

[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)

我的其他设置中的错误

config.yml:

# Assetic Configuration
assetic:
    // ...

    ruby: /home/user/.rbenv/shims/ruby

    filters:
        cssrewrite: ~
        sass: ~

        // ...

这是我得到的错误

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

萨斯不起作用.这是引用宝石的问题吗?

解决方法

克隆rails repo后我遇到了这个错误
$rails server
c:/RailsInstaller/Ruby1.9.3/bin/ruby.exe: no Ruby script found in input (LoadError)

问题出在bin / rails和bin / rake中.顶线是#!/usr/bin/env,但应该是#!/usr/bin/env ruby​​.

原文链接:https://www.f2er.com/ruby/269783.html

猜你在找的Ruby相关文章