Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationEventAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
8
Help us understand the problem. What are the problem?

More than 1 year has passed since last update.

【rails sできない解決法】rails aborted! Sprockets::Railtie::ManifestNeededError: Expected to find a manifest file

解決策だけ書いたページです。解説しません。

ターミナルにこんな感じのエラーがでた人向けです。

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

これで見れるはず。
localhost:3000にて「Sprockets::Railtie::ManifestNeededError:」で見れない場合は
①②が原因でそもそもdbが作れてない可能性があるので、
下記のくだりをもう一通りやってみてください。

[例のアレ]
bundle exec rake db:create
 ↓
bundle exec rake db:migrate

参考記事

DB作成時の「Sprockets::Railtie::ManifestNeededError:」の解決方法
https://qiita.com/kota-es/items/afdc1fb743408f4a5210

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
8
Help us understand the problem. What are the problem?