cloud9環境で、Rails 5.1+React.jsの環境構築を行いたい
掲題の通りです。この記事に従って、行っているのですが、途中でつまづいてしまいます。
発生している問題・エラーメッセージ
まず、ビルドでつまづきます。
bin/webpack
を実行しようとすると、
Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.
といった表記がでてくるため、指示に従い
bundle binstubs bundler --force
したのち、再び bin/webpack でビルドを試みます。
すると、ビルドもうまくいき、サーバーの起動も成功するのですが...
肝心のwebアクセスができない
アクセスに失敗します。というか、syntax.errorが出てきてしまいます。
Your code is running at https://xxx.c9users.io. Important: use process.env.PORT as the port and process.env.IP as the host in your scripts! Debugger listening on [::]:15454 Hello World from Webpacker /home/ubuntu/workspace/webpacker-sample/app/javascript/packs/hello_react.jsx:5 import React from 'react' ^^^^^^ SyntaxError: Unexpected token import at createScript (vm.js:56:10) at Object.runInThisContext (vm.js:97:10) at Module._compile (module.js:542:28) 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> (/home/ubuntu/workspace/webpacker-sample/app/javascript/packs/application.js:10:1) Process exited with code: 1
何回か、新規で作り直してみたりなどやってみたのですが、一向にできません。
どなたか、解決方法やその方向性だけでもわかる方、お力をお貸しください。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。