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

How to fix: "sh: /Users/username/Library/Mobile: No such file or directory"? #569

Open afuno opened 6 years ago

afuno commented 6 years ago

Which operating system and version is the project developed on? macOS Nigh Sierra 10.13.4 (17E202)

Which version of ruby is the project developed on? ruby 2.4.3p205 (2017-12-14 revision 61247) [x86_64-darwin17]

Which version of npm is the project developed on? 5.6.0

Which version of ember-cli is the project developed on? 3.1.4

What is the rails version? 5.1.6

What is the ember-cli-rails version (from Gemfile)? ember-cli-rails (0.10.0)

What is the ember-cli-rails-addon version (from package.json)? "ember-cli-rails-addon": "^0.10.0"

Is your application server multi-threaded (such as puma and unicorn) or is it multi-process (such as thin and webrick)? Puma

What are the contents of config/initializers/ember.rb?

EmberCli.configure do |c|
  c.app :frontend, yarn: true
end

What are the contents of the Rails' view that renders the Ember application?

EmberCli::BuildError at /beta
:frontend has failed to build: sh: /Users/afuno/Library/Mobile: No such file or directory

The problem occurs when I execute the command: rails ember:install. In response, I get this:

$ rails ember:install
sh: /Users/afuno/Library/Mobile: No such file or directory・・・・・・・・・ 0% Progress
yarn install v1.6.0
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
[4/5] Linking dependencies...
[5/5] Building fresh packages...
Done in 17.62s.

When I run a Rails application through a foreman (Procfile.dev):

web: bundle exec rails s -p 3050
webpacker: webpack-dev-server
worker: bundle exec sidekiq -C config/sidekiq.yml

I get this error from Ember CLI: config/routes.rb:

Rails.application.routes.draw do
  root 'public/home#index'

  mount_ember_app :frontend, to: :beta

  # ...

On the site:

EmberCli::BuildError at /beta
:frontend has failed to build: sh: /Users/afuno/Library/Mobile: No such file or directory

Full path to the project:

$ pwd
/Users/afuno/Library/Mobile Documents/com~apple~CloudDocs/Projects/Personal/Projects/my-app

This problem was not with the Webpacker, nor with anything else...


Is everything all right here? Can you please correct this problem promptly? I would be very grateful to you. Or tell me how to fix it if there is an available method.

https://github.com/thoughtbot/ember-cli-rails/blob/master/lib/ember_cli/shell.rb#L92-L99

seanpdoyle commented 6 years ago

I have a hunch that the whitespace in Mobile Documents is part of the issue here.

As a temporary fix, could you try moving your source code to a path without a space in it?

afuno commented 6 years ago

@seanpdoyle This is not an assumption. It is a fact. The problem is in this place. But this problem does not arise anywhere. No, I can not move the project. Please correct this error, for this is a very strange error for 2018 :)

seanpdoyle commented 6 years ago

this is a very strange error

I agree!

No, I can not move the project.

For the sake of helping us reproduce this issue and find the source of the unexpected behavior, could you try temporarily moving the project to another directory?

If you're able to do that, could you run the commands then share the outcome with us?

seanpdoyle commented 6 years ago

@afuno I'm trying to resolve this in my local environment and I'm having path resolution issues outside of this gem (for example, in my environment, npm install within a directory that contains spaces in its name is failing to run).

These issues are preventing me from running the test suite and ensuring that the changes I'm making resolve the bug.

Could you try pulling down https://github.com/thoughtbot/ember-cli-rails/compare/issue-569 and running it locally, then report back here with the results?

# Gemfile

gem "ember-cli-rails", github: "thoughtbot/ember-cli-rails", branch: "issue-569"
afuno commented 6 years ago

@seanpdoyle Well, I'll try this soon. Now I switched to Ember application. When I return to Rails, I'll write.