Topic: problems with rails.

First off, let me say that i am totally new at this RoR, and i 'm writting my first rails app, following the tutorial at : http://www.onlamp.com/pub/a/onlamp/2006 … tml?page=2

please bear with me if this is a noob mistake that is just wasting some time big_smile.

Ok so basically i followed the rubyonrails.com link to isntalling dev kit on mac os, and got to a point where i had to install mysql, and since this is my personal machine , i really did not want to have mysql on it.. Since i have a Desktop that was lying around, i installed ubuntu on it, apache2, mysql5, configured all users, etc.. and was up and running in no time.


Now im making my first rails app, and get to the point where i have to do the scaffold :

ruby script\generate scaffold recipe recipe

this comes to a halt with this error message :

dyld: NSLinkModule() error
dyld: Library not loaded: /usr/local/mysql/lib/mysql/libmysqlclient.15.dylib
  Referenced from: /usr/local/lib/ruby/gems/1.8/gems/mysql-2.7/lib/mysql.bundle
  Reason: image not found
Trace/BPT trap

investigate a bit, get to this forum but on this link :

http://railsforum.com/viewtopic.php?pid=24070

ok so it seems to be a database problem, since its not local, so I go into my database.yml file and start to change the settings from socket, to host ( with ip from machine in lan that has the db).

try the scaffold again, and now i get this BIG error

~/rails/cookbook charlesromestant$ ruby script/generate scaffold recipe recipe
/usr/local/lib/ruby/1.8/yaml.rb:133:in `load': syntax error on line 24, col -1: `test: (ArgumentError)
  adapter: mysql
  database: cookbook_test
  username: dev
  password:$$$$$$$
  host:90.0.0.106
  #socket: /tmp/mysql.sock

production:
  adapter: mysql
  database: cookbook_production
  username: dev
  password: $$$$$$$$$$
host:90.0.0.106
# socket: /tmp/mysql.sock
'       from /usr/local/lib/ruby/1.8/yaml.rb:133:in `load'
        from /usr/local/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/initializer.rb:523:in `database_configuration'
        from /usr/local/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/initializer.rb:228:in `initialize_database'
        from /usr/local/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/initializer.rb:88:in `process'
        from /usr/local/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/initializer.rb:43:in `run'
        from ./script/../config/../config/environment.rb:13
        from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
        from /usr/local/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/commands/generate.rb:1
        from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
        from script/generate:3


now my database has the development and the deploy databases created. as is in the tutorial

Please advise, it seems to be a linking or library missing error, due to the fact that i dont have mysql on my machine ( even though i did do the gem install mysql)

Thank you
Charles

Re: problems with rails.

slightly bumping this... still no solution to this.

Re: problems with rails.

I just overcame the same issue, by following the advice on the other thread you referenced.

The key for my situation was that the mysql-2.7 executable contains a reference to a path that isn't correct (.../mysql/lib/mysql/...) so the use of the install_name_tool to replace that reference in the binary with the correct referenced fixed the problem right away.

I didn't understand your comment that since it isn't local it's a database problem.  I think it is a local problem, given the output you supplied.

Hope this helps and I'm not misunderstanding your situation.

I was doing this on Mac OS X Server 10.4.9, but not using the versions bundled with the OS... mine was all fresh installs from the various distribution sites (mysql.com, rubyforge, etc.).

Re: problems with rails.

well what i meant was that i am not using a database that is on the local host, but rather a remote server..

i ll give it another shot, but as it is, i ve almost given up on rails... same problems as web programing with java : getting it running... even with convention over configuration i was not able to get the simplest of things going.. but hell, must be something i ve done, so i ll give it another try