Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby ActiveRecord Basics Migrations and Relationships Relationships

I have been having problems starting the rails console after setting up relationships in my app models.

I restarted the local server after having run several migrations in the previous video, but no luck. I am getting the follwing error upon running 'rails console' : /Users/taylorburton/.rvm/gems/ruby-2.2.0/gems/mysql2-0.3.18/lib/mysql2.rb:31:in `require': dlopen(/Users/taylorburton/.rvm/gems/ruby-2.2.0/gems/mysql2-0.3.18/lib/mysql2/mysql2.bundle, 9): Library not loaded: libmysqlclient.18.dylib Referenced from: /Users/taylorburton/.rvm/gems/ruby-2.2.0/gems/mysql2-0.3.18/lib/mysql2/mysql2.bundle Reason: image not found - /Users/taylorburton/.rvm/gems/ruby-2.2.0/gems/mysql2-0.3.18/lib/mysql2/mysql2.bundle (LoadError)

Wondering if anyone else has been having this issue. Also, already had a biller app, which is why this is called diller :P

Thanks! -Taylor-

3 Answers

Tom Sager
Tom Sager
18,987 Points

The location of the mysql executable needs to be in your PATH variable. Details can be found here.

Excellent! Thanks so much Tom! Just to make sure I am understanding correctly, if I close an active tab (in this case by accident) is it generally necessary to for the mysql executable to be rerouted in my PATH variable?

Tom Sager
Tom Sager
18,987 Points

PATH is an environment variable. When you set it via your profile script, it is set when you login, and remains set as long as you are logged in. And it is set to the same values the next time you login.

PATH is set before you start a browser, so closing a tab in your browser has no effect. If you are closing a command shell window and opening a new one, the profile script is read again, so there is still no impact.

You should never have to change the location of the mysql executable in PATH unless you move where the executable lives - highly unlikely.

So once you have it working, you should never have to change it again.