chatwoot

Invest Jin
2 min readMar 31, 2024

--

* docker 
$ docker exec -it ubuntu-chatwoot /bin/bash
$ apt update
$ apt upgrade
$ apt install git
$ apt-get install iputils-ping net-tools
apt install curl
https://github.com/quimaxa/chatwoot.git
apt-get install ruby-full
apt-get install libpq-dev # postgresql
apt-get install yarn
ruby -v
gem -v
gem install bundler
bundle --version
bundle install


curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
apt update
apt-get install yarn
yarn --version
# x.x.x 로 표시됨

* node 설치
$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
$ export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
$ nvm install 20
$ nvm use 20

$ yarn install


* 접속테스트
$ psql -h 192.168.0.31 -U postgres
* db생성
$ rails db:create db:migrate db:seed

* 서버실행
$ bundle exec rails server
* 127.0.0.1:3000 으로 생성되어 외부에서 접속이 안됨
$ bundle exec rails server -b 0.0.0.0

$ netstat -tuln
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:3000 0.0.0.0:* LISTEN
* ruby version

apt-get install build-essential
apt install wget curl
apt-get install libssl-dev libreadline-dev zlib1g-dev #openssl
apt-get install libffi-dev # ruby
apt-get install autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm6 libgdbm-dev libdb-dev #ruby

git clone https://github.com/rbenv/rbenv.git ~/.rbenv
cd ~/.rbenv && src/configure && make -C src
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
~/.rbenv/bin/rbenv init

mkdir -p "$(rbenv root)"/plugins
git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build

rbenv install 3.2.2
rbenv global 3.2.2
rbenv local 3.2.2
eval "$(rbenv init -)"


$ gem install rails
Done installing documentation for rackup, minitest, activesupport, rack-session, actionview, actionpack, railties, activemodel, activerecord, activejob, activestorage, actiontext, actionmailer, actionmailbox, actioncable, rails after 6 seconds
16 gems installed

A new release of RubyGems is available: 3.4.10 → 3.5.7!
Run `gem update --system 3.5.7` to update your installation.

$ rails -v
Rails 7.1.3.2


~/.bashrc 파일에 하단 2줄 내용 추가
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"


$ docker commit ubuntu-chatwoot ubuntu-chatwoot-port
$ docker images
$ docker run -p 3030:3000 --name ubuntu-chatwoot -d ubuntu-chatwoot-port

* 오류가 발생해서 -d 제거 후 테스트
$ docker run -p 3030:3000 --name ubuntu-chatwoot ubuntu-chatwoot-port

$ sudo ufw allow 3030 # host

* redis-server setup
$ apt-get install redis-server


* library: 'digital envelope routines', reason: 'unsupported', code: 'ERR_OSSL_EVP_UNSUPPORTED'
* node 와 openssl 버전 호환성에서 오류가 발생함
* node 16 버전으로 내리면 된다고 하는데, node버전을 낮출수가 없어서 아래 NODE_OPTIONS을 추가해서 해결해봄

$ openssl version
OpenSSL 3.0.2 15 Mar 2022 (Library: OpenSSL 3.0.2 15 Mar 2022)

$ export NODE_OPTIONS=--openssl-legacy-provider

$ npx browserslist@latest --update-db
$ bin/rails webpacker:compile

http://localhost:3000
user name: john@acme.inc
password: Password1!

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Invest Jin
Invest Jin

No responses yet

Write a response