Ted Martin


2,680 Experience
18 Lessons Completed
1 Question Solved


Posted in Using Docker with Rails on M1 Mac

I have an M1 Mac and I always get errors for either sprocket-rails or nokogiri. I am using Ruby 3 and Rails 7. Is anyone using Docker with an M1 Mac and Ruby 3/Rails 7 with success? If so, could you share a Dockerfile and docker-compose.yml?

Thank you!

Posted in How to use Google Maps and Markers Discussion

How do you add <script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap" async defer></script> from the Maps JavaScript API documentation in Rails 6 with Webpacker? Adding the above in my doesn't seem to do the trick.

Posted in Active Storage and Subdomains

Well I feel dumb. I didn't have Image Magick - sudo apt install imagemagick - on the server; once that was installed, all was good. Perhaps adding a mention of that in your tutorial on deploying to Ubuntu 18.04. Thank you for all your work on this site; I've learned a ton and $19 a month is a steal for the value you offer. Thanks!

Posted in Active Storage and Subdomains

I have a simple app for photos and wanted to make it a subdomain of a domain I own and use. It would be https://photos.com This seems to break active storage however. Has anyone else ran into a similar issue in the past with active storage and subdomains?


Posted in Scheduling Posts Discussion

Hi Chris,

Since Rails 6, to the best of my knowledge, no longer supports CoffeeScript, do you have a suggestion for using this with Webpack for those who aren't familiar with Coffee Script?

Posted in Deploy Ubuntu 18.04 Bionic Beaver Discussion

I keep getting the following error when I am making changes:

[2019-06-29T14:18:13.234079 #2060] DEBUG -- :   ^[[1m^[[36mActiveRecord::InternalMetadata Load (0.2ms)^[[0m  ^[[1m^[[34mSELECT `ar_internal_metadata`.* FROM `ar_internal_metad
ata` WHERE `ar_internal_metadata`.`key` = 'environment' LIMIT 1^[[0m
D, [2019-06-29T14:18:13.237139 #2060] DEBUG -- :   ^[[1m^[[35m (0.1ms)^[[0m  ^[[1m^[[34mSELECT RELEASE_LOCK('3070706570978732700')^[[0m

Everything will deploy fine and the app will work well but when I create datamigrations, this error pops up. I'm using MySQL on both development and production. I can't find anything on Stackoverflow/Google Searches that has helped so I'm hoping someone here has experience in this matter.

I've figured out the issue with the returning of nil. I hadn't added the Google Map API.

For some reason the geocode method is returning 'nil' on my record. I have checked my code against the source code and can't seem to figure this out.

Has anyone else experienced a similar issue?

Fantastic video!

I am having no difficulties with my local setup and getting this to work. However, I am getting errors on my Heroku app on production. I watched the tutorial on Encrypted Credentials which was fantastic but unfortunately it didn't solve my issue. My storage.yml file looks like the following:

  service: S3
  access_key_id: <%= Rails.application.credentials.dig(:digitalocean, :access_key_id) %>
  secret_access_key: <%= Rails.application.credentials.dig(:digitalocean, :secret_access_key) %>
  bucket: ted-blog
  region: nyc3
  endpoint: <%= Rails.application.credentials.dig(:digitalocean, :endpoint_address) %>

    If anyone has an insight into what might be the problem, I'd be grateful.


Posted in Setup MacOS 10.14 Mojave Discussion

Is anyone else receiving errors with MacOS 10.14 Mojave and the Mysql2 gem? I'm also getting a "Library not loaded: libssl.1.0.0.dylib (LoadError)" error when executing "rails server".


Posted in Exporting Records To CSV Discussion

This is a great episode, thanks! I am able to do all of this on the index action in the controller I am using to export a csv but when I try to do this on an action which I have called 'annual' I am getting a 404 error as it is trying to run the .to_csv on the #show controller... The action is

def annual
@year = params[:date][:year]
@surveys = Survey.where("year = ?", @year)

respond_to do |format|
format.html # index.html.erb
format.json { render json: @surveys }
format.csv { send_data @surveys.to_csv, filename: "survey-annual-#{Date.today}.csv"}

I'm at a loss...