Question: I have a page that references an external javascript file, and when I tell it run a function onload, it is giving me errors (I assume because it is firing before the page is loaded.) "Cannot set property 'innerHTML' of null"

What do I need to do here to fire run() after the page is loaded? 

HTML

```
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Test</title>
<script type="text/javascript" src="js/test.js"></script>
</head>
<body>
    <div id="test"></div>
</body>
</html>

```

JS

```
window.onload = run();

function run() {
    document.getElementById("test").innerHTML = "found it";
}

```

Answer: 
Your Rails -v and Ruby -v are correct for this tutorial. 

I can also see from the input that your `gemfile` has `gem 'sqlite3', '1.3.8'` in it.

1: Have you bundled?
--------------------

When was the last time you ran `bundle update` or `bundle install`?

How did you go about uninstalling sqlite3? Did you use `$ gem uninstall sqlite3`?
Try uninstalling and then reinstalling the gem.

2: - What version manager?
--------------------------

Did you use rvm, rbenv or homebrew to install? Using different version managers for different pieces can create communication issues.

3: Did you install Xcode?
-------------------------

This is taken from <http://www.railstutorial.org>:

---

"As a prerequisite, OS X users may need to install the Xcode developer tools. To avoid the (huge) full installation, I recommend the much smaller Command Line Tools for Xcode.

---

To install Xcode (my recommendation), look it up in the AppStore.

To install Command Line Tools (MHartl's recommendation) - <https://developer.apple.com/downloads/>

4: Are you using `bundle exec`?
-------------------------------

Try `bundle exec rails c` and `bundle exec rails s`

5: Try 'refreshing' your bundle directory
-----------------------------------------

If `bundle exec` doesn't work
Remove the .bundle/ directory and re-bundle with 

```
rm -rf .bundle/ && bundle

```
I experienced the same issue, I just switched to a different ruby version

e.g;

```
rvm use 1.9.3-p484

```

and then bundle again.