Jamie Carruthers
Jamie Carruthers

Reputation: 116

rake assets:precompile error message: No such file or directory -- ruby

I'm following along to the excellent Michael Hartl Rails book (Rails 3.2) but am getting an error when attempting to run the command:

rake assets:precompile

The error is as follows:

/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

Thanks for your help!

Upvotes: 2

Views: 3090

Answers (3)

3rdFoundation
3rdFoundation

Reputation: 21

I was trying to run the rake command within ubuntu and was getting ruby_executable_hooks error. I resolved it with:

rvm all do gem install executable-hooks

Upvotes: 2

Jamie Carruthers
Jamie Carruthers

Reputation: 116

I fixed this by reverting back from p448 to p392 and then running:

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

as suggested by mpapis here: Rake assets:precompile cannot find ruby

Upvotes: 2

Trey Cucco
Trey Cucco

Reputation: 1

This seems to be an issue with 1.9.3-p448. Today I updated ruby from p392 to p448 on my server and started getting this error. I reverted back to p392 and precompilation of assets is working again.

Perhaps try installing a version before p448 and try again.

After working with this a bit more, I found that emptying and reinstalling my gems caused precompilation to start working again:

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

Upvotes: 0

Related Questions