1. TheOkachanPG

    Posted

    TheOkachanPG
Changes in title
+【rails sできない解決法】rails aborted! Sprockets::Railtie::ManifestNeededError: Expected to find a manifest file
Changes in tags
Changes in body
Source | HTML | Preview
@@ -0,0 +1,57 @@
+解決策だけ書いたページです。解説しません。
+
+こんな感じのエラーがでた人向けです。
+
+```
+rails aborted!
+Sprockets::Railtie::ManifestNeededError: Expected to find a manifest file in `app/assets/config/manifest.js`
+But did not, please create this file and use it to link any assets that need
+to be rendered by your app:
+
+Example:
+ //= link_tree ../images
+ //= link_directory ../javascripts .js
+ //= link_directory ../stylesheets .css
+and restart your server
+/Users/okakaori/projects/todo_app/memo_app/config/environment.rb:5:in `<top (required)>'
+/Users/okakaori/projects/todo_app/memo_app/bin/rails:9:in `require'
+/Users/okakaori/projects/todo_app/memo_app/bin/rails:9:in `<top (required)>'
+/Users/okakaori/projects/todo_app/memo_app/bin/spring:13:in `<top (required)>'
+bin/rails:3:in `load'
+bin/rails:3:in `<main>'
+Tasks: TOP => db:create => db:load_config => environment
+(See full trace by running task with --trace)
+okakaorinoAir:memo_app okakaori$ rake db:creat
+rake aborted!
+Don't know how to build task 'db:creat' (See the list of available tasks with `rake --tasks`)
+Did you mean? db:create
+
+(See full trace by running task with --trace)
+```
+
+#解決法
+
+
+##①不足した「manifest.js」を作る
+**app/assets/config/manifest.js**
+上記のフォルダに「manifest.js」を作って入れる。
+app/assets/配下に「config」がない場合は自分で作る。
+
+##②manifest.jsに不足した記述を書く
+①で作ったファイルに下記を記入
+
+``` manifest.js
+ //= link_tree ../images
+ //= link_directory ../javascripts .js
+ //= link_directory ../stylesheets .css
+```
+
+##③rails s
+これで見れるはず。
+見れない場合は①②が原因でそもそもdbが作れてない可能性があるので、
+下記のくだりをもう一通りやってみてください。
+
+[例のアレ]
+bundle exec rake db:create
+ ↓
+bundle exec rake db:migrate