google.load function doesn't work if called from jquery ready function?

google.load function doesn't work if called from jquery ready function?

I'm using the Google AJAX APIs, but some reason google.load works when run through normal javascript, but if I call the method from my jquery ready function it doesn't work. Code and output is below, any help would be greatly appreciated!

page.html
  1. <script type="text/javascript">
  2. loadGoogleStuff();
  3. function loaded() {
  4.     console.debug("in loaded function");
  5. }
  6. function loadGoogleStuff() {
  7.     console.debug("before google load code");
  8.     google.load("feeds", "1");
  9.     console.debug("after google load code");
  10.     google.setOnLoadCallback(loaded);
  11. }
  12. </script>
  13. <%= javascript_include_tag "code.js" %>

code.js
  1. $(window).ready(function() {   
  2.     console.debug("in jquery load function");
  3. });

Output:
  1. before google load code
  2. after google load code
  3. in jquery load function
  4. in loaded function

But this doesn't work

page.html
  1. <script type="text/javascript">
  2. function loaded() {
  3.     console.debug("in loaded function");
  4. }
  5. function loadGoogleStuff() {
  6.     console.debug("before google load code");
  7.     google.load("feeds", "1");
  8.     console.debug("after google load code");
  9.     google.setOnLoadCallback(loaded);
  10. }
  11. </script>
  12. <%= javascript_include_tag "code.js" %>

code.js
  1. $(window).ready(function() {   
  2.     console.debug("in jquery load function");
  3.     loadGoogleStuff();
  4. });

Output:
  1. window.loadFirebugConsole is not a function
If I comment out line 3 in code.js, the console debug runs okay, so the ready function is running okay. Even though there's a reference to Firebug, the same error occurs in Safari too. Nothing on the page loads. Does anyone know why this is occurring? Thanks for reading.