Deploying our Rails Blog to Production Discussion
Hello Chris, thank you very much for you do to help us... I'm trying to deploy the blog but when building it on render I'm getting an error... Your RubyGems version (3.0.3.1) has a bug that prevents required_ruby_version
from working for Bundler. Any scripts that use gem install bundler
will break as soon as Bundler drops support for your Ruby version. Please upgrade RubyGems to avoid future breakage and silence this warning by running gem update --system 3.2.3
I've run the recommended commands but nothing changes... working with Ubuntu 22.04.
Thanks
Hi Chris, thank you for this video.
Everything working great except my images in production 404 after each new deploy. The active storage links are all still there without the images. I'm sure it's something obvious. Any ideas?
Thanks Chris, I have always heard of Postgres and this simple explanation of what it is, wow.
Strangely I had to use the external url
from the created db on render before my deploy was successful
Its likely because your DB and your rails app are each hosted in different regions - I found the same thing with only external url
working but when I deleted the DB to re-load and match the rails app region internal url
matched just fine.
Thanks for sharing this TeeJay! I was getting the error: ConnectionBad: could not translate host name " to address: Name or service not known
and using the external URL solved it. I think as Jonathon has said, its due to having two different regions
Why is your vendor directory so empty? Mine is choke full of all the gems (vendor/bundle/ruby/3.2.0/…) – it's a huge repo. Shouldn't we gitignore these dependencies in vendor? Should I stop using bundler (but with what do I replace it)?
Hell Chris, Not able to find the Build command option on render.com I think they might have changed it. any alternate way to add this code to render.com - "bundle install; bundle exec rake assets:precompile; bundle exec rake assets:clean; bundle exec rails db:migrate; bundle exec rails db:seed"
this is my error:
error: failed to solve: process "/bin/sh -c SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile" did not complete successfully: exit code: 1
error: exit status 1
Ok so I found the fix.. I just had to comment that line out in the docker file (# RUN SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile)
and then I had to make the following changes in the gemfile to debug and tzinfo-data:
gem "debug", platforms: %i[mri mingw x64_mingw]
gem "tzinfo-data", platforms: [:mingw, :x64_mingw]
The build command is different now, doesnt show that... and this is the only error I now get: E, [2024-05-25T23:53:59.255503 #36] ERROR -- : [fa66de2c-bd25-4aa4-bf3e-55b6e41d73b2]
[fa66de2c-bd25-4aa4-bf3e-55b6e41d73b2] ActionView::Template::Error (The asset "tailwind.css" is not present in the asset pipeline.
well just have to worry about this production crap later... thank yiou Chris for this great tutorial
As of writing this - on Aug 3rd 2024 - I did not have to add a platform to launch on render. In other words, I did not have to use this line
bundle lock --add-platform x86_64-linux