Accidental Technologist

Musings about Entrepreneurship, Technology and Software Development

  • Home
  • About
  • Still River Software
  • Privacy Policy

Powered by Genesis

11 Ruby on Rails Podcasts Worth Your Time

February 18, 2020 by Rob Bazinet Leave a Comment

Tweet

Ruby on Rails

There is great value in the Ruby on Rails podcasts and screencasts we have available today. Some podcasts have gone away while others have appeared, and others have changed hosts. The title is a bit deceiving, I’m including some screencasts too.

I wrote up a list of Rails learning resources last week, which included some screencasts. I list those here to keep the resource consistent for folks finding this in the future.

Podcasts

I have far too many podcasts in the Overcast app on my iPhone, but these always get listened to first.

Remote Ruby – three developers, chat about Ruby on Rails, what they’re up to, and the community at large. Occasional guests.

Ruby on Rails Podcast – this podcast has been around a long time and has seen a few hosts. Episodes consist mainly of interviews with people in the industry or who use Rails for their jobs. I do really like the guests and topics, many are the cutting edge of what we are being exposed to in work today.

Ruby Rogues – a long time show featuring a panel of known people from the Rails community who discuss various topics with guests. Episodes are mainly a single timely topic the panel and guest discuss. Approaching 500 episodes.

Rails with Jason – interview-style show with Jason Sweet. Jason has some great guests on his show. If you can listen to only one, I’d try this one. If you can’t get enough of Jason, he has written some great articles.

Maintainable – hosted by Robby Russell, long-time Rails developer and founder of Planet Argon, a Rails development agency. From the Maintainable site:

On Maintainable, we speak with seasoned practitioners who have worked past the problems often associated with technical debt and legacy code. In each episode, our guests will share stories and outline tangible, real-world approaches to software challenges

Running in Production – a podcast about how folks are running various frameworks in a production environment and what it takes to do so. Not strictly talking about Rails, but there are a handful of episodes specifically dealing with challenges of running Rails in production.

The Bike Shed – discussion podcast, with two people from Thoughtbot. Much of the discussion encompasses issues the hosts face while working at the company. The episodes aren’t strictly Rails but cover topics many of us face in our day-to-day development work.

Screencasts

Drifting Ruby – created by Dave Kimura, also a long-time Rails developer. Dave is currently up to 227 episodes with episodes running from ~10 min to ~30 min. You might think these screencasts are probably like those from Go Rails, hardly. I think they complement each other very well. Even for topics, they are the same. I find the approaches very different. There are also free episodes, while others require a small monthly fee.

Go Rails – created by Chris Oliver, who is a great contributor to the community. At the time of this writing, Chris is up to 330 videos of varying lengths (~5 min to ~30 min) covering a full breadth of topics, including everything from Rails concepts to the inevitable problem you’ll face when creating Rails applications. There is also a forum that accompanies the videos were you can ask questions or answer some if you so choose. There are some free videos and a Pro plan you can pay to get the rest of the videos for a reasonable monthly fee. It’s a bargain for sure.

RubyTapas – created by Avdi Grimm, a long-time member of the Ruby community. From the RubyTapas website:

RubyTapas is for the busy Ruby or Rails developer who is ready to reach the next level of code mastery. Short, focused screencasts twice a week will introduce you to a wide variety of intermediate to advanced Ruby concepts and techniques, Object-Oriented design principles, testing practices, refactoring skills, and much more.

RailsCasts – created by Ryan Bates, these short screencasts were the original for the Ruby community focusing on Ruby on Rails. Ryan stepped away from making these a while ago, but many are still relevant today and free.

There’s so much great content in these resources. Whether you like to listen to podcasts or prefer to watch people code in a screencast, there’s plenty to learn. If you find other Ruby and Rails related podcasts, I’d love to know about them.

Share this:

  • LinkedIn
  • Twitter
  • Facebook
  • Email
  • More
  • Pinterest
  • Tumblr
  • Pocket
  • Reddit

Filed Under: Ruby on Rails Tagged With: podcast, Ruby on Rails

10 Ruby on Rails Learning Resources for 2020

February 6, 2020 by Rob Bazinet Leave a Comment

Tweet

Even though Ruby on Rails has been around since 2004 as an open source project, I still get asked the best ways to learn the framework today.

It’s a fair question and answers do change as the Ruby on Rails landscape has evolved.

Beginner Level

You have little to no Ruby on Rails knowledge and are looking for resources to get you started out right.

  1. The Ruby on Rails Tutorial by Michael Hartl – now in it’s 6th edition and keeping up with Rails 6. This book and video options (20 hours) help many Rails developers get started. It’s written my Michael Hartl and comes in at 883 pages. It is a well-written tutorial.
  2. Ruby on Rails Guides – when talking about getting information from the source, this is the one to use. Each section contains the documentation on all the major parts of the Ruby on Rails framework broken up by function. A nice feature is users can select the version they are using, starting with the latest as of this writing, 6.0.2.1 all the way back to 2.3.
  3. Agile Web Development with Rails 6 – the Rails 6 version of the book which has gotten many Rails developers started, including myself. The Pragmatic Bookshelf offers a version back to Rails 4 so make sure you reference the correct version. This version will help with coming up to speed on the new Action Mailbox and Action Text. It offers source code for the project, which is a nice eCommerce application with practical value.
  4. Agile Web Development with Rails 5.1 – this version of the book is, you guessed it, targeting Rails 5.1. It contains the latest updates for 5.1 and offers source code for the project, which is a nice eCommerce application with practical value.

Intermediate Level

You’ve built a couple applications, know the beginner material and have a couple years of Rails experience. You are ready to move on to hone your skills.

One of the-best ways to learn, for me and I’m sure others, is by watching screencasts. The next two resources are they best out there.

  1. Go Rails Screencasts – created by Chris Oliver who is a great contributor to the community. At the time of this writing Chris is up to 330 videos of varying length (~5 min to ~30 min) covering a wide breath of topics, including everything from Rails concepts to the inevitable problem you’ll face when creating Rails applications. There is also a forum that accompanies the videos were you can ask questions or answer some if you so choose. There are some free videos and a Pro plan you can pay for to get the rest of the videos for a reasonable monthly fee. It’s a bargain for sure.
  2. Drifting Ruby Screencasts – created by Dave Kimura, also a long-time Rails developer. Dave is currently up to 227 episodes with episodes running from ~10 min to ~30 min. You might think these screencasts are probably like those from Go Rails, hardly. I think they complement each other very well. Even for topics they are the same, I find the approaches very different. There are also free episodes and others are paid for with a small monthly fee.
  3. Modern Front-End Development for Rails – when moving to recent versions of Rails, 5.1+, you have exposure to technologies such as JavaScript with the required tooling. This book takes you there and helps clear up some of the confusion that will certainly arise.

Advanced Level

You feel good about your Ruby on Rails skills and want to press on to even more advanced topics.

  1. Metaprogramming Ruby 2 – if you aren’t sure what metaprogramming is, it’s worth learning about and use it where it makes sense. It’s a technique that’s used in Rails and other Ruby frameworks and applications. It’s powerful. This book is the best resource I’ve found on the subject from just learning it to becoming proficient.
  2. Rails 5 Test Prescriptions – the Rails community is all about Test-Driven Development (TDD) and this book gives great coverage of the subject. It covers RSpec and mintiest. RSpec is probably the most popular testing tool for Rails. Mintiest is the default testing framework.
  3. Docker for Rails Developers – unless you’re living under a rock you have at least heard of Docker. This book is the only source I am aware of that directly helps Rails developers containerize their application. It is a great single source.

If you’re just starting out, a seasoned expert or somewhere in between. I think these are some of the best sources of guidance and knowledge available for our beloved Ruby on Rails.

If you think I forgot something, please leave a comment and let me know.

Share this:

  • LinkedIn
  • Twitter
  • Facebook
  • Email
  • More
  • Pinterest
  • Tumblr
  • Pocket
  • Reddit

Filed Under: Ruby on Rails Tagged With: Ruby on Rails

When You Can’t Check a Checkbox using Capybara

December 5, 2018 by Rob Bazinet Leave a Comment

Tweet

In my last post I documented an issue I was having using Capybara on a client’s Ruby on Rails application with a ReactJS frontend.  I wanted to share another issue I came  across during my feature testing escapades.

The Problem

During my recent feature testing project I had a form which has a checkbox on it. The checkbox had a label with it. Did I mention this is a ReactJS frontend? I’m not sure if this is specific to ReactJS, but I suspect it isn’t. I think other frontend JavaScript frameworks may exhibit the same problem.

The Ruby code for my feature test is dead simple:

check “English”

That’s it. The test should run and when it finds the checkbox with a label of English, the checkbox should be checked. But, it doesn’t work. After many attempts at making this work and more Google searches than I can remember..I ended up at the Capybara mailing list.

The Solution

Thomas Walpole was kind enough to reply with his thoughts on the matter:

99.9% sure your checkbox isn’t actually visible on the screen.

What you’re describing as the “checkbox” is probably an image (probably added via CSS pseudo elements) being shown in place of the actual checkbox input element to ensure the same styling across different browsers.  If the checkbox has a label element correctly attached to it you can use `check(‘whatever’, allow_label_click: true)` – https://www.rubydoc.info/ github/jnicklas/capybara/ Capybara/Node/Actions#check- instance_method –  to tell Capybara to click the label element instead of the hidden checkbox input to toggle state.  If you don’t have an associated label then you’ll need to find whatever element is actually visible on the page and click it instead.

Changing my test to include this for the checkbox, worked perfectly.

check(“English", allow_label_click: true)

I hope someone finds this valuable and will save them some time and hair pulling.

Share this:

  • LinkedIn
  • Twitter
  • Facebook
  • Email
  • More
  • Pinterest
  • Tumblr
  • Pocket
  • Reddit

Filed Under: Ruby on Rails Tagged With: capybara, rspec, Ruby on Rails, tests

Fixing StaleElementReferenceError When Using Capybara

December 4, 2018 by Rob Bazinet Leave a Comment

Tweet

I’ve been spending an extended period of time lately writing Feature specs for a Ruby on Rails project using Capybara. Overall it’s been a fun project to work on but I had run into a few issues along the way. One in particular is the StaleElementReferenceError exception that get thrown when you are trying to find an element on your page that you know is there but Selenium can no longer find.

The error appears to be a timing issue between the page loaded in the browser, it being rendered and Capybara and Selenium trying to find the element. After much trial and error, along with many Google searches, I found no solutions that were reasonable. Even though many people had the same problem.

The solution was pretty simple actually. I added a rescue to my test and simply slept for 1 second and retry the failure. I admit, this seems like a hack but it works and that’s all I really cared about at the time. I see no ill effects from this, no measurable delay.

RSpec.feature "Listings", type: :feature, js: true do
  scenario "can edit common area - step 3" do
    begin
      post_a_space_step_1_with
      click_on 'Next'
      post_a_space_step_2_with
      click_on 'Next'
      click_on 'Edit Common Area'
      expect(page).to have_content "Step 1"
    rescue Selenium::WebDriver::Error::StaleElementReferenceError
      sleep 1
      retry
    end
  end
end

I’m certainly open to a better solution or an explanation as to why this might be bad. Please leave comments. Hopefully I help someone get around this really annoying problem.

Share this:

  • LinkedIn
  • Twitter
  • Facebook
  • Email
  • More
  • Pinterest
  • Tumblr
  • Pocket
  • Reddit

Filed Under: Ruby on Rails Tagged With: capybara, Ruby on Rails, selenium

Ruby on Rails Testing Resources

November 14, 2018 by Rob Bazinet Leave a Comment

Tweet

When taking the plunge into Ruby on Rails it’s really easy to get carried away with learning all about the framework. It’s easy to learn the fundamentals and later realize the Rails community is a community of testers. It’s a strange world when you set out to learn about testing, TDD (test-driven development), BDD (behavior-driven development) and other acronyms and phrases relating to testing Ruby on Rails applications.

I decided to put together a short list of helpful resources to get started. If you have suggestions that would be useful to be added to this list, please add a comment or email me directly and I’ll update this post.

Books

  • Everyday Rails Testing with RSpec – this is a great, hands-on, roll-up your sleeves and get-to-work book. If you want to use RSpec on a daily basis, this book gives great advice on how to use RSpec in your day-to-day routine. It’s kept up-to-date with latest RSpec too.
  • Rails 5 Test Prescriptions – I use this book as a reference I often go to. It’s been updated to from previous versions to now Rails 5 and is a great tool to have on the shelf.
  • Effective Testing with RSpec 3 – if you decide you’d rather start without worrying about all the details around Rails you can start with learning RSpec with plain Ruby and help yourself. I’ve been through this one cover-to-cover and it’s a great tutorial.
  • The Minitest Cookbook – if you decide RSpec isn’t for you, this is probably the ultimate resource for Minitest. Well-written and kept up-to-date.

Podcasts

You can’t really learn testing from a podcast but you can learn how others approach the craft. The first is a podcast dedicated to testing Ruby applications. The rest is a list of a few episodes of podcasts that discussed testing.

  • The Ruby Testing Podcast
  • Ruby Rogues 385: “Ruby/Rails Testing” with Jason Swett
  • Ruby Rogues 269 Testing
  • Full Stack Radio 46: Joe Ferris – Test Driven Rails

I’ve been listening to The Ruby Testing Podcast and picked up some nice tidbits so far.

Training

I love Pluralsight.

  • RSpec the Right Way
  • Test-driven Rails with RSpec, Capybara, and Cucumber

Xavier Shay has long been involved in the Ruby community and well-known for discussions around testing. One of his best blog posts explains his approach to testing.

  • Testing Ruby Applications with RSpec

I’ve taken several courses on Udemy and they are one of my favorite places for training. The prices are low and there are many courses, so you have to do a bit of work to see which course is right for you but well worth the effort.

  • The Complete TDD Course: Master Ruby Development with RSpec
  • Ruby on Rails 5 – BDD, RSpec and Capybara

Share this:

  • LinkedIn
  • Twitter
  • Facebook
  • Email
  • More
  • Pinterest
  • Tumblr
  • Pocket
  • Reddit

Filed Under: Ruby on Rails Tagged With: bdd, minitest, rspec, Ruby on Rails, tdd, unit testing

Ruby on Rails – Supporting SSL for PostgreSQL on Heroku

February 5, 2018 by Rob Bazinet Leave a Comment

Tweet

For anyone who received this notice from Heroku:

Since 2016, all newly-provisioned Heroku Postgres databases have enforced the use of SSL to keep your data safe. However, one or more of your Postgres databases are running on legacy infrastructure, which does not enforce the use of SSL. In order to update your database to our security standards, and in response to potential impacts caused by Spectre and Meltdown, all databases – including those on legacy infrastructure – will be moved to our new Heroku PGX plans in a set of maintenances starting in March 2018 and concluding by April 2018.

What Do I Need to Do
In preparation for these maintenances, please check that your applications are using SSL to connect to your Postgres database and enable SSL connections if needed. Instructions on how to perform these steps are available in Dev Center.

If you’re using Rails 4.1+ there is a support article on the Heroku Dev Center, that helps clarify making updates to our database.yml file. This allows customizing some connection behavior to PostgreSQL.

Some parts of the database.yml file that cannot be changed include:

You cannot use the config/database.yml to set any values found in ENV[‘DATABASE_URL’]. This is a list of attributes you cannot change:

  • adapter
  • database
  • username
  • password
  • host
  • port

But, what can be changed include sslmode.

production:
 sslmode: require (disable|allow|prefer|require)
 pool: 15

I decided it would be helpful to reach out to Heroku to understand their guidance with regard to their notice. Their response:

If you’re using the pg gem, the default sslmode setting (and for libpq, the library that underpins it), is prefer this means that should the server have SSL support, it will be used when the connection is established. This means there should be no action required, though if you wish, it’s worth a test with spinning up a staging environment with a non-legacy Postgres instance.

It seems if you’re using Ruby on Rails with the pg gem, you should be OK doing nothing but with brownout period scheduled, it’s probably a good idea to test during one of those times.

Heroku Support also indicated setting the environment variable PGSSLMODE would also override the default behavior for sslmode used by libpq.

It seems this is a notice which doesn’t effect a majority of Heroku customers and is a necessary and worthwhile upgrade. Hopefully this helps others as the public information available for this from Heroku is minimal.

Share this:

  • LinkedIn
  • Twitter
  • Facebook
  • Email
  • More
  • Pinterest
  • Tumblr
  • Pocket
  • Reddit

Filed Under: Ruby on Rails Tagged With: heroku, postgresql, Ruby on Rails

Fixing Your Puma-dev SSL Problems on Google Chrome

February 2, 2018 by Rob Bazinet Leave a Comment

Tweet

Ruby on Rails developers have it made in many ways. We rely on and take advantage of great software created by the community. Puma-dev is just one of those great pieces of software.

Puma-dev has some nice improvements over Pow, which Basecamp had promoted for years but has seemed to stop development.

Puma-dev allows developers to better mirror their local development environment to that of production. Prior to Puma-dev or Pow, developer would have to access their Ruby on Rails applications with something like localhost:3000 in their browsers. It works but having a real URL to visit, like mygreatapp.dev is better.

This worked well until a recent update to Google’s Chrome browser:

A lot of (web) developers use a local.dev TLD for their own development. Either by adding records to their/etc/hosts file or by using a system like Laravel Valet, which runs a dnsmasq service on your system to translate *.dev to 127.0.0.1.

In those cases, if you browse to http://site.dev, you’ll be redirect to https://site.dev, the HTTPS variant.

That means your local development machine needs to;

  • Be able to serve HTTPs
  • Have self-signed certificates in place to handle that
  • Have that self-signed certificate added to your local trust store (you can’t dismiss self-signed certificates with HSTS, they need to be ‘trusted’ by your computer)

I’ve faced this myself and Chrome refuses to serve the site, only showing security errors.

When trying to fix this problem I search a lot around the web and came up with very little. There were plenty of acknowledgements that since .dev is now a top-level domain (TLD) and Chrome 63 treats it as such and forces SSL, it looked like moving away from .dev would be needed.

This was my assumption until I discovered a recent post from Barry Woolgar of Storm demonstrating setting up Puma-dev. He addresses troubleshooting .dev TLD issues specifically:

If your browser complains about an untrusted root certificate, please do the following:

  1. Open Keychain Access
  2. Click the login keychain in the left pane, then find the Puma-dev CA certificate in the right pane
  3. Double-click it and expand the Trust section, and make sure it says Always Trust
  4. Drag it into the System keychain in the left pane
  5. Restart your computer
  6. Try https://my-project.dev again!

Although I didn’t need to restart my Mac, this worked perfectly! I can now serve .dev domains in Chrome and latest Firefox.

Share this:

  • LinkedIn
  • Twitter
  • Facebook
  • Email
  • More
  • Pinterest
  • Tumblr
  • Pocket
  • Reddit

Filed Under: Ruby on Rails Tagged With: Chrome, Firefox, Puma-dev, Ruby on Rails

Introducing Rails Rescues

December 8, 2014 by Rob Bazinet Leave a Comment

Tweet

RR01

Today I?m happy to introduce Rails Rescues.

Rails Rescues?is?a service representing years of Ruby on Rails experience organized to help companies who have a Rails application but may be having some problems.

Rails Rescues aren?t limited to a fixed set of services but can include:

  • Scaling your website
  • Resolving site stability problems
  • Upgrading from an old version of Rails to current versions
  • Fixing Broken Code
  • Simplifying an out-of-control code base.
  • Finishing up after your contractor or employee left the project.
  • ?.we?ll fix anything holding you back from a successful Rails web site.

I?m happy to offer a $500 finders fee for any referral sent that results in a sign Rails Rescues contract. ?Please spread the word and visit the site. I will make myself available via live chat to answer any questions.

 

 

Share this:

  • LinkedIn
  • Twitter
  • Facebook
  • Email
  • More
  • Pinterest
  • Tumblr
  • Pocket
  • Reddit

Filed Under: Ruby on Rails Tagged With: rails, Ruby on Rails

Speeding up Heroku Deploys

February 6, 2014 by Rob Bazinet Leave a Comment

Tweet

Anyone who deploys their Rails 3.x or 4.x utilizing the asset pipeline and doesn?t precompile those assets yet deploys to Heroku, knows it can take a really long time for your deployment.

I searched around a bit and found a great article on how to shave some time off my Heroku deployments. ?Alex MacCaw has a nice write up about the process:

If you?re using Heroku, the first step is enabling a Memcache addon. I?ve gone with the?memcachier?service, as they?ve got a generous free plan (which is all we need at this stage).

heroku addons:add memcachier:dev

Then we need to make sure the environmental variables are available to your app during the pre-compilation stage. Usually this isn?t the case on Heroku, but they?ve got a new labs feature called?user-env-compile?which will do the trick.

heroku labs:enable user-env-compile

Next you?ll need to add the?dalli?and?memcachier?gems to your Gemfile. Finally, the last step is to configure Sprockets.

Since I am using Rails:

With Rails

With Rails, just configure the assets cache store inconfig/environments/production.rb.

config.assets.cache_store =:dalli_store

And the time savings would be?.

?An example of time saving with a relatively small project:

Not using the speed-up method, deploy time:?2 minutes 40 seconds

Using the above method:?47 seconds

It is definitely worth the little effort.

Share this:

  • LinkedIn
  • Twitter
  • Facebook
  • Email
  • More
  • Pinterest
  • Tumblr
  • Pocket
  • Reddit

Filed Under: Ruby on Rails Tagged With: deployment, heroku, Ruby on Rails

Errors Installing the pg Gem When Using Heroku Postgres.app

December 19, 2013 by Rob Bazinet Leave a Comment

Tweet

I?ve been using the PostgreSQL Mac OS X app from Mattt Thompson and Heroku for quite some time now. ?If you don?t know what it is, it?s a drop in app bundle for the PostgreSQL database. ?There are many ways that work, this just happens to be really simple.

I use PostgreSQL with my Ruby on Rails projects and combine that with the pg ruby gem. ?

I ran into a situation where the pg gem would not install because it could not find pg_config in a known location on my Mac. ?The error occurred on Rails 3.2 but 4.0 may show the same behavior. ?

The Error

The error can come up when running a bundle install or just a straight gem install pg from the command line. The resulting error may look something like this:

Installing pg (0.17.0) with native extensions 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension
.
.
.
.
An error occurred while installing pg (0.17.0), and Bundler cannot continue.
Make sure that `gem install pg -v ?0.17.0'` succeeds before bundling.

The Solution

I already mentioned the problem is the gem install not finding pg_config during installation. ?So let?s find it.

1. First, find where pg_config is located. ?Run this command from a terminal window:
which pg_config

Should display something like this:

/Applications/Postgres.app/Contents/MacOS/bin/pg_config

2. You can tell RubyGems where your pg_config file is located:

gem install pg -- --with-pg-config='PATH_TO_YOUR_PG_CONFIG'

For example, pg_config is here on my system:

/Applications/Postgres.app/Contents/MacOS/bin/pg_config

So I would install the gem this way:

gem install pg -- --with-pg-config='/Applications/Postgres.app/Contents/MacOS/bin/pg_config'

The pg gem should now install. I hope this helps.

UPDATE: Scott Watermasysk points out another good solution:

@rbazinet another route that worked for me was to put the pg.app (as a folder) in my path. This allows the config to be properly found.

? Scott Watermasysk (@scottw) December 19, 2013

Share this:

  • LinkedIn
  • Twitter
  • Facebook
  • Email
  • More
  • Pinterest
  • Tumblr
  • Pocket
  • Reddit

Filed Under: Ruby on Rails Tagged With: postgresapp, postgresql, Ruby, Ruby on Rails, rubygem

Next Page »

Recent Posts

  • Status Bar in iTerm2
  • Supporting Multiple SSH Keys on macOS
  • Using the Microsoft Ergonomic Keyboard on macOS
  • 10 Steps to Survive Working from Home
  • “Are you building a business or learning a stack?”

Categories

Services I Love

HatchBox - Easy Rails Deploys Fathom Analytics
Follow @rbazinet

Rob Bazinet
@rbazinet

  • If anyone is looking for a seasoned .NET, C# and https://t.co/q7WzxhZnCZ developer, a good friend of mine has some… https://t.co/5DqXtCzySr
    about 1 week ago
  • Slack is down…2021 is looking up already.
    about 2 weeks ago
  • Subscribe to Locally Sourced by Noel Rappin by @noelrap https://t.co/yZnXfg2tU5
    about 4 weeks ago
  • So true! https://t.co/6axDZAHASZ
    about 4 weeks ago
  • With all the talk about StimulusReflex in the Rails community lately, this is perfect timing. Definitely something… https://t.co/w6Y4c8QVNN
    about 1 month ago
  • RSS - Posts
  • RSS - Comments
loading Cancel
Post was not sent - check your email addresses!
Email check failed, please try again
Sorry, your blog cannot share posts by email.