1

I have a Ruby on Rails application that has been running fine for some time. Today, I added a few features to it and then started the application in a development environment, which started fine without errors. But when I try to access the application on my browser, I run into this error:

NameError: uninitialized constant Bootsnap::CompileCache::ISeq>)

I have tried updating the Bootsnap gem to the latest version:

gem 'bootsnap', '>= 1.4.6'

Deleted the Gemfile.lock file

rm -rf Gemfile.lock

And then ran bundle update command to update the gems

bundle update

But no success yet, since I am still running into the same issue. Any form of help will be highly appreciated. Thanks.

4

1 回答 1

5

I finally figured it out. I did not have to update the Bootsnap gem.

The problem is that Bootsnap gem tmp directory in your application directory is not writable to the current user, that is, the current user does not have permission to write to the Bootsnap gem tmp directory in your application directory.

Here's how I solved it:

Simply delete the Bootsnap gem tmp directory in your application directory with superuser rights:

sudo rm -rf tmp/cache/bootsnap-load-path-cache
sudo rm -rf tmp/cache/bootsnap-compile-cache

Do not recreate the tmp directory again, it's a waste of effort

Simply start your application and the tmp directory will be created automatically again:

rails s

If after this you encounter this error:

Permission denied @ apply2files

Then follow the solution here: Rails: “Permission denied - /tmp/cache/assets/development/sprockets/

That's all.

I hope this helps

于 2020-04-16T14:03:23.413 回答