Techioz Blog

gem のインストール時にバンドルのインストールがハングする

概要

Canvas LMS を Ubuntu 22.04 システムにインストールしようとしています。

Canvas LMS によって指定された必要な gem に対してバンドル インストールを実行してみました。

これは私が得る出力です:

Resolving dependencies...
Fetching https://github.com/wrapbook/crystalball.git
Fetching https://github.com/instructure/rspecq.git
Fetching https://github.com/twitter/thrift_client.git
Fetching https://github.com/kreynolds/cassandra-cql.git
Fetching gem metadata from https://rubygems.org/........
Resolving dependencies...
Installing oj 3.16.3 with native extensions
Installing pg_query 5.1.0 with native extensions
Building native extensions. This could take a while...
Killed

pg_query のインストールで永久にスタックしてしまいます。 2時間放置しましたが何も起こりません。

奇妙なことに、私は gem install pg_query を手動で実行することで、その gem を手動でインストールすることができました。それは機能し、gem info pg_query を実行すると次のことがわかります。

*** LOCAL GEMS ***

pg_query (5.1.0)
    Author: Lukas Fittl
    Homepage: https://github.com/pganalyze/pg_query
    License: BSD-3-Clause
    Installed at: /home/ubuntu/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0

    PostgreSQL query parsing and normalization library

2つのことがわかりません:

解決策

それは記憶力の問題でした。以下の投稿で提案されているようにスワップ ファイルを作成したら、うまくいきました。

Railsサーバーのnil:NilClassの未定義メソッド