Devin McCabe
2010-Jan-10 21:20 UTC
bad interpreter: No such file or directory when running rake
After upgrading to Snow Leopard, I found my rails and mysql installs to be completely hosed, so I uninstalled ruby, mysql, and rubygems and reinstalled them from these instructions: http://hivelogic.com/articles/compiling-ruby-rubygems-and-rails-on-snow-leopard/ Here''s where things are installed now: $ which ruby /usr/local/bin/ruby $ which rails /usr/local/bin/rails $ which gem /usr/local/bin/gem $ which rake /usr/bin/rake $ which mysql /usr/local/mysql/bin/mysql My problem is that if I try to run rake db:migrate (or anything with rake), I get this error: $ rake db:migrate -bash: /usr/bin/rake: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby: bad interpreter: No such file or directory My .bash_profile is a mess due to many hours of unsuccessful troubleshooting: $ echo $PATH /~/.gem:/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/usr/local/lib/ruby/gems/1.8/bin/:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/usr/local/bin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/usr/local/bin:/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/opt/local/bin:/opt/local/sbin:/Users/devin/.gem/ruby/1.8/bin How do I reset my profile to get rake (and everything else) working properly. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Devin McCabe
2010-Jan-10 22:21 UTC
Re: bad interpreter: No such file or directory when running rake
OK, I was somehow able to resolve this error by reinstalling both rake and rails. Now I get a different error: $ rake db:migrate (in /Users/devin/Sites/test) dyld: lazy symbol binding failed: Symbol not found: _mysql_init Referenced from: /usr/local/lib/ruby/gems/1.8/gems/mysql-2.8.1/lib/mysql_api.bundle Expected in: flat namespace dyld: Symbol not found: _mysql_init Referenced from: /usr/local/lib/ruby/gems/1.8/gems/mysql-2.8.1/lib/mysql_api.bundle Expected in: flat namespace Trace/BPT trap ------------- MySQL does work fine, but rails isn''t seeing it: irb(main):001:0> require ''mysql'' LoadError: no such file to load -- mysql from (irb):1:in `require'' from (irb):1 -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Conrad Taylor
2010-Jan-10 23:41 UTC
Re: Re: bad interpreter: No such file or directory when running rake
On Sun, Jan 10, 2010 at 2:21 PM, Devin McCabe <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> OK, I was somehow able to resolve this error by reinstalling both rake > and rails. Now I get a different error: > > $ rake db:migrate > (in /Users/devin/Sites/test) > dyld: lazy symbol binding failed: Symbol not found: _mysql_init > Referenced from: > /usr/local/lib/ruby/gems/1.8/gems/mysql-2.8.1/lib/mysql_api.bundle > Expected in: flat namespace > > dyld: Symbol not found: _mysql_init > Referenced from: > /usr/local/lib/ruby/gems/1.8/gems/mysql-2.8.1/lib/mysql_api.bundle > Expected in: flat namespace > > Trace/BPT trap > > ------------- > > MySQL does work fine, but rails isn''t seeing it: > > irb(main):001:0> require ''mysql'' > LoadError: no such file to load -- mysql > from (irb):1:in `require'' > from (irb):1 >In the above, you haven''t loaded the Rails environment. You''ll have to navigate to the root of a Rails application and perform the following action: script/console Next, if you''re upgrading to Snow Leopard, then I would recommending reading the following: http://weblog.rubyonrails.org/2009/8/30/upgrading-to-snow-leopard However, I would recommend installing MySQL database server via MacPorts because the maintainer keeps this port relatively current: a) install the latest version of MacPorts Snow Leopard<http://distfiles.macports.org/MacPorts/MacPorts-1.8.2-10.6-SnowLeopard.dmg> b) update your PATH environment variable in .profile to look like the following: export PATH=/opt/local/bin:/opt/local/sbin:${PATH} c) open up a new terminal window d) install the MySQL5 database server sudo port install mysql5-server Note: Please following the instructions that appear on the screen for post installation. e) configure RubyGems sudo gem update --system f) install some basic gems sudo gem install rails mysql sqlite3-ruby rack Good luck, -Conrad --> 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > > > >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.