Cant run assets:precompile on heroku
Cant run assets:precompile on heroku
I am developing a Rails app on Windows 10 under Rails 5.2.1 and Ruby 2.4.4p296
I cannot run the command heroku run rake assets:precompile
heroku run rake assets:precompile
I get this error:
C:UsersJaielDesktopRubyOnRailsForum>heroku run rake assets:precompile --trace
Running rake assets:precompile --trace on ⬢ warm-mountain-15591... up, run.4644 (Free)
** Invoke assets:precompile (first_time)
** Invoke assets:environment (first_time)
** Execute assets:environment
** Invoke environment (first_time)
** Execute environment
** Invoke yarn:install (first_time)
** Execute yarn:install
Yarn executable was not detected in the system.
Download Yarn at https://yarnpkg.com/en/docs/install
** Execute assets:precompile
Is it even an error? There are assets in the public/assets folder on heroku, however the JavaScript files seem to be not working or are conflicting each other as I also have a problem with them. For example links with method: :delete dont work in my App on Heroku in production environment.
public/assets
method: :delete
Here is a thread about my problem that is maybe related to it
1 Answer
1
Try this
$rake assets:precompile (RAILS_ENV=production bundle exec rake assets:precompile is the exact rake task)
Since precompilation is done in production mode only, no need to explicitly specify the environment.
Update:
Try adding the below line to your Gemfile:
group :assets do
gem 'therubyracer'
gem 'sass-rails', " ~> 3.1.0"
gem 'coffee-rails', "~> 3.1.0"
gem 'uglifier'
end
Then run bundle install.
Hope it will work :)
Thanks for contributing an answer to Stack Overflow!
But avoid …
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
But avoid …
To learn more, see our tips on writing great answers.
Required, but never shown
Required, but never shown
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Is it even an error? - there is no any errors.
– Зелёный
Sep 3 at 5:36