0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

rails とvue

Posted at

new

rails new *** -B -d mysql -S -T --skip-coffee --skip-turbolinks --skip-test --webpack=vue
apiモードでつくった.
rails new fan_club --api --webpack=vue -d mysql

foreman導入

gem 'foreman'

/Procfile(rootの配下にファイルを作成)

Procfile.
rails: rails s
webpack: bin/webpack-dev-server
$ foreman start

サーバ立ち上げる時

bundle exec foreman start -f Procfile.dev

怒られたら(apiモードやたら注意される)

error Command "webpack-dev-server" not found.
これ.
⭕️yarn add webpack webpack-dev-server --dev
warning package.json: No license field
package.json
⭕️ "name": "fun_club",
   "private": true,
 Error: Cannot find module '@rails/webpacker'
⭕️yarn add @rails/webpacker

yarnの使用

yarn add vuex
yarn add vue-router
yarn add vue-eslint-parser
yarn add vee-validate
yarn add rails-ujs
yarn add js-cookie
yarn add vue-loader
yarn add axios
yarn add vue-axios
yarn add --dev babel-loader @babel/core @babel/preset-env

yarn add bulma
yarn add --dev sass-loader node-sass css-loader
yarn add --dev vue-svg-loader
yarn add buefy

blumaはいらん

webpackerでyarn buildできたらいいのかもしれないけど、webpacker.config.jsの設定が謎。
あきらめようとしたときにBuefyいれたら表示された
Buefyblumaをベースにして作られたvue.jsのUIフレームワーク

application.js
import Buefy from 'buefy'
import 'buefy/dist/buefy.css'
Vue.use(Buefy)
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?