When Upgrading a Rails Application with a new Ruby Version Update Both of These

Today I struggled for a little bit while upgrading the Ruby version of my Rails 6.0 application.

First, I updated the Gemfile and solved a few errors which were caused by that. Unfortunately, I forgot to document these.

The final problem I was having was an inconvience. I change had to change my ruby version in my terminal each time I opened a new terminal tab like this:

rvm use 2.6.5

Setting this each time I changed directory was annoying. The way to ensure it’s set automatically was to change the Ruby version in the .env file.

If you can’t find it via terminal, type

ls -a

in the terminal when you have changed directory into your rails app.

Otherwise, you can find it in the file structure.

how to automatically set what ruby version your rails app uses

Have fun programming!

Motorcycle Trip Across Vietnam

This is the story of our motorcycle trip across Vietnam. If you’re reading this, we’re currently in the process of completing the journey.

INCOMPLETE - Last Updated Feb 5th, 2020

Buying a Motorcycle

We decided to rent a Honda Air Blade 110cc from Tigit Motorbikes in Ho Chi Minh City/Saigon. Here’s what the bike looks like with our gear loaded:

Honda Airblade - Motorcycle for Crossing Vietnam

Rent vs. Buy

Renting isn’t very expensive and it allows me to skip the whole buy and sell process. I’m getting soft… I know. I’m paying for this luxury…

$350 USD pays the rent for a Honda Air Blade 110cc was  for two months. I’m paying to not have $1,000 tied up in a motorcycle in Vietnam, I’m paying to not worry about selling my motorcycle in Hanoi and I’m paying to ride a nicer bike.

After contemplating the above points, I’ve decided renting is better for me.

Initially, I wanted to buy a cheap bike and drive it from Ho Chi Minh to Hanoi. I wanted to paint it and make a bunch of tweaks. I even has grand plans of welding together a pirate flag.

After the last few days, I feel happy I didn’t do all this bizarre stuff. It’s great to have a dependable bike which doesn’t stand out.

My Rough Buyers Guide

It appears that these are the best bikes to buy if you want to have lots of break down adventures on your ride across Vietnam:

Fake Honda Win Warning (India/China knockoffs of Honda Win)

Photo Credit: https://hiddenhoian.com/general/vietnam-motorbike-rental/

I wouldn’t ever go with one of these. They are broken down everywhere. I rarely see a Vietnamese person on a Win knockoff. While preparing for this journey, I watched a handful of videos produced by people who did the adventure on these kinds of motorcycles. They almost all feature multiple repair stations on their journey. They often sell them halfway through and get a scooter of some sort.

I don’t even think they save much money. The cost of repairs starts to build up.

If I were to buy a cheap bike and travel on my own, I’d get a Yamaha Hayate

Photo Credit: https://www.tigitmotorbikes.com/motorbikes-in-vietnam/

Hayates are inexpensive. I found multiple for sale for around $300 USD. They drive OK and are allegedly easy to repair if something breaks.

I drove one around Ho Chi Minh city. If I were going on my own, it would be fine. I’m responsible for a passenger so I wanted to get a bike which was built better.

Our Motorcycle Trip Across Vietnam

Day 1 – Ho Chi Minh City to Vung Tau

We start day one in the Tresor residence. Our first move was to go to Tigit so we could leave our bags with them. Tigit offers to ship your bags to Hanoi. They charge $15 USD a bag.

Algorithmic mapping companies will have you going the wrong way on this leg. Motorcycles are not allowed on the highways in Vietnam. It’s possible to go around the city in a long arc if you want to avoid the ferry… but the ferry is awesome. We had a great time taking the Cat Lai Ferry. It cost something insignificant and was super fast.

Here’s the video which tells the whole story:

Day 2 – Vung Tau to Dalat

Today we got a relatively late start. I think we left around noon. It would have been much better if we left early. In the late afternoon we got stuck on the QL20. The QL20 has a section which I’ve highlighted below:

vung tau to bao loc - across vietnam motorcycle trip

I would advise you to skip this part of the QL20. I call it hell road. It’s chatoic and dangerous. Driving this section requires constant vigilance.

If we had left earlier we could have bypassed a large chunk of this madness. There is a loop called Tà Lài which is supposed to be beautiful.

Day 3 – A Day in Bao Loc

Today I spent most of the day catching up on video edits.

V went to a waterfall type attraction with David, Denisa, Santiago and Vicky. I picked her up at the end of the day and we went to this far away spot I found on a topographic map. Here’s where it is:

bao loc far away spot motorcycle across vietnam

The waterfall attraction everyone went to was called the Dambri Waterfall.

Sometimes I wonder if I spend too much time editing these videos….

Day 4 – Bao Loc to Dalat

As we drove out of town, we had the opportunity to see some of the poorer neighborhoods of Vietnam. David attempted speaking Vietnamese with some  people on the roadside. He learned that they don’t speak Vietnamese. We don’t really know the name of their people, but they seemed to be living in a much poorer world than the people over the hill in Bao Loc.

We then crossed the valley between QL28 and QL27. On the uphill side of the valley, the coffee shrubs  surround the road. They have white flowers which look like snow from a distance. As we cruised up and down the uninhabited hills we were inundated in the smell of flowers. It was like driving through a tremendous flower shop .

We had lunch at a place serving Hanoi food. David had a difficult time speaking with the woman. She was more than 80 years old and from Hanoi. Apparently, Vietnamese is almost a completely different language in the North. David speaks the southern flavor of Vietnamese so we should expect his effectiveness as a translator to deteriorate as we travel further north.

None-the-less, lunch was fantastic. We split up to do the last leg to Dalat. David and Denisa went the southern route. V, Santi, Vicky and I went the northern route:

bao loc to dalat motorcycle trip across vietnam

It turns out that both ways are nice. We hadn’t booked anything in Dalat so we immediately started looking for a place. We found a cool hotel for about 500,000 VND ($21.54 USD) on the fly. There were many options, but the one we found was great so we booked it and stayed there.

We spent two days in Dalat. The high points are shared in the next video in this series.

Day 5 – Dalat to Nha Trang

We learned a lesson from previous rides. Today we awake around 6:30 a.m. to get on the road far earlier.

It was fairly cold when we left (~50F/10C). Driving out of Dalat is like driving down from the clouds and back to the Vietnam you would expect. The road winds beautifully and you get warmer and warmer with each turn.

The great coffee culture gets thinner and thinner as you get further and further from Dalat. We stop early to warm up and get fired up on baked bean juice.

Back in the lowlands, we stopped for a rest and to change back into reasonable clothing for the dry tropical hot weather.

We crossed a great agricultural area and found the coast. As we move up the coast we found a pretty awesome seafood joint in Thái An.

Dalat to Nha Trang motorcycle journey map

I wanted to do a bit of surfing at the north end of Cam Ranh beach, but the waves are small there. The wind is onshore and the rental shop doesn’t have a magnificent selection to choose from.

We had a booking via a popular vacation rental site in Nha Trang. It was rest time after that nine hour journey from the cold hills of Dalat to the sunny coast of Nha Trang.

Day 6 – Nha Trang to Qui Nhon

Coming soon….

Will be on the Road February 6th 2020.

Motorcycle Trip Across Vietnam Expense Report

This will be compiled upon completion.

Motorcycle Trip Across Vietnam Research References:

Useful articles for:

Deeply Understanding Active Record Associations the Ruby on Rails Way

The purpose of this blog post is to describe Ruby on Rails associations deeply.

Setting up the Practice Environment

First off, I’ll create a new application for practice. I do this on the desktop as it’s an easy place to work from:

rails new association_practice

Next step is to change directories so I’m on the root level of the new application.

cd association_practice

Next, I’ll create an association to practice with. I’m going to start with planet Earth. With Earth as a starting example, I can make associations with most Earthly things.

rails g model Planet name:string

This will generate files for the migration, model, tests and fixtures. I added two planets to the fixture file and a simple test. Which you can see in the following screenshot:

Now that we have the Planet object in our system, I’m going to add the next level of association, the Continent:

rails generate model Continent name:string

This command orders the Rails app to generate four more files. I’ve added to them a little and you can see the changes in the following screenshot:

Ruby on Rails Associations

The goal of this section will be to clearly explain how to use associations to organize your web application’s data.  The association documentation on the Ruby on Rails guides is a good start, but my descriptions below I hope will help deepen your understanding of associations and how to use them.

Understanding belongs_to and has_many Associations

Continents and Planets

Let us create our first association between the continents and the planets. Each continent can belong to a single planet, but a planet can have many continents. Here’s how we assemble it:

Next we migrate the database.

rails db:migrate

Next we load the fixture data.

rails db:fixtures:load

Awesome. Now we have our fixture data loaded and our associations should be set. Here is a screen shot of the actions we can now take in the rails console.

rails c

  1. Here we search the database for a planet with the name Earth. That gives us an array with the matching result in it. We use the .first method to pull the first object. We assign this object to the variable name earth.
  2. Here we use our earth variable to get the name string data which contains the name of the planet (“Earth”).
  3. Here we list the continents associated with earth.
  4. Here we set antarctica variable to equal the continent object of our first continent, Antarctica.
  5. Here we ask the database, “What planet is associated with Antarctica?” It returns us the earth planet object. Notice that the Planet earth object has the same id at the bottom as the Earth at the top.

Work in Progress

I’m thinking of better ways to describe associations. I plan to deep my understanding of the following associations in the future:

  • has_one Association
  • has_many :through Association
    • I’m thinking of describing this by using International Organizations
  • has_one :through Association
  • has_and_belongs_to_many Association
    • I’m thinking of describing this by using members of NATO
  • Choosing Between belongs_to and has_one
  • Choosing Between has_many :through and has_and_belongs_to_many
  • Polymorphic Associations
  • Self Joins

How to Become a Sea Plane Pilot with Fred Welsh

In this podcast Fred describes how he became a sea plane pilot. As the host, I know almost nothing about the subject. Therefore, we approach the subject from the perspective of a novice. I hope you find this useful if you’re seeking to become a recreational pilot. Enjoy!

fred and his sea plane

Fred Welsh is a friend I met in 2010 when I first visited Australia. On that trip he taught me to surf and showed me a great time in Yamba, Australia. He is awesome.

sea plane parked in the sea

SUBSCRIBE ON APPLE PODCASTS

How to Become a Sea Plane Pilot Time Stamps

  • 6:50 – History & Categorization of Recreational Pilots Licensing
  • 8:30 – Understanding the Cost and Process of a Recreational Pilots License
  • 15:10 – On the Economics of Purchasing an Airplane
  • 17:00 – The Benefits of a Sea Plane
  • 24:30 – Thoughts on Securing, Parking and Operating a Sea Plane
  • 28:30 – Sea Plane Endurance
  • 31:12 – Radio Communication Endorsement
  • 33:20 – Why Fly?
  • 40:00 – On Sea Plane Speed
  • 40:30 – Why a Sea Plane is Better than a Trailer/RV
  • 42:20 – Mapping out Sea Plane Adventures
  • 48:17 – Can You Do Work on Your Own Plane? – Maintaining a Sea Plane
  • 54:07 – Can Australia Sea Plane Pilots Fly Internationally?
  • 1:06:04 – Where You Inspired by Jimmy Buffett?
  • 1:16:40 – Lifestyle Questions – Weddings in Australia
  •  1:17:15 – The First Step to Becoming a Pilot

bobble head sea plane view

We call that tiger county. It’s when there isn’t anything down there to land on and you just hope nothing goes wrong

two sea planes at rest

It is a life or death situation. If you run into a huge storm, it can put you down hard. If in doubt, you stay home.

sea plane view of a whitsunday island

The pay-off for me is… I’ll say to my wife, “I think the whales are breaching today, let’s fly out and have a look.” You see sharks and dolphins… the rewards outweighs the costs of getting a license and a plane.

sea plane landing in the sea

When you’re flying long distances, you want to make sure you have plenty of room where you don’t have to get back for something.

two sea planes over the sea

Out of all of Australia, there are only 100 sea plane pilots. Of that, only 70 are operational. It’s a very, very small fraternity of pilots.

sea plane view of whitsunday islands in australia

The beauty of my category is that they have made the books more easy to understand for laymen. I found it enjoyable and not overly difficult. I found the process of learning to be exhilarating.

sea plane view of the gold coast

Related Links

sea plane view of the beautiful whitsunday islands

A Note on the Sound Quality Of This Podcast

I apologize for the poor sound quality on this one. Fred and I spoke while he was in Australia and I was in the United States. We suffered during the conversation because there was a second delay from us speaking to when the other would hear. Also, I failed to record split tracked. None-the-less, I think the conversation was interesting enough to publish despite the low quality.

I’ve sorted it out. Next episode will be better.

Episode One of the Question Mark Podcast

Welcome to ? a podcast about art, adventure, enterprise and more.

Subscribe on Apple Podcast

Episode art for question mark podcast one

This first episode is me my attempt at a unique podcast. Currently, I have three formats in mind:

1. Traditional Interviews

Traditional interviews will be around an hour where we learn about interesting people who have interesting behaviors. These interviews will focus on the subjects of art, adventure and enterprise.

2. The Linked Series

The idea for the linked story started on the Nomad Cruise while I was talking with my friend Becky. We parted ways in Dubai and she took one of my microphones. We did a podcast while she was in Chiang Mai and I was in Bangkok. Now that our conversation is complete, Becky will pass the microphone onto someone who she finds interesting.

The great thing about this is that the guest selection will be entirely up to Becky. Once Becky hands the microphone to someone else, that person will be the next person to be in charge of guest selection.

I hope they pick interesting guests.

3. ? Riffs

Question mark riffs are segments where I splice together a collection of interesting audio based on a theme. I’ll attempt to provide some context and commentary to link them together.

For instance, I hope to do one on investing in which I can pull audio from people like Ray Dalio, Warren Buffett and Mark Cuban. Other topics could include:

  • Surfing
  • International relations
  • Mountain climbing
  • Style
  • War
  • Country Reports

…or whatever else I become inspired by.

The following podcast is a rough example of how a ? riff would sound like:

Join the Conversation

I’d love to hear from you. Please feel free to click the image below and you’ll be able to record a voice message link for the show. I’d be honored to hear from you.

In my last podcast (the Love Affair Travel Podcast), I never heard back from the audience. That was a huge problem. My statistics were telling me that around 1,500 people were listening to each podcast episode, but I never heard from anyone. I think that is largely responsible for why I stopped creating them.

If you’d like to be part of the solution, please let me know who you are and where you are listening to the show. You can either email me an .mp3 file ([email protected]) or you can click the image below:

record a message for the podcast banner

Episode Credits