WSL を使用して Windows 11 マシンで Discourse のローカルインスタンスを開発環境で動作させようとしています。
まず、Discourse、Ubuntu、WSL のすべてが初めてであることをお伝えしておきます。したがって、エラーは明らかに私のせいです。助けてください! ![]()
Windows 10 で Discourse をインストールする
上記は私が従ったガイドです。
4 回目の試行で、同じエラーに遭遇し続けています。インストールプロセスの詳細な内訳を提供します。
まず、Windows Subsystem for Linux 2 がインストールされていることを確認しました。ガイドでは Ubuntu 18.04 を推奨しているため、それを試しました。それが機能しなかった後、22.04 を試しましたが、結果は得られませんでした。この内訳では、エラーを示すために 18.04 を使用します。
最初のステップは、次のコマンドを使用してパッケージをインストールすることです。
<(wget -qO- https://raw.githubusercontent.com/discourse/install-rails/master/linux)
これは問題なく機能します。少し奇妙に見えるのは次のとおりです。
createuser: could not connect to database template1: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
failed
データベースをセットアップする前に、次のコマンドを使用して PostgreSQL サービスと Redis サーバーを手動で起動する必要があります。
sudo service postgresql start
redis-server --daemonize yes
最初のコマンドはうまく機能しますが、2 番目のコマンドにはすでに問題があります。
redis-server --daemonize yes
Command ‘redis-server’ not found, but can be installed with:
sudo apt install redis-server
それは問題ありません。実行します。
sudo apt install redis-server
そしてもう一度試します。
今回は、うまく機能します!
- Discourse リポジトリをクローンする
git clone https://github.com/discourse/discourse.git ~/discourse
ここには問題はありません。
次のコマンドでデータベースをセットアップします。
sudo -u postgres createuser -s "$USER"
4. ここが重要な部分です
cd ~/discourse
source ~/.bashrc
bundle install
エラー:
Command ‘bundle’ not found, but can be installed with:
sudo apt install ruby-bundler
実行します。インストール後、再度実行します。
bundle install
Discourse ディレクトリ内で。
Error: You must use Bundler 2 or greater with this lockfile.
その後、Bundler をインストールしようとすると:
ERROR: Error installing bundler: There are no versions of bundler (= 2.4.17) compatible with your Ruby & RubyGems bundler requires Ruby version >= 2.6.0. The current ruby version is 2.5.0.
わかりました、おそらく rbenv を使用して Ruby を更新する必要があるかもしれません。
rbenv install 2.6.0
ruby-build: definition not found: 2.6.0See all available versions with `rbenv install --list’.
If the version you need is missing, try upgrading ruby-build.
rbenv install --list を確認すると、2.5.0 でカットオフされ、rbenv を更新できないようです。
私が間違っている可能性のある点について、誰かヒントを教えていただけますか?ステップ 4 までしか進めないようです。
前もって、本当にありがとうございます!