pglombardo / PasswordPusher

🔐 Securely share sensitive information with automatic expiration & deletion after a set number of views or duration. Track who, what and when with full audit logs.
https://docs.pwpush.com
Apache License 2.0
1.96k stars 343 forks source link

Installing in Ubuntu 2204 matters #939

Open technofab opened 1 year ago

technofab commented 1 year ago

🐛 Bug Report

In a Ubuntu2204 Server fresh install box, after installed ruby-full gcc g++ make doing a source installation with a root user the following commands:

git clone git@github.com:pglombardo/PasswordPusher.git cd PasswordPusher gem install bundler bundle config set with 'sqlite' # Or 'postgres' or 'mysql' bundle install --without development production test --deployment

During bundle exec rake assets:precompile

the command return

/usr/lib/x86_64-linux-gnu/ruby/3.0.0/continuation.so: warning: callcc is obsolete; use Fiber instead
Debug.rb
Emacs support available.

/PasswordPusher/vendor/bundle/ruby/3.0.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:33:      Bootsnap::LoadPathCache.loaded_features_index.register(string_path, resolved)
(rdb:1)

🔬 How To Reproduce

Ubuntu2204 Server fresh install box, after installed ruby-full gcc g++ make Use the source guide installation

Code sample

Environment

Ubuntu2204 Server fresh install box, after installed ruby-full gcc g++ make

Thanks in advance.

github-actions[bot] commented 1 year ago

Hello @technofab, thanks for contributing to the Password Pusher community! We will respond as soon as possible.

pglombardo commented 1 year ago

Hi @technofab - The most likely cause it the Ruby version is too old.

Can you run ruby -v and tell me what version of Ruby is in use?

technofab commented 1 year ago

Hi (ciao ;)) the version result as _ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x8664-linux-gnu]

pglombardo commented 1 year ago

Ciao Fabrizio! I tried running the source in the ubuntu:22.04 docker container and hit a bunch of issues. But I did get closer.

callcc is obsolete; use Fiber instead

To fix this run export RAILS_ENV=private to get around it. It seems to be some ruby/bootsnap bug that drops you into a debugger. :-/

I had to also install: apt install libsqlite3-dev sqlite3 yarnpkg nodejs

And still couldn't get the sqlite3 gem to build/compile.

I updated the source code documentation a bit.

I'll have to revisit this once I have a bit more time. Try some of the above and let me know if it helps.

technofab commented 1 year ago

So now, I restart from a previous snapshot

I do:

apt install ruby-full gcc g++ make apt install libsqlite3-dev sqlite3 apt install nodejs apt install npn apt install yarn gem install sqlite3

git clone git@github.com:pglombardo/PasswordPusher.git cd PasswordPusher gem install bundler

export RAILS_ENV=private

bundle config set with 'sqlite' bundle config set --local deployment 'true' bundle install --without development production test

but during the ./bin/rails assets:precompile

I obtain

./bin/rails assets:precompile
rails aborted!
LoadError: Error loading the 'sqlite3' Active Record adapter. Missing a gem it depends on? sqlite3 is not part of the bundle. Add it to your Gemfile.
/PasswordPusher/config/environment.rb:5:in `<main>'

Caused by:
Gem::LoadError: sqlite3 is not part of the bundle. Add it to your Gemfile.
/PasswordPusher/config/environment.rb:5:in `<main>'
Tasks: TOP => environment
(See full trace by running task with --trace)

But i check and sqlite is present..

gem list | grep sqlite
sqlite3 (1.6.1 x86_64-linux)

cat Gemfile.lock | grep -i sqlite
    sqlite3 (1.6.1)
  sqlite3

I also noted that we need an active internet connection during install. We are actually under a proxy connection..

Edit: I just uninstalled 1.6.6 of gem sqlite and installed latest 1.4 (1.4.4) and redo all from export, but same error..

Edit 2: I just uninstalled 1.4.4 of gem sqlite and installed latest 1.4 (1.4.0) and redo bundle install --without development production test --force and next ./bin/rails assets:precompile

but same error..

Ideas?

pglombardo commented 1 year ago

Hi Fabrizio - apologies I've gotten pulled away for my day job. I'll take another look at this soon.

pglombardo commented 6 months ago

Hey @technofab - look at this old issue that I neglected 🤦

Did you ever make it past this issue?