# Scaffold NoMethodError on Mac

**URL:** <https://www.ruby-forum.com/t/scaffold-nomethoderror-on-mac/54009>\
**Category:** Rails\
**Created:** [February 20, 2006, 9:09am UTC](https://www.ruby-forum.com/t/scaffold-nomethoderror-on-mac/54009 "2006-02-20T09:09:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![divotdave](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/bbe5ce/32.png) [@divotdave](https://www.ruby-forum.com/u/divotdave)\
**Post date:** [February 20, 2006, 9:09am UTC](https://www.ruby-forum.com/t/scaffold-nomethoderror-on-mac/54009/1 "2006-02-20T09:09:03Z")

</div>

Hello All:

I am still somewhat new to Rails but have created a successful app on a  
Windows box and am venturing out for my first Mac Rails app. Being  
relatively new to Macs as well, I believe I have a good install of the  
latest versions (ruby, rails, mysql, webrick) but have hit two snags.

First - when I try to scaffold one of the controllers (i.e.  
localhost:3000/mycontroller/new) just to check that my connection to the  
db is good, I get the NoMethodError message in my browser. Everything is  
set up right to the best of my knowledge, but it seems I am not making a  
connection to the db. When I run the mycontroller/list page I get a lost  
connection to the mysql database message. My database.yml file is  
looking to localhost/port 3306. Maybe I am missing something…

Second - this was odd - but the Terminal would hang about part way  
through the execution of:

ruby script/generate scaffold item

the generate model and controller scripts worked fine.

Any ideas?

THANKS A BUNCH!  
David

---

<div class="post-metadata">

**Author:** ![divotdave](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/bbe5ce/32.png) [@divotdave](https://www.ruby-forum.com/u/divotdave)\
**Post date:** [February 21, 2006, 12:31am UTC](https://www.ruby-forum.com/t/scaffold-nomethoderror-on-mac/54009/2 "2006-02-21T00:31:17Z")

</div>

David,

For the Mac I used the following page for my installation:  
[http://www.tonyarnold.com/articles/2005/08/10/rolling-with-ruby-on-](http://www.tonyarnold.com/articles/2005/08/10/rolling-with-ruby-on-)  
rails-on-mac-os-x-tiger-for-beginners

And for installing lighttpd:

> **[Dan Benjamin](https://danbenjamin.com)**
>
> Dan Benjamin's personal website.

In your case maybe “sudo gem install mysql – --with-mysql-dir=/usr/  
local/mysql” might already do the trick.

I’m keeping a blog on my own website.

Regards,  
Tom.

[www.degrunt.net](http://www.degrunt.net)

---

<div class="post-metadata">

**Author:** ![divotdave](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/bbe5ce/32.png) [@divotdave](https://www.ruby-forum.com/u/divotdave)\
**Post date:** [February 21, 2006, 1:42am UTC](https://www.ruby-forum.com/t/scaffold-nomethoderror-on-mac/54009/3 "2006-02-21T01:42:45Z")

</div>

Tom de Grunt wrote:

> David,
> 
> For the Mac I used the following page for my installation:  
> [http://www.tonyarnold.com/articles/2005/08/10/rolling-with-ruby-on-](http://www.tonyarnold.com/articles/2005/08/10/rolling-with-ruby-on-)  
> rails-on-mac-os-x-tiger-for-beginners

Thanks Tom, I’ll try it. But since I have a full install already in  
place (via the hivelogic example) what would be the best way to remove  
my current install and try again…assuming something is screwy with my  
current installation?

---

<div class="post-metadata">

**Author:** ![divotdave](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/bbe5ce/32.png) [@divotdave](https://www.ruby-forum.com/u/divotdave)\
**Post date:** [February 22, 2006, 12:14am UTC](https://www.ruby-forum.com/t/scaffold-nomethoderror-on-mac/54009/4 "2006-02-22T00:14:32Z")

</div>

David,

/usr/local is not used by OSX under normal circumstances.  
In my case PHP5 and MySQL5 are there and Lighttpd.

Maybe somebody knows whether “gem” can uninstall itself, perhaps ruby  
can, using the  
“make uninstall” in your src/ruby-1.8.4 folder (following the  
Hivelogic example).

If both can not, you could go to /usr/local/bin and just remove or  
rename the “ruby” and “gem” file there.

Did you run the “sudo gem install mysql – --with-mysql-dir=/usr/  
local/mysql” bit?  
You could also try and do “sudo gem uninstall mysql” and then try the  
above command again.

If that does not work try putting a socket statement in your  
database.yml, if that still does not work, I’m in the blue to as why.

Good luck!

Tom
