Showing posts with label error. Show all posts
Showing posts with label error. Show all posts

May 9, 2015

rspec error messages

If you get this:

`require_relative': cannot load such file -- path (LoadError)


Do this:

Double-check that the files referenced by all your "require_relative" exist.
Also check that the spelling is correct and matches both ways.

If you get this:

Deprecation Warnings:

Using `should` from rspec-expectations' old `:should` syntax without explicitly enabling the syntax is deprecated. Use the new `:expect` syntax or explicitly enable `:should` with `config.expect_with(:rspec) { |c| c.syntax = :should }` instead.


Do this:

Replace "@book.should be_an_instance_of Book" with:

expect(@book).to be_an_instance_of Book

This is due to deprecation of the "should" syntax.

Mar 22, 2015

[SOLVED] Uncaught TypeError: Cannot set property 'innerHTML' of null

This happens when your innerHTML code is trying to insert into a html element/tag that doesn't exist or named differently.

The code below will produce error - the HTML doesn't have an element with the id "result":

HTML -

<body>
<header></header>
  <div id="main">
  </div>
  <footer></footer>

  <script>
     var person = {
         firstName: "John",
         lastName : "Doe",
         id       : 5566,
         fullName : function(c) {
            return 'My name is ' + this.firstName + " " + this.lastName;
         }
     };
     document.getElementById("result").innerHTML = person.fullName ();
  </script>
</body>


This will work:

<body>
<header></header>
<div id="main">
</div>
<footer></footer>

<script>
  var person = {
      firstName: "John",
      lastName : "Doe",
      id       : 5566,
      fullName : function(c) {
         return 'My name is ' + this.firstName + " " + this.lastName;
      }
  };
  document.getElementById("main").innerHTML = person.fullName ();
  </script>

</body>

Mar 21, 2015

[SOLVED] Uncaught Error: Bootstrap's JavaScript requires jQuery

This is quite a simple error you might encounter even when you've already included both jquery and bootstrap.js files.

Solution: Re-arrange the order of script tags in html file so that jquery is at the top, and bootstrap.js is anywhere after the jquery.js file.

This will cause the "uncaught error":

  <!-- js libs -->
  <!-- twbs jquery underscore backbone -->
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
  <script src="/js/lib/jquery-1.11.2.js"></script>
  <script src="http://documentcloud.github.com/underscore/underscore-min.js"></script>
  <script src="http://documentcloud.github.com/backbone/backbone-min.js"></script>


Problem solved:


  <!-- js libs -->
  <!-- jquery twbs underscore backbone -->
  <script src="/js/lib/jquery-1.11.2.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
  <script src="http://documentcloud.github.com/underscore/underscore-min.js"></script>
  <script src="http://documentcloud.github.com/backbone/backbone-min.js"></script>

Mar 5, 2015

[SOLVED] Wordpress Edit Image Cannot Crop Issue




Earlier I wrote about this stubborn problem where Wordpress was refusing to let me use the built-in crop and rotate image editing features even after a clean install.

After I attempted to install a new media-handling plugin, to kind of skip Wordpress altogether when it comes to image editing, I was notified that I didn't have the GD graphics library installed with php. 

So I quickly installed it. You must restart the web server after that.

Read more:
  1. GD Library https://libgd.github.io/pages/faq.html
  2. Cyberciti's how-to page http://www.cyberciti.biz/faq/ubuntu-linux-install-or-add-php-gd-support-to-apache/
  3. The media-plugin I installed was "WP Optimize By xTraffic". For basic cropping you can rely on Wordpress' built-in image control and editing features.

Feb 26, 2015

Atom Package Update Failed For Emmet, Git-Plus, Minimap

Encountered the following error using the Atom text editor in my mac. I'm using a 2012 Macbook Pro running Yosemite (which is a slow OS compared to mountain lion or lion or snow leopard).

Package update failed using Atom's package update menu.

Issuing "apm install emmet" gave me this error:

EACCES, unlink '/Users/pacesferry/.atom/packages/emmet/.npmignore'

Solution: sudo the command.


So either
sudo apm install emmet
or
sudo apm update emmet

Oct 27, 2014

Sphinx Search WARNING: key 'sql_query_info' was permanently removed from Sphinx configuration. Refer to documentation for details.

I'm using Sphinx 2.2.5 and the gem Thinking-Sphinx.


Every time I run the command RAKE TS:REBUILD I will get the following warning messages. How annoying. You'd be pleased to learn that these warnings are harmless as they are due to deprecation.

WARNING: key 'sql_query_info' was permanently removed from Sphinx configuration. Refer to documentation for details.

WARNING: key 'charset_type' was permanently removed from Sphinx configuration. Refer to documentation for details.


WARNING: key 'enable_star' was permanently removed from Sphinx configuration. Refer to documentation for details.


Sep 21, 2014

cap production deploy errors

If you get this:

cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing on host my-app-name.com: git exit status: 2
git stdout: Nothing written
git stderr: fatal: Not a valid object name
tar: This does not look like a tar archive
tar: Exiting with failure status due to previous errors



It's probably due to deploy.rb attempting to deploy a branch that is empty on remote ie has not commits yet.

Solution: Try pointing to a branch with commits.

Aug 16, 2014

Books

"Agile Web Development with Rails 4" shows you step-by-step how to build an online store using Ruby on Rails 4.

Errata from my own experience below. Full errata here.

//= require jquery-ui/effect-blind (works, in Iteration F3)
//= require jquery.ui.effect-blind (doesn't work)