Rails New Command Throws SSL_connect error

I just downloaded a fresh install of Ruby on Rails for Windows and when do a rails new projectName, I get an SSL_connect error! How do fix this?

Here’s the specific error that you will get:

Gem::RemoteFetcher::FetchError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://rubygems.org/gems/rake-10.4.2.gem)
An error occurred while installing rake (10.4.2), and Bundler cannot continue.
Make sure that `gem install rake -v ‘10.4.2’` succeeds before bundling.

After doing a big of Googling, I found this site that had a working solution. You can read the details there or just get this file, and put it in the folder:

C:\RailsInstaller\Ruby2.0.0\lib\ruby\2.0.0\rubygems\ssl_certs

Or similar location, and try again.

Hot Reloading in React

Can I debug / write a React application in real-time without having to reload the application every time I make a code change and losing my development state?

Yes.

Design Inspiration

Where’s a good place to get inspiration for mobile and web design components?

https://dribbble.com/

You can see and play with tons of ideas from around the world from everything having to do with graphics to controls to websites . . . and you can interact with the designers . . . and even hire them!

Pretty cool site!

Resetting Bluetooth on a Mac

I just turned on my Mac and now my bluetooth keyboard and magic pad won’t sync.

Sometimes, when I bring my laptop back in after taking it home from work at night, my wireless keyboard and magic pad won’t sync. Instead of rebooting my computer, I just unload the bluetooth in a terminal session.

sudo kextunload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport

and then

sudo kextload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport

to load it back again.

?? Operator

If you use nullable types in C# (e.g., int?, double?, boolean?, etc.) you may be interested to know that C# has a special operator for handling what to do if a value is null. It is called the null-coalescing operator. It works like this . . .

int? x = null;
int y = x ?? -1;

If x is null, then the value on the right side of the ?? will be used; otherwise, it will use the value of x to assign to y in the example above.

So, you don’t need to do things like this anymore . . .

int y = (x == null) ? x : -1;

Neat huh?