skip to Main Content

My rails application runs using a docker and everytime I try to execute any ‘bin/rails’ commands in the terminal of the docker container, it raises the following error

Could not find racc-1.6.0 in any of the sources
Run `bundle install` to install missing gems.

on executing ‘gem list’ I have checked that racc is installed as ‘racc (1.6.0 default: 1.5.1)’ and calling ‘bundle install’ as the app suggest raises the same error. I assumed that maybe the ‘default: 1.5.1’ is the problem but did not manage to come around this one so far. Also executing ‘which racc’ or ‘bundle info racc’ returns the correct version of racc which is 1.6.0.

Update:

an exception is ‘bin/rails server’ which means the application launches like usual but I cannot do migrations and console calls.
Trying to use other racc version did not do any better since using 1.5.2 raises the same error and 1.5.1 requires nokogiri-linux which I did not manage to install locally so far

2

Answers


  1. Chosen as BEST ANSWER

    So, after trying a bunch of commands and re-deploying the image I figured out that in the end creating a new project would solve most of the issues. Unfortunately, I still did not find out the cause of this problem but I assume there might have been conflicts in the configuration or general problems in the project setting. So heres the solution summed up

    Solution 1:

    • create a new rails project and make sure it has identical gem requirement as the original project (simple way of doing this is to copy/paste the content of gemfile from the original project)
    • run new project application and check if bin/rails console (optional)
    • copy the entire content of the new project into the original project (don't forget to back up original project before doing so)

    Solution 2:

    • if your project directory has a hidden .bundle folder, delete it to prevent rails app from reading gems in vendor/cache. Check bundle info <gem-name> to see if gem path is set on the correct gem-directory

    Probably not a solution for all cause but this was my last option to try when everything else failed


  2. please try “docker-compose run web bundle install” command. This should work

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search