tricknotes / ember-cli-rails

Unify your EmberCLI and Rails Workflows
http://thoughtbot.github.io/ember-cli-rails/
MIT License
713 stars 205 forks source link

No `ember-cli` executable found for `frontend`. Install it: #490

Open EduMaca opened 8 years ago

EduMaca commented 8 years ago

Which operating system and version is the project developed on? Windows 8 Which version of [ruby][ruby] is the project developed on? 2.2.4p230 Which version of [npm][npm] is the project developed on? 3.10.8 Which version of [ember-cli][ember-cli] is the project developed on? 2.8.0 What is the [rails][rails] version? 5.0.0.1 What is the [ember-cli-rails][gem] version (from Gemfile)? (0.8.1) What is the [ember-cli-rails-addon][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)? The application server is puma What are the contents of config/initializers/ember.rb? EmberCli.configure do |c| c.app :frontend end

The project on linux was running perfectly, so i deleted the node_packages and bower_components folders for my backup on cloud. When i downloaded the project, i run npm install and bower install but the error is showing up.

I already saw the folder ember-cli and .bin of node_modules, the files are in there.

hermiti commented 7 years ago

This gem doesn't work on windows, as far as I know.

I tried to build a patch to get this gem to work on windows but I was never completely successful. Here is what I found and perhaps @seanpdoyle will be able help.

  1. The error you receive is a result of the system attempting to check whether or not a javascript script file is executable under windows, this will never succeed as windows interprets this file as a text file. I wrote a work around to bypass this check to determine if the gem was being executed on windows.

ember-cli-rails/lib/ember_cli/path_set.rb

def ember
  @ember ||= begin
    root.join("node_modules", "ember-cli", "bin", "ember").tap do |path|
      unless path.executable?
        fail DependencyError.new <<-MSG.strip_heredoc
          No `ember-cli` executable found for `#{app_name}`.
          Install it:
              $ cd #{root}
              $ #{package_manager} install
        MSG
      end
    end
  end
end

unless path.executable? always fails on windows

  1. Once the Javascript files are able to execute then because they are being invoked as a text file with as a bash script they will not run, I had to prepend all of the scripts with the node executable as an interpreter and determine if the file was a node script or a cmd script.

The run and run! methods in ember-cli-rails/lib/ember_cli/runner.rb must be modified to handle executing the node script using the node interpreter.

Ultimately I was only able to build through rails ember:compile but each individual request to the application would timeout. At that point I gave up.

howdoicomputer commented 7 years ago

Well that's a bummer.

hermiti commented 7 years ago

I got it to work, It's a hack and there should be a much better solution, hopefully provided in the future. ember-cli-rails w/ temporary windows work-around