Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to run under Ruby 3.1 (Ubuntu 23.04) #2924

Open
DeanCording opened this issue May 1, 2023 · 1 comment · May be fixed by #2709
Open

Fails to run under Ruby 3.1 (Ubuntu 23.04) #2924

DeanCording opened this issue May 1, 2023 · 1 comment · May be fixed by #2709

Comments

@DeanCording
Copy link

Upgrading to Ubuntu 23.04, which includes and upgrade from Ruby 3.0 to 3.1, results in Tracks not running.

Running bundler install to reinstall the Gems for the new version of Ruby fails on installing therubyracer with the error:

/usr/lib/ruby/3.1.0/psych/class_loader.rb:99:in `find': Tried to load unspecified class: Libv8::Location::Vendor (Psych::DisallowedClass)

This is a known issue with therubyracer - see Issue 467

As therubyracer is no longer maintained, the suggested solution is the change over to mini_racer by changing the entry in the Gemfile.

There appears to be a configuration mismatch with two of the mini_racer and libv8-node which I worked around by renaming the libv8-node cache directory from vendor/cache/ruby/3.1.0/gems/libv8-node-16.10.0.0-x86_64-linux-musl/vendor/v8/x86_64-linux-musl to vendor/cache/ruby/3.1.0/gems/libv8-node-16.10.0.0-x86_64-linux-musl/vendor/v8/x86_64-linux

I've done this and have Tracks working again under Ubuntu 23.04 and Ruby 3.1.2.

@ZeiP ZeiP linked a pull request May 4, 2023 that will close this issue
@habernal
Copy link

habernal commented Jan 7, 2024

FYI I've just tried on Ubuntu 23.10 in Docker with Node-JS package and it worked:

docker run -p 3000:3000 -it ubuntu:23.10
apt-get update && apt-get install git-core nano wget ruby ruby-dev build-essential libsqlite3-dev shared-mime-info nodejs tzdata libssl-dev -y

ruby --version # just curious
# ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux-gnu]

cd /srv
git clone https://github.com/TracksApp/tracks.git  # master
cd /srv/tracks

# added extra for up-to-date libs
rm Gemfile.lock

bundler3.1 config set --local path 'vendor/bundle'
export RAILS_SERVE_STATIC_FILES=true
bundler3.1 config set --local without 'postgresql mysql'
bundler3.1 install
cp config/site.yml.tmpl config/site.yml
cp config/database.yml.tmpl config/database.yml
nano config/database.yml    # Use the SQLite config instead
bundler3.1 exec rake db:migrate RAILS_ENV=production
bundler3.1 exec rake assets:precompile RAILS_ENV=production

(generate a self-signed local ssl certificate for testing with SSL)

openssl req -newkey rsa -nodes -keyout key.pem -out req.pem
openssl x509 -req -days 365 -in req.pem -signkey key.pem -out cert.pem

Run the server

bundler3.1 exec puma -e production -b 'ssl://0.0.0.0:3000?key=key.pem&cert=cert.pem'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants