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 3 years have passed since last update.

遭遇したエラー集

Last updated at Posted at 2021-08-10

#Rspec failure/error: user = factorybot.build(:user) keyerror: factory not registered: "user"の解決
###解決法
spec/models/factories/users.rbをspec/factories/users.rbにして解決
#no such file or directory @ rb_sysopen - public/user_images/1.jpgの解決
###解決法
publicにuser_imagesフォルダを作る。
#Mysql2::Error: Duplicate column name 'image_name'の解決
###解決策
migrationファイルを空にする=>rails db:migrate=>成功=>元の通りの記述をする=>rails db:migrate
#Gemfileがないエラー(間違えて消してしまったとき)+command+Zでも元に戻らないとき

$ bundle init

上記の実行でGemfileが作られる=>インストールしたいGemを記述する=>

$ bundle install
confing.fu
require_relative 'config/environment'
run Rails.application
Rails.application.load_server

=>終わり

本当にGemfileがないのか

$ find /-name Gemfile 

このコマンドでGemfileがどこにあるのか教えてくれる。
#参考記事
https://qiita.com/Takao_/items/5e563d5ea61d2829e497
https://teratail.com/questions/281935
https://qiita.com/yoshixj/items/6441ab2cd6bc367e607d
https://qiita.com/Yu-kiFujiwara/items/aa51db04e5ff64362bd2
https://qiita.com/chiaki-kjwr/items/118a5b3237c78d720582
https://qiita.com/r-wakatsuki/items/095d5d88d1288df6f9c6

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?