gem native extensions, ansicon, and auto-run

If you get this error:

“Failed to build gem native extension”

And you’ve installed AnsiCon and initialize it in the startup folder, you will encounter the above error.

The fix is explained here, scroll down to “ERROR: Failed to build gem native extension”

It took me a couple hours over the last few days to figure this out, mainly because that page never came up when I googled for the error, instead, I got a dozen stackoverflow hits.  I’ll have to remember to exclude stackoverflow if what I’m finding there is not useful.  It seems to be taking over!

Marc

Authentication in Ruby on Rails

There are dozens of articles for Ruby on Rails on how to roll your own authentication system or use an authentication gem.  Why did I write one?  Because none of them are comprehensive in their coverage.

In my article User Authentication in Ruby on Rails, I discuss:

  • how to write a Rails application with RubyMine, the IDE
  • how to create migrations and inspect your data in PostgreSQL
  • how to add “remember me” and reCAPTCHA features
  • how to add email notifications for new users and users that forget their password
  • how to use the authentication system in the applet itself

and I cover some basics about Ruby on Rails development:

  • Gems
  • Site Environment Variables
  • Database Migrations
  • HTML metadata
  • Controllers, Models, and Views
  • Application Layouts
  • CSS
  • Cookies

If you’re new to Ruby on Rails, this article will help you get started with all the tools, technologies and concepts that you typically need to touch when developing websites with Rails.

And even then, there are large pieces I’ve left out: testing, FireBug, etc., so keep a look out for further installments.

Marc

Windows 8 == Fail

A friend of mine recently purchased a laptop with Windows 8, and to preface this, I want to point out that she is well versed with Windows 7. She was trying to figure out how to get some basic things working and solicited my help.

As an introduction, when we booted the laptop, it comes up with lovely full screen image of a road meandering off into the mountains (beware, there be dragons!) and a clock and date. Now what? Oh, click the mouse button to get the login screen. OK, so now W8 has added an extra click just to get started.

The first thing I noticed was that of all the colorful squares to click on from the W8 start screen, she only used two: email and Internet Explorer. All the other squares, Netflix, games, video stuff, social networking stuff, even I couldn’t identify what most of them were, elicited a “what is all this junk?” response.

She uses Yahoo email (yeah, I know), and there’s this “integrated” Yahoo email reader that W8 provides. Her first question was, “where are all my emails?” The emails that were showing up were only a week or two old, nothing else. Now, this isn’t necessarily a W8 issue, but I had no idea why (we discovered the answer later.)

Her next question was, “how do I print an email?” Again, I was totally lost because I don’t use W8, there is no menu bar, and after accidentally moving the mouse to one of the corners of the screen, the popup, I guess they’re called “gems” didn’t refer to anything having to do with printing.

At that point, I was also curious how one searches for emails. One of the “gems” was a magnifying glass which I clicked on and it dutifully came up with a search textbox. I entered some text that I know matched some text in an email, but nothing happened.

At this point, we were both frustrated and she asked where she can get some training, as obviously I knew nothing about W8 (and have no desire to learn after these experiences.) Googling for W8 help, an ad came up for the local Microsoft Store – wow, a useful Google ad! So off we went to the Microsoft Store.

Now, you should know that even though I am immersed in Microsoft technology, I loathe walking into these stores. But we trundled off to the shopping plaza, laptop in hand and found the Microsoft store, right next to the Apple store. Lots of glitter, shiny toys, and robots walking around in blue shirts with small plastic, white, rectangles with the Microsoft logo attached to lanyards hanging from their necks. Oh wait, these aren’t Microsoft robots, they’re people!

We went up to desk where I explained that my friend was having trouble getting a few things working. Well, what do you know? For $200 you can get a year “subscription” to three, one-hour private sessions! Really. However, she was also kind enough to offer that someone could sit down with my friend to answer a few questions, for free.

So, first, “where are my emails?” After a couple minutes of fussing around, the nice fellow found out that there’s this configuration option (I have no idea how he got there) to change Yahoo’s email from “2 weeks” to, if I recall correctly, “every day” (how’s that for intuitive for “all my emails”) and lo-and-behold, it began syncing and retrieving all her emails.
As to the “how do I search emails?” this fellow tried the same thing I had, and after a few minutes of fussing around, declared that the integrated Yahoo mail program was very limited, didn’t offer the ability to search emails, and she should buy Outlook. Really. The web-based Yahoo email has more features!

As to the “how do I print an email?” he showed us that, once a printer is connected, you mouse over to the right corner, then mouse over to “devices” and then select the printer. Really? That’s incredibly intuitive.

Lastly, among the dozens of useless squares littering the start screen, I asked the fellow, where’s a basic word processor. What does he do? He switches into the “old” W7 desktop mode and brings up WordPad. I have no problems with WordPad, but really, switching to the W7 desktop mode? The start screen is literally littered with useless shiny squares, and a basic word processing app isn’t one of them. So I ask him, how can I put that on the start screen? A couple minutes go by before he figures out how to pin the app to the start screen.

Finally, just as we were about to leave the store, I noticed that the laptop had gone into “updating Windows, do not turn off your computer” state. Argh. It took another 10 minutes, trapped in the belly of the beast, before the OS completed its updates. During that time, I wandered around checking out the shiny toys. They have these plastic flat keyboards you can attach to pads and other devices. I tried typing on one of them. “Tried” being the operative word, as the visual feedback is delayed about half a second and by the time you notice the keyboard didn’t register a keypress, I was ten keystrokes ahead, which took another second or so to show up on the screen. Utter junk. But I digress…

So we trundle back home, plug in the printer, and I go through the “mouse to the corner”, “mouse to devices”, “click on printer”, and what do you know, there’s the email document previewed and ready to print. At least that worked.
So, I hand the computer over to my friend and have her try a few things. She tries to print an email, and the first thing I discover is that it takes a significant amount dexterity required to bring up the sidebar of “gems” (or whatever they are called.) I tell my friend, move the mouse to the corner of the screen. She does so, but leaves the mouse where the whole pointer can still be seen. No, I say, shove it all the way into the corner until it disappears. She does so, and the transparent sidebar appears.

UI Design Lesson #1: Never design a user interface that requires something to disappear in order for something else to appear. Invisible screen hotspots sound like a great idea, but they are actually terrible. Think about it.
I then tell her, now move the mouse to “Devices”. By the time I get done telling her this and by the time she sees where “Devices” is (being new, she’s reading all the text under the icons) the sidebar times out and disappears. First response “What did I do???” Well, you didn’t do anything, which is the problem, because what you needed to do you didn’t do fast enough.

UI Design Lesson #2: Never design a user interface that requires the user to act within a certain timeframe. Beginners probably will not realize this, and it is an incredibly frustrating experience watching them trying to act in a smooth manner. First they put the mouse in the corner and then pull it back right away, before the popup appears. Then they pull back outside of the sidebar region, and it again disappears. In the process, they will probably click on something else. And the confusion goes on.

Eventually, she succeeds in printing.

Next, she wants to show me something on the web. So we launch IE and, having figured out that the address bar is at the bottom of the screen, she brings up the website. Now, this website has a lot of information that requires scrolling. IE, in W8, is a full screen app. Which means that the scrollbar buttons are conveniently (that’s sarcasm) located very close to the hotspots that bring up the W8 “gem” sidebar. In fact, my friend struggles several times with the dexterity required to mouse just over the scrollbar up/down buttons without activating the sidebar!

UI Design Lesson #3: Don’t position useful things so close to a hotspot that you can’t easily distinguish the two. Of course, this issue wouldn’t be a problem if it had been realized that invisible hotspots are a terrible UI design to begin with!

After some frustration, I tell her, just use the arrow keys to scroll the page up and down.

The next question is, how does she go back to a previous page? How does she enter a different URL? Because, you see, by this time W8 has conveniently (that’s sarcasm again) hidden the address bar. To this, I have no idea. I play around with W8 and after a particular mouse motion, some strange thing happens. The top of the screen all of a sudden shows small windows of previous web pages she has visited, and there on the bottom of the screen is the address bar! However, as soon as I mouse to my destination (the address bar) it (and the small windows at the top) disappear as if I’m playing a game of “hahaha, you can’t mouse over to me!”

UI Design Lesson #4: If you’re going to show something after a magical mouse gesture, don’t remove it until I actively choose to.

UI Design Lesson #5: Magical mouse gestures are nice, but whatever brings up the address bar in IE is unpredictable and I still haven’t figured out whether it’s a mouse gesture or some other random action. Mouse gestures may be a quick way for an experienced user to do something, but always provide more conventional means for the beginner to accomplish the same thing.

After a while, we give up and discover a workaround: go back to the desktop, click on IE again, and it shows an address bar! Of course, I have no idea how many IE windows that will result in remaining open in the background. It seems like quite a few. At some point my friend actually managed to get the “small windows” to stay in place long enough for her to close them. At one point, I started laughing my arse off when an IE message came up about “closing all tabs.” That’s cute, because W8, being full screen, has no tabs, but obviously IE has been coerced into a mode where, behind the scenes, it still thinks it has tabs. My friend was not amused at my laughter.

So, lastly, we go through a short “using WordPad” lesson. The fellow at the Microsoft store at pinned it to the start screen but it was off screen. So I show my friend how to scroll the start screen. Of course, what I really want to do is get rid of all that junk on the start screen. Anyways, she dutifully clicks on the “WordPad” square and W8 dutifully switches into the W7 mode to bring up WordPad.

Now note this. After typing in some stuff, she wants to make sure that the printing works. So she mouses over to the right corner of the screen. Ah, no, this is schizophrenic, psychotic Windows, and in this mode, you have to use the standard File/Print feature from the menu bar that Microsoft is remove from our collective memory.

UI Design Lesson #6: Consistency. If you’re going to come out with a new OS, then everything should behave consistently. If you can’t figure out how to get older applications to use poorly designed new user interface concepts, then maybe that’s a clue that you shouldn’t, and you should instead stick with something that doesn’t require users to remember which “mode” they are in to do basic tasks.

I see a bright future in Windows 8 psychotherapy and recovery counseling.

Oh, and as a final footnote, she later shows me some pictures on her iPad (which can by default view PowerPoint slideshows, which is not a feature already installed on W8 so she can’t open them on her laptop) and at one point she says, “see how easy the iPad is to use???

Marc