New Discussion

Notifications

You’re not receiving notifications from this thread.

Deploying our Rails Blog to Production Discussion

15
General

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

Had the exact same issue. Two different regions was the issue.

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)?

When would you recommend someone to use Render vs Hatchbox with something like Digital Ocean?

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

Awesome 😎

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

I had to update the docker file
Modify lines 14-17 to be like this

Install base packages

RUN apt-get update -qq && \
apt-get install --no-install-recommends -y curl libjemalloc2 libsqlite3-0 libvips libpq-dev && \
rm -rf /var/lib/apt/lists /var/cache/apt/archives

Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 88,834+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.