Recaptcha, Foundation, Sass, and the “different prefix” error

Recaptcha and Foundation

After creating a test project, I finally connected the dots that my inclusion of foundation_and_overrides.scss was causing the problem with the rendering of the recaptcha block (see my previous post.)  A quick google search led me here where DinkoMiletic provides a good solution:

#recaptcha_area input[type="text"] {
  display: inline-block;
  height: auto;

Disturbingly, “thedeerchild” writes: ” It’s not really feasible to pull out a core part of our styling due to third party compatibility issues, and it’s fairly easy to overwrite the Foundation styles to fix reCaptcha.”

Now, personally, I think that’s a cop out.  If you’re going to write something as “foundational” (pun intended) as a presentation layer styler, then it is damn well your responsibility when some third party component has compatibility issues, especially one so prevalent as Google’s recaptcha.   Now, granted, I’m not using the most recent version of Foundation, so perhaps the issue has been fixed, but at a minimum, I think these kinds of compatibility issues should be easily found in the documentation, not buried in some forum post.

SASS and the “Different Prefix” Error

However, when I set up my new test project, I started getting the following error:

ActionView::Template::Error (different prefix: "C:/" and "E:/rails-projects/airity/app/assets/stylesheets"

I have never, until this morning, had a problem running rails projects on a different drive.  Now, this morning, this happens.  As others suggested, moving the project back to the C drive where I RailsInstaller did its thing is a solution.  While I came across a few different “solutions” (none of which worked and some of which required forking the sass-rails gem), the only solution that worked and allowed me to keep the project on the desired drive was to use a simlink.

Because this problem appears to be common with other gems (like bootstrap-sass, read here), I am definitely interested in a global solution rather than something that fixes the problem for just one issue.  The mklink command was for some reason undecipherable to me, so as per a suggestion here, I downloaded Directory Linker and filled in:

Link Location: the new folder name on the C drive that I want.  In my case “c:\rails-projects\airity”

Link To: The existing folder name on my E drive.  In my case “e:\rails-projects\airity”

Click Go!, it does it’s thing in a second or so, then verify that the project files and folders exist on the C drive.

After reloading the project in RubyMine from the C drive, lo-and-behold, no more problems with the prefix.

Now if I could only bill the 4 hours I spent this morning working around problems that someone else caused by some update (which I was completely unable to track down, even after setting specific versions of sass and sass-rails based on my laptop version numbers).

Then again, those people that have suffered through this and found solutions which I then used, well, they should be the ones getting the money.

So, now it’s almost 3PM and I’m finally able to get to what I wanted to at 9 this morning (yes, there was lunch and grocery run in between.)  And yes, the reCAPTCHA block now works with Foundation:



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s