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

Has anybody else had this many issues with Ruby and Mysql. If so how did you resolve it?

Hi Alan Johnson I know that it has been a while that I have said anything in this post. I have followed your advise and I am still definitely excited to continue my learning with ROR, but I have been stuck since this post. I have not been able to get past the migration video. http://teamtreehouse.com/library/rails-models/migrations-and-relationships/migrations

It is not that I do not understand what is being presented I've just been facing major issues with this and I amd in desperate need of help. I have posted questions in the forum and people have tried to help me. I have also spent days trolling google but all thus far to no avail. I have uninstalled Ruby, Mysql and Mysql Workbench. I have also rebuilt biller (from the video many times).

Here are my challenges:

When I build biller the first challenge that I face is with the "rake db:create" command ( I did not have this problem working through previous videos). The command continously failsas it says that the disk image cannot be found. I finally got around that by running : "export DYLD_LIBRARY_PATH="/usr/local/mysql/lib:$DYLD_LIBRARY_PATH" First then when I run the 'rake db:create command' I do not have a problem.

The next challenge that I faced was running'mysql -uroot'. I finally got past this by running: /usr/local/mysql/bin/mysql First, then the mysql -u root command works just fine.

When I get to the part where it is time to 'show databases' , biller never shows. Information_schema and test shows. biller_development and biller_test show in mysql workbench but not in the 'show databases' list. When I try to 'Create DATABASE' it firstly tells me that I do not have permission to do so, then it tells me that database that I am trying to create already exists. So I went to mysql workbench and deleted it from there. Started over again but, I still cannot get past this poing. When I am told that biller_developmen and biller_test already exists even though it does not show in the listing I tried using it just to see what would happen then I am told that the database does not exist.

I know that this post is a little long but I also know that details are neccessary. I have searched google and the forum countless times, and asked many questions. Yet I am still stuck. I know that I have much to learn, I also know that there will be many times when I will need to recive and give help. Please if you have the time help me as I am truly stuck here. And as I defintely need to be successful with ROR to obtain my goals. Thank you in advance.

2 Answers

HI Tom sorry that it has taken so long to reply. Mysql server is definitely running, I installed homebrew (thought that I'd already done that) and ran "brew doctor". This showed me that I had GCC installer installed and that was causing a problem. The only way that I found to delete it was to remove xcode completely. I put Xcode and the GCC installer into my trash and did a " Secure delete Trash" ( this literally took 24 hrs). I then restarted and ran "brew doctor" , this time it showed me that there was a problem with my PATH. I resolved by following the instructions listed here:

http://stackoverflow.com/questions/17393804/how-to-change-path-for-homebrew-config-scripts-exist-outside-your-system-or-h/18466510#18466510

I then reinstalled Xcode as HomeBrew said that I needed it, and low and behold it was saying that I had Gcc again. So I removed Xcode and started the process again. When I got to "rake db:create", it outputted this:

rake aborted! LoadError: dlopen(/usr/local/rvm/gems/ruby-1.9.3-p392/gems/mysql2-0.3.16/lib/mysql2/mysql2.bundle, 9): Library not loaded: libmysqlclient.18.dylib Referenced from: /usr/local/rvm/gems/ruby-1.9.3-p392/gems/mysql2-0.3.16/lib/mysql2/mysql2.bundle Reason: image not found - /usr/local/rvm/gems/ruby-1.9.3-p392/gems/mysql2-0.3.16/lib/mysql2/mysql2.bundle /usr/local/rvm/gems/ruby-1.9.3-p392/gems/mysql2-0.3.16/lib/mysql2.rb:8:in require' /usr/local/rvm/gems/ruby-1.9.3-p392/gems/mysql2-0.3.16/lib/mysql2.rb:8:in<top (required)>' /usr/local/rvm/gems/ruby-1.9.3-p392/gems/bundler-1.7.2/lib/bundler/runtime.rb:76:in require' /usr/local/rvm/gems/ruby-1.9.3-p392/gems/bundler-1.7.2/lib/bundler/runtime.rb:76:inblock (2 levels) in require' /usr/local/rvm/gems/ruby-1.9.3-p392/gems/bundler-1.7.2/lib/bundler/runtime.rb:72:in each' /usr/local/rvm/gems/ruby-1.9.3-p392/gems/bundler-1.7.2/lib/bundler/runtime.rb:72:inblock in require' /usr/local/rvm/gems/ruby-1.9.3-p392/gems/bundler-1.7.2/lib/bundler/runtime.rb:61:in each' /usr/local/rvm/gems/ruby-1.9.3-p392/gems/bundler-1.7.2/lib/bundler/runtime.rb:61:inrequire' /usr/local/rvm/gems/ruby-1.9.3-p392/gems/bundler-1.7.2/lib/bundler.rb:133:in require' /Users/aspire/biller/config/application.rb:7:in<top (required)>' /Users/aspire/biller/Rakefile:4:in `<top (required)>' (See full trace by running task with --trace)

I have had this problem before so I ran: export DYLD_LIBRARY_PATH="/usr/local/mysql/lib:$DYLD_LIBRARY_PATH"

I ran the rake db:create again and this time I've been told that: biller_development already exists biller_test already exists

Then I tried to run: mysql -uroot

I was told:-bash: mysql: command not found

I then ran: /usr/local/mysql/bin/mysql

The output that I received was:

Peachess-MacBook-Pro:biller aspire$ /usr/local/mysql/bin/mysql Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 5 Server version: 5.6.20 MySQL Community Server (GPL)

Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

When I run ; SHOW DATABASES ;

I get the below results: mysql> SHOW DATABASES; +--------------------+ | Database | +--------------------+ | information_schema | | test | +--------------------+ 2 rows in set (0.18 sec)

Although according to the Terminal the biller databases are created. They are definitely not showing in the listing.

I seriously need help !!! Please :(

I too had problem starting with the biller application. I resolved it essentialy by making sure the mysql server was running, but it sounds like your problem goes a little deeper!

If you were to start the project from scratch, can you give us some exact copies of the outputted error messages? It's also good to know what OS you're on, and the method you're using to install mysql, ruby, rails etc as well as versions.