By adrilef
Hi,
I am using App Platform to deploy a Ruby on Rails API backend. Rails version : 7.0.2 Ruby version : 3.1.1
When I deploy my backend on App Platform both build and deploy phase are working properly.
I am switching to a monorepo where I have two folders : /frontend and /backend.
I created a new App on App platform by setting the source directory to /backend.
Then, the build phase worked well.
But when the deploy phase starts I get this error :
[2022-03-31 08:46:55] /usr/lib/ruby/2.5.0/rubygems/dependency.rb:310:in `to_specs': Could not find 'racc' (~> 1.4) among 176 total gem(s) (Gem::MissingSpecError)
[2022-03-31 08:46:55] Checked in 'GEM_PATH=/layers/heroku_ruby/gems/vendor/bundle/ruby/3.1.0:/workspace/.gem/ruby/2.5.0:/var/lib/gems/2.5.0:/usr/lib/x86_64-linux-gnu/rubygems-integration/2.5.0:/usr/share/rubygems-integration/2.5.0:/usr/share/rubygems-integration/all', execute `gem env` for more information
[2022-03-31 08:46:55] from /usr/lib/ruby/2.5.0/rubygems/specification.rb:1469:in `block in activate_dependencies'
[2022-03-31 08:46:55] from /usr/lib/ruby/2.5.0/rubygems/specification.rb:1458:in `each'
[2022-03-31 08:46:55] from /usr/lib/ruby/2.5.0/rubygems/specification.rb:1458:in `activate_dependencies'
[2022-03-31 08:46:55] from /usr/lib/ruby/2.5.0/rubygems/specification.rb:1440:in `activate'
[2022-03-31 08:46:55] from /usr/lib/ruby/2.5.0/rubygems/specification.rb:1472:in `block in activate_dependencies'
[2022-03-31 08:46:55] from /usr/lib/ruby/2.5.0/rubygems/specification.rb:1458:in `each'
[2022-03-31 08:46:55] from /usr/lib/ruby/2.5.0/rubygems/specification.rb:1458:in `activate_dependencies'
[2022-03-31 08:46:55] from /usr/lib/ruby/2.5.0/rubygems/specification.rb:1440:in `activate'
[2022-03-31 08:46:55] from /usr/lib/ruby/2.5.0/rubygems/specification.rb:1472:in `block in activate_dependencies'
[2022-03-31 08:46:55] from /usr/lib/ruby/2.5.0/rubygems/specification.rb:1458:in `each'
[2022-03-31 08:46:55] from /usr/lib/ruby/2.5.0/rubygems/specification.rb:1458:in `activate_dependencies'
[2022-03-31 08:46:55] from /usr/lib/ruby/2.5.0/rubygems/specification.rb:1440:in `activate'
[2022-03-31 08:46:55] from /usr/lib/ruby/2.5.0/rubygems/specification.rb:1472:in `block in activate_dependencies'
[2022-03-31 08:46:55] from /usr/lib/ruby/2.5.0/rubygems/specification.rb:1458:in `each'
[2022-03-31 08:46:55] from /usr/lib/ruby/2.5.0/rubygems/specification.rb:1458:in `activate_dependencies'
[2022-03-31 08:46:55] from /usr/lib/ruby/2.5.0/rubygems/specification.rb:1440:in `activate'
[2022-03-31 08:46:55] from /usr/lib/ruby/2.5.0/rubygems/specification.rb:1472:in `block in activate_dependencies'
[2022-03-31 08:46:55] from /usr/lib/ruby/2.5.0/rubygems/specification.rb:1458:in `each'
[2022-03-31 08:46:55] from /usr/lib/ruby/2.5.0/rubygems/specification.rb:1458:in `activate_dependencies'
[2022-03-31 08:46:55] from /usr/lib/ruby/2.5.0/rubygems/specification.rb:1440:in `activate'
[2022-03-31 08:46:55] from /usr/lib/ruby/2.5.0/rubygems.rb:310:in `block in activate_bin_path'
[2022-03-31 08:46:55] from /usr/lib/ruby/2.5.0/rubygems.rb:309:in `synchronize'
[2022-03-31 08:46:55] from /usr/lib/ruby/2.5.0/rubygems.rb:309:in `activate_bin_path'
[2022-03-31 08:46:55] from /layers/heroku_ruby/gems/vendor/bundle/ruby/3.1.0/bin/rails:25:in `<main>'
The build command is
rails server -p $PORT -e ${RAILS_ENV:-production}
Thanks a lot for your help,
Adrien
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi Adrien,
I think your environment variables are not corrects. You can check out:
$ gem env
What versions of Ruby are you installed?
$ rvm list
You should check what version you have in the file .ruby-version and specify this version by default.
rvm use --default 3.1.1
Finally, Why your GEM_PATH point to /layers/heroku_ruby ?
I wait you tell me something :)
Best regards,
Sergio Turpín
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.