I installed a ROR environment on my OS X machine, and I cant'' past "go" with my "hello world" application. Can anyone help me figure this out? Problem Summary I cannot get my “Hello World” application to work. http://localhost:3000/ view is OK but http://localhost:3000/say/hello/ fails Environment Mac OS X v10.5.6 ruby 1.8.7 (2008-08-11 patchlevel 72) gem 1.3.1 rails 2.2.2 mysql mysql Ver 14.14 Distrib 5.1.32, for apple-darwin9.5.0 (i386) using readline 5.1 (followed install procedure at http://hivelogic.com/articles/2008/02/ruby-rails-leopard ) I created a "say" controller with an empty "hello" method. I also created view.rhtml ERROR- Browser View http://localhost:3000/say/hello/ MissingSourceFile in SayController#hello no such file to load – mysql RAILS_ROOT: /Users/Joes/Sites/joes_app This error occurred while loading the following files: mysql Mongrel Console View Rendered /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/ action_controller/templates/rescues/_trace (136.7ms) Rendered /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/ action_controller/templates/rescues/_request_and_response (1.2ms) Rendering /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/ action_controller/templates/rescues/layout.erb (internal_server_error) WEBrick Console View !!! The bundled mysql.rb driver has been removed from Rails 2.2. Please install the mysql gem and try again: gem install mysql. 127.0.0.1 - - [05/Mar/2009:09:36:28 EST] "GET /say/hello/ HTTP/1.1" 500 14173 - -> /say/hello/ “gem install mysql” – failure console log (partial) joe-sulmars-imac2:~ Joes$ gem install mysql WARNING: Installing to ~/.gem since /usr/local/lib/ruby/gems/1.8 and /usr/local/bin aren''t both writable. Building native extensions. This could take a while... ERROR: Error installing mysql: ERROR: Failed to build gem native extension. /usr/local/bin/ruby extconf.rb install mysql checking for mysql_query() in -lmysqlclient... no checking for main() in -lm... yes checking for mysql_query() in -lmysqlclient... no checking for main() in -lz... yes checking for mysql_query() in -lmysqlclient... no checking for main() in -lsocket... no checking for mysql_query() in -lmysqlclient... no checking for main() in -lnsl... no checking for mysql_query() in -lmysqlclient... no *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options. mkmf.log (partial) find_library: checking for mysql_query() in -lmysqlclient... -------------------- no "gcc -o conftest -I. -I/usr/local/lib/ruby/1.8/i686-darwin9.6.0 -I. -I/ usr/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE - D_XOPEN_SOURCE=1 -fno-common -pipe -fno-common conftest.c -L. -L/ usr/local/lib -L/usr/local/lib -L. -lruby-static -lmysqlclient - lpthread -ldl -lobjc " conftest.c: In function ‘t’: conftest.c:3: error: ‘mysql_query’ undeclared (first use in this function) conftest.c:3: error: (Each undeclared identifier is reported only once conftest.c:3: error: for each function it appears in.) checked program was: /* begin */ 1: /*top*/ 2: int main() { return 0; } 3: int t() { void ((*volatile p)()); p = (void ((*)()))mysql_query; return 0; } /* end */ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Looks like you''ve got the i386 version of mysql... that makes things easier... Try... gem install -V mysql -- --with-mysql-config=/usr/local/mysql/bin/ mysql_config -philip On Mar 5, 2009, at 7:54 AM, jsulmar wrote:> > I installed a ROR environment on my OS X machine, and I cant'' past > "go" with my "hello world" application. Can anyone help me figure > this out? > > Problem Summary > I cannot get my “Hello World” application to work. > http://localhost:3000/ view is OK but > http://localhost:3000/say/hello/ fails > > Environment > Mac OS X v10.5.6 > ruby 1.8.7 (2008-08-11 patchlevel 72) > gem 1.3.1 > rails 2.2.2 > mysql > mysql Ver 14.14 Distrib 5.1.32, for apple-darwin9.5.0 (i386) using > readline 5.1 > (followed install procedure at http://hivelogic.com/articles/2008/02/ruby-rails-leopard > ) > I created a "say" controller with an empty "hello" method. I also > created view.rhtml > > ERROR- Browser View > http://localhost:3000/say/hello/ > MissingSourceFile in SayController#hello > no such file to load – mysql > RAILS_ROOT: /Users/Joes/Sites/joes_app > This error occurred while loading the following files: mysql > > Mongrel Console View > Rendered /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/ > action_controller/templates/rescues/_trace (136.7ms) > Rendered /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/ > action_controller/templates/rescues/_request_and_response (1.2ms) > Rendering /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/ > action_controller/templates/rescues/layout.erb (internal_server_error) > > WEBrick Console View > !!! The bundled mysql.rb driver has been removed from Rails 2.2. > Please install the mysql gem and try again: gem install mysql. > 127.0.0.1 - - [05/Mar/2009:09:36:28 EST] "GET /say/hello/ HTTP/1.1" > 500 14173 > - -> /say/hello/ > > “gem install mysql” – failure > console log (partial) > joe-sulmars-imac2:~ Joes$ gem install mysql > WARNING: Installing to ~/.gem since /usr/local/lib/ruby/gems/1.8 and > /usr/local/bin aren''t both writable. > Building native extensions. This could take a while... > ERROR: Error installing mysql: > ERROR: Failed to build gem native extension. > > /usr/local/bin/ruby extconf.rb install mysql > checking for mysql_query() in -lmysqlclient... no > checking for main() in -lm... yes > checking for mysql_query() in -lmysqlclient... no > checking for main() in -lz... yes > checking for mysql_query() in -lmysqlclient... no > checking for main() in -lsocket... no > checking for mysql_query() in -lmysqlclient... no > checking for main() in -lnsl... no > checking for mysql_query() in -lmysqlclient... no > *** extconf.rb failed *** > Could not create Makefile due to some reason, probably lack of > necessary libraries and/or headers. Check the mkmf.log file for more > details. You may need configuration options. > > > mkmf.log (partial) > find_library: checking for mysql_query() in -lmysqlclient... > -------------------- no > "gcc -o conftest -I. -I/usr/local/lib/ruby/1.8/i686-darwin9.6.0 -I. - > I/ > usr/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE - > D_XOPEN_SOURCE=1 -fno-common -pipe -fno-common conftest.c -L. -L/ > usr/local/lib -L/usr/local/lib -L. -lruby-static -lmysqlclient - > lpthread -ldl -lobjc " > conftest.c: In function ‘t’: > conftest.c:3: error: ‘mysql_query’ undeclared (first use in this > function) > conftest.c:3: error: (Each undeclared identifier is reported only once > conftest.c:3: error: for each function it appears in.) > checked program was: > /* begin */ > 1: /*top*/ > 2: int main() { return 0; } > 3: int t() { void ((*volatile p)()); p = (void ((*)()))mysql_query; > return 0; } > /* end */ > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Philip Hallstrom wrote:> Looks like you''ve got the i386 version of mysql... that makes things > easier... > > Try... > > gem install -V mysql -- --with-mysql-config=/usr/local/mysql/bin/ > mysql_config > > -philipDepending on your installation it might take some additional tweaking as well. I you end up getting an error related a .dylib file then search this forum for a recent post that has the answer. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks for the responses. After reading and experimenting a lot today, I have solved, or at least worked around, the problems for my installation. It seems: 1. rails 2.2.2 requires a connection to a working database even if the application does not use a database (e.g. "Hello World"). Otherwise, you get the "SayController#hello" message 2. the default database used by rails 2.2.2 is sqlite3, so if you want to use mysql you need to create the project with "rails my_app -d mysql" ( or you can edit database.yml) 3. the mysql gem installer must be told where MySQL has been installed. "sudo gem install mysql -- --with-mysql-dir=/usr/local/mysql" 4. after successfully installing the mysql gem, my "Hello World" application still produced a browser message "dlsym(0x1ee0dc0, Init_mysql): symbol not found ". The mysql gem does not seem to work with 64-bit MySQL. By installing the 32 bit MySQL package I was able to resolve this final issue. Whew! I''m lucky it only took 2 days. Now I can start creating some real bugs. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Just as an aside, if you are just experimenting with small things, SQLite works really REALLY well. I recommend maybe giving it a shot ... as long as you don''t go all crazy outside of Rails'' handling of SQL, then the portability of your code from SQLite to almost any other DB adapter (my experience has been with PostgreSQL) is relatively easy. On Mar 5, 7:24 pm, jsulmar <j...-kP+8qcqG1mZBDgjK7y7TUQ@public.gmane.org> wrote:> Thanks for the responses. > > After reading and experimenting a lot today, I have solved, or at > least worked around, the problems for my installation. > > It seems: > 1. rails 2.2.2 requires a connection to a working database even if the > application does not use a database (e.g. "Hello World"). Otherwise, > you get the "SayController#hello" message > > 2. the default database used by rails 2.2.2 is sqlite3, so if you want > to use mysql you need to create the project with "rails my_app -d > mysql" ( or you can edit database.yml) > > 3. the mysql gem installer must be told where MySQL has been > installed. > "sudo gem install mysql -- --with-mysql-dir=/usr/local/mysql" > > 4. after successfully installing the mysql gem, my "Hello World" > application still produced a browser message "dlsym(0x1ee0dc0, > Init_mysql): symbol not found ". The mysql gem does not seem to work > with 64-bit MySQL. By installing the 32 bit MySQL package I was able > to resolve this final issue. > > Whew! I''m lucky it only took 2 days. Now I can start creating some > real bugs.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---