thoughtbot/ember-cli-rails

EmberCLI failed to generate an `index.html` file on Heroku

BrianAllenGit opened this issue · 4 comments

To give some background, I followed the steps on the ember-cli-rails README for installation and Heroku. The app works just fine locally, and when I push to Heroku, it successfully builds, but never renders.

running "rails assets:precompile" on Heroku spit out this:

`DEPRECATION WARNING: config.static_cache_control is deprecated and will be removed in Rails 5.1.
Please use
config.public_file_server.headers = { Cache-Control => public, max-age=31622400 }
instead.
 (called from block in <top (required)> at /app/config/environments/production.rb:32)
Missing binding /app/frontend/node_modules/node-sass/vendor/linux-x64-48/binding.node
Node Sass could not find a binding for your current environment: Linux 64-bit with Node.js 6.x

Found bindings for the following environments:
  - OS X 64-bit with Node.js 6.x

This usually happens because your environment has changed since running `npm install`.
Run `npm rebuild node-sass` to build the binding for your current environment.
Error: Missing binding /app/frontend/node_modules/node-sass/vendor/linux-x64-48/binding.node
Node Sass could not find a binding for your current environment: Linux 64-bit with Node.js 6.x

Found bindings for the following environments:
  - OS X 64-bit with Node.js 6.x

This usually happens because your environment has changed since running `npm install`.
Run `npm rebuild node-sass` to build the binding for your current environment.
    at module.exports (/app/frontend/node_modules/node-sass/lib/binding.js:15:13)
    at Object.<anonymous> (/app/frontend/node_modules/node-sass/lib/index.js:14:35)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/app/frontend/node_modules/broccoli-sass-source-maps/index.js:5:16)
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue`

Please let me know what else I can supply, I will gladly provide whatever is necessary.

Which operating system and version is the project developed on?
Heroku
Which version of ruby is the project developed on?
2.3
Which version of npm is the project developed on?
3.10
Which version of ember-cli is the project developed on?
2.11
What is the rails version?
5.0.1
What is the ember-cli-rails version (from Gemfile)?
0.8.4
What is the ember-cli-rails-addon version (from package.json)?
0.8.0
Is your application server multi-threaded
(such as puma and unicorn) or is it multi-process (such as thin and webrick)?

Unsure
What are the contents of config/initializers/ember.rb?
EmberCli.configure do |c|
c.app :frontend
end

What are the contents of the Rails' view that renders the Ember application?
I manually created app/ember_cli/ember/index.html.erb based off the example project and copied in the contents.
<%= render_ember_app :frontend do |head| %>
<% head.append do %>
<%= csrf_meta_tags %>
<% end %>
<% end %>
How are the EmberCLI-related routes defined?
Unsure the answer to this. All my ember routes follow this setup:
import Ember from 'ember';

export default Ember.Route.extend({
//some code here
});

How is the application deployed?
Simply, git push heroku master. I don't precompile anything.

How are the EmberCLI-related routes defined?
Unsure the answer to this. All my ember routes follow this setup:
import Ember from 'ember';

export default Ember.Route.extend({
//some code here
});

I'm sorry that this part of the issues template is unclear. What it intends to prompt you for is the Ember route declarations in your Rails routes (i.e. config/routes.rb).

Missing binding /app/frontend/node_modules/node-sass/vendor/linux-x64-48/binding.node
Node Sass could not find a binding for your current environment: Linux 64-bit with Node.js 6.x

Found bindings for the following environments:
  - OS X 64-bit with Node.js 6.x

Is Node available on your dyno?

Have you added the Node buildpack?

Have you compared your application to https://github.com/seanpdoyle/ember-cli-rails-heroku-example?

Hi Sean, I actually just figured out what was happening.

My rake assets:precompile was not running on Heroku because Heroku checks for the presence of a manifest file. If it finds one, it skips the assets:precompile rake. I had a file in /public/assets with the word "manifest" in it. I thought I had checked before, but I was wrong.

ls public/assets | grep "manifest"
returned false, but
ls -a public/assets | grep "manifest"
returned a strange ".sprockets-manifest-SOMEHASH.json" file. After removing it, Heroku precompiled correctly, and my app started working just fine.

Thank you very much for the help!

Ahhh.

Thanks for following up on this issue!