1
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.

メモ:Ruby on Rails debug時のコマンド

Last updated at Posted at 2018-08-17

エラー
Ignoring nokogiri-1.8.4 because its extensions are not built. Try: gem pristine nokogiri --version 1.8.4 .....
Your Ruby version is 2.4.0, but your Gemfile specified 2.5.1
対応
$ rvm get stable
$ gem update bundler
$ bundle install --without production
source:
https://stackoverflow.com/questions/30726848/why-do-i-keep-getting-these-errors-after-running-gem-pristine-all
https://stackoverflow.com/questions/23039528/your-ruby-version-is-2-0-0-but-your-gemfile-specified-2-1-0

エラー
config/boot.rb:4:in `require': cannot load such file -- bootsnap/setup (LoadError)

対応
$ bundle update bootsnap
source:
https://github.com/Shopify/bootsnap/issues/73

$ echo 'gem "bootsnap", require: false' >> Gemfile
$ bundle install
source:
https://github.com/Shopify/bootsnap/issues/134


エラー
Your bundle is locked to parser (2.5.0.4), but that version could not be found in any of the sources listed in your Gemfile.

対応
$ bundle update parser --patch

source:
https://stackoverflow.com/questions/49499606/error-while-running-bundle-install-bundle-is-locked-to-a-parser


エラー
rake aborted! SystemStackError: stack level too deep

対応
1 Gemfile書き換え
$ gem 'rails', github: 'rails/rails', branch: '4-2-stable'

2 bundle install
$ gem update --system


エラー
error occurred while installing json (1.8.3)
Make sure that gem install json -v '1.8.3' succeeds before bundling

対応
$ bundle update json
source:
https://stackoverflow.com/questions/21095098/why-wont-bundler-install-json-gem

$ gem install json -v1.8.3
source:
https://stackoverflow.com/questions/43738346/an-error-occurred-while-installing-json-1-8-2-and-bundler-cannot-continue

$ bundle update


エラー
rails aborted! StandardError: An error has occurred, this and all later migrations canceled: Directly inheriting from ActiveRecord::Migration is not supported. Please specify the Rails release the migration was written for:

対応
db/migrate/_create_friendly_id_slugs.rbに追記
class CreateFriendlyIdSlugs < ActiveRecord::Migration[5.1]
Source:
https://github.com/norman/friendly_id/issues/797

1
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
1
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?