【问题标题】:rake assets:precompile error message: No such file or directory -- rubyrake assets:precompile 错误消息:没有这样的文件或目录 -- ruby
【发布时间】:2013-11-28 01:50:59
【问题描述】:

我正在关注优秀的 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

感谢您的帮助!

【问题讨论】:

  • 你试过“bundle exec rake assets:precompile”了吗?

标签: ruby-on-rails ruby


【解决方案1】:

我通过从 p448 恢复到 p392 然后运行来解决此问题:

rvm ruby-1.9.3-p392@global do gem install executable-hooks

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

【讨论】:

    【解决方案2】:

    我试图在 ubuntu 中运行 rake 命令,但遇到了 ruby​​_executable_hooks 错误。我解决了:

    rvm all do gem install executable-hooks
    

    【讨论】:

      【解决方案3】:

      这似乎是 1.9.3-p448 的问题。今天我将服务器上的 ruby​​ 从 p392 更新到 p448 并开始出现此错误。我恢复到 p392 并且资产的预编译再次工作。

      也许尝试安装 p448 之前的版本,然后重试。

      在处理了这个之后,我发现清空并重新安装我的 gem 导致预编译重新开始工作:

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

      【讨论】:

      • 谢谢,我安装了 p392 并按照您的建议进行了尝试,但是我现在收到此错误:/Users/Jamie/.rvm/rubies/ruby-1.9.3-p392/bin/ruby /Users/Jamie/.rvm/gems/ruby-1.9.3-p392@movies/bin/ruby_executable_hooks assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets /Users/Jamie/.rvm/gems/ruby-1.9.3-p392@movies/bin/ruby_executable_hooks:14:in 'read': No such file or directory - assets:precompile:all (Errno::ENOENT) from /Users/Jamie/.rvm/gems/ruby-1.9.3-p392@movies/bin/ruby_executable_hooks:14:in '&lt;main&gt;' rake aborted!
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-03-09
      • 1970-01-01
      • 2021-11-05
      • 1970-01-01
      • 2014-06-25
      • 2013-03-04
      • 2021-10-31
      相关资源
      最近更新 更多