LoginSignup
1
2

More than 3 years have passed since last update.

ActiveRecord::PendingMigrationErrorへの対処

Posted at

ActiveRecord::PendingMigrationErrorへの対処

[vagrant@localhost sample_app2]$ rails db:migrate
Rails Error: Unable to access log file. Please ensure that /home/vagrant/environment/sample_app2/log/development.log exists and is writable (ie, make it writable for user and group: chmod 0664 /home/vagrant/environment/sample_app2/log/development.log). The log level has been raised to WARN and the output directed to STDERR until the problem is fixed.
  • パーミッションのエラーっぽいので、対象のファイルのパーミッションを変更しましたが、解決しません
[vagrant@localhost sample_app2]$ rails db:migrate
rails aborted!
NameError: undefined local variable or method `ip' for main:Object
/home/vagrant/environment/sample_app2/db/migrate/20190507092859_create_microposts.rb:12:in `<top (required)>'
/home/vagrant/environment/sample_app2/bin/rails:9:in `require'
/home/vagrant/environment/sample_app2/bin/rails:9:in `<top (required)>'
/home/vagrant/environment/sample_app2/bin/spring:15:in `<top (required)>'
bin/rails:3:in `load'
bin/rails:3:in `<main>'

Caused by:
NameError: undefined local variable or method `ip' for main:Object
/home/vagrant/environment/sample_app2/db/migrate/20190507092859_create_microposts.rb:12:in `<top (required)>'
/home/vagrant/environment/sample_app2/bin/rails:9:in `require'
/home/vagrant/environment/sample_app2/bin/rails:9:in `<top (required)>'
/home/vagrant/environment/sample_app2/bin/spring:15:in `<top (required)>'
bin/rails:3:in `load'
bin/rails:3:in `<main>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
  • migrationファイルの末尾に「ip」という文字を誤って入力してたのが原因でした、、、
  • migrationファイルを修正し解決しました!!
1
2
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
1
2