rake assets:预编译错误消息:没有这样的文件或目录 - ruby

时间:2013-09-23 20:01:02

标签: ruby-on-rails ruby

我正在关注优秀的Michael Hartl Rails一书(Rails 3.2),但在尝试运行命令时遇到错误:

rake assets:precompile

错误如下:

/Users/Jamie/.rvm/rubies/ruby-1.9.3-p448/bin/ruby ruby /Users/Jamie/.rvm/gems/ruby-1.9.3-p448@movies/bin/rake assets:precompile assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets
/Users/Jamie/.rvm/rubies/ruby-1.9.3-p448/bin/ruby: No such file or directory -- ruby /Users/Jamie/.rvm/gems/ruby-1.9.3-p448@movies/bin/rake assets:precompile (LoadError)
rake aborted!
Command failed with status (1): [/Users/Jamie/.rvm/rubies/ruby-1.9.3-p448/b...]
/Users/Jamie/.rvm/gems/ruby-1.9.3-p448@movies/gems/actionpack-    3.2.14/lib/sprockets/assets.rake:12:in `ruby_rake_task'
/Users/Jamie/.rvm/gems/ruby-1.9.3-p448@movies/gems/actionpack-3.2.14/lib/sprockets/assets.rake:21:in `invoke_or_reboot_rake_task'
/Users/Jamie/.rvm/gems/ruby-1.9.3-p448@movies/gems/actionpack-3.2.14/lib/sprockets/assets.rake:29:in `block (2 levels) in <top (required)>'
/Users/Jamie/.rvm/gems/ruby-1.9.3-p448@movies/bin/ruby_executable_hooks:14:in `eval'
/Users/Jamie/.rvm/gems/ruby-1.9.3-p448@movies/bin/ruby_executable_hooks:14:in `<main>'
Tasks: TOP => assets:precompile

感谢您的帮助!

3 个答案:

答案 0 :(得分:2)

我通过从p448恢复到p392然后运行:

来修复此问题
rvm ruby-1.9.3-p392@global do gem install executable-hooks

正如mpapis所建议的那样:Rake assets:precompile cannot find ruby

答案 1 :(得分:2)

我试图在ubuntu中运行rake命令并且收到ruby_executable_hooks错误。我解决了这个问题:

rvm all do gem install executable-hooks

答案 2 :(得分:0)

这似乎是1.9.3-p448的一个问题。今天我在我的服务器上将ruby从p392更新到p448并开始出现此错误。我又回到了p392,资产的预编译工作再次开始。

也许尝试在p448之前安装一个版本,然后再试一次。

在使用了这个之后,我发现清空并重新安装我的宝石会导致预编译再次开始工作:

$ rvm gemset empty
$ bundle install
$ rake assets:precompile RAILS_ENV=production