Project

General

Profile

Problem installing on OS X

Added by Carl Wolff over 13 years ago

I just reinstalled my computer to get a clean working environment. First out, I installed Xcode and Homebrew (package manager) in order to install git, MySQL, php52, python etc.

Then I tried to install redmine but it failed:

[~/Server/app/redmine]$ RAILS_ENV=production rake db:migrate
(in /Volumes/Datadrive/Users/woffie/Server/app/redmine)
rake aborted!
Object is not missing constant Issue!

I've installed Redmine this way:

brew install mysql
brew link mysql
mkdir -p ~/Server/app
gem install rails -v=2.3.5
gem install rack -v=1.0.1
gem install mysql -- --include=/usr/local/lib
mysql: create database redmine character set utf8; create user 'redmine'@'localhost' identified by 'my_password'; grant all privileges on redmine.* to 'redmine'@'localhost';
database.yml: adapter mysql…. (like RedmineInstall-page)
RAILS_ENV=production rake config/initializers/session_store.rb
rake generate_session_store
RAILS_ENV=production rake db:migrate
===> ERROR AS DESRIBED ABOVE<===

Local gems:

actionmailer (2.3.8, 2.3.5, 2.2.2, 1.3.6)
actionpack (2.3.8, 2.3.5, 2.2.2, 1.13.6)
actionwebservice (1.2.6)
activerecord (2.3.8, 2.3.5, 2.2.2, 1.15.6)
activeresource (2.3.8, 2.3.5, 2.2.2)
activesupport (2.3.8, 2.3.5, 2.2.2, 1.4.4)
acts_as_ferret (0.4.3)
archive-tar-minitar (0.5.2)
capistrano (2.5.2)
cgi_multipart_eof_fix (2.5.0)
color (1.4.0)
daemons (1.0.10)
dnssd (0.6.0)
docsplit (0.1.3)
fastthread (1.0.1)
fcgi (0.8.7)
ferret (0.11.6)
gem_plugin (0.2.3)
highline (1.5.0)
hoe (2.4.0)
hpricot (0.6.164)
json_pure (1.2.0)
libxml-ruby (1.1.2)
mocha (0.9.8)
mongrel (1.1.5)
mysql (2.8.1)
needle (1.3.0)
net-scp (1.0.1)
net-sftp (2.0.1, 1.1.1)
net-ssh (2.0.4, 1.1.4)
net-ssh-gateway (1.0.0)
rack (1.2.1, 1.1.0, 1.0.1)
rails (2.3.8, 2.3.5, 2.2.2, 1.2.6)
rake (0.8.7, 0.8.3)
RedCloth (4.1.1)
ruby-openid (2.1.2)
ruby-yadis (0.3.4)
rubyforge (2.0.3)
rubygems-update (1.3.7)
rubynode (0.1.5)
sqlite3-ruby (1.2.4)
termios (0.9.4)
transaction-simple (1.4.0)
xmpp4r (0.4)

Running ruby script/about
gives me:

$ ruby script/about
/Library/Ruby/Gems/1.8/gems/rails-2.3.5/lib/rails/gem_dependency.rb:119:Warning: Gem::Dependency#version_requirements is deprecated and will be removed on or after August 2010.  Use #requirement
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:440:in `load_missing_constant': uninitialized constant MysqlCompat::MysqlRes (NameError)
    from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:80:in `const_missing'
…..

Any ideas? Thanks!


Replies (10)

RE: Problem installing on OS X - Added by Carl Wolff over 13 years ago

Current versions

$ svn up; mysql --version; rake --version; ruby --version; rails —version

At revision 3847.
mysql Ver 14.14 Distrib 5.1.48, for apple-darwin10.4.0 (i386) using readline 6.0
rake, version 0.8.7
ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]
Rails 2.3.8

RE: Problem installing on OS X - Added by Felix Schäfer over 13 years ago

Could you add --trace to the db:migrate command and paste the trace here? One thing I noticed though: the current mysql gem only supports MySQL up to 5.0.x, not 5.1. Where there any errors when you tried to install the mysql gem? Could you try downgrading MySQL and try again?

RE: Problem installing on OS X - Added by Carl Wolff over 13 years ago

You're right. The mysql-gem caused the problem. It had errors for documentation so I thought that was easy to fix.

I found a solution regarding the gem at [[http://blog.simb.net/2009/10/24/gem-mysql-with-mysql-5-1-on-snow-leopard/]].

To follow up my installation using homebrew, the full line I used to install the mysql-gem was:

sudo env ARCHFLAGS="-arch x86_64" gem install --no-rdoc --no-ri mysql -- --with-mysql-config=/usr/local/bin/mysql_config

Then I proceeded with:

RAILS_ENV=production rake config/initializers/session_store.rb
rake generate_session_store
RAILS_ENV=production rake db:migrate

…which worked perfectly!

I started the server and it's up and running:

$ ruby script/server webrick -e production
=> Booting WEBrick
=> Rails 2.3.5 application starting on http://0.0.0.0:3000
/Library/Ruby/Gems/1.8/gems/rails-2.3.5/lib/rails/gem_dependency.rb:119:Warning: Gem::Dependency#version_requirements is deprecated and will be removed on or after August 2010.  Use #requirement
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2010-07-18 12:52:06] INFO  WEBrick 1.3.1
[2010-07-18 12:52:06] INFO  ruby 1.8.7 (2009-06-12) [universal-darwin10.0]
[2010-07-18 12:52:06] INFO  WEBrick::HTTPServer#start: pid=92444 port=3000

Nice!!

Thanks Felix for your advice regarding possible error of MySQL.

I tried to include all steps from start to end in order to help anyone else with installation errors like these to save some "googling around carbon" (every search takes 0.2g) :-).
Homebrew for Mac can be found here: [[http://github.com/mxcl/homebrew]]

RE: Problem installing on OS X - Added by Anonymous over 13 years ago

This same issue gave me a lot of trouble when trying to get Redmine running on OS X 10.6 a few weeks ago. :-P

I'm surprised it's so hard to install the MySQL gem on OS X, considering that

  • OS X is a very popular platform for Rubyists (for development, if not deployment)
  • MySQL is the most popular database for use with Rails and other web-apps

This is enough of a roadblock for running Rails on the Mac that I would have thought someone would have fixed up the gem's installation scripts to be more turn-key.

RE: Problem installing on OS X - Added by St Ev almost 13 years ago

Ru:
Добрый день, у меня аналогичная проблема, что нужно сделать?

En:
Hi, I have the same error:
what should I do?

$ RAILS_ENV=production rake db:migrate
(in /Users/stev/hosting/redmine-1.2)
rake aborted!
Object is not missing constant Issue!

(See full trace by running task with --trace)

p.s. Mac OS X 10.6.7,
rack (1.2.3, 1.1.2, 1.0.1)
rails (3.0.9, 2.3.11, 2.3.5, 1.2.6)
rake (0.8.7, 0.8.3)
rdoc (3.6.1, 2.4.2)
mysql (2.8.1)

trace by running task with --trace
....
/usr/bin/rake:19:in `load'
/usr/bin/rake:19

RE: Problem installing on OS X - Added by Alex A almost 13 years ago

You must put all trace, because it helps to solve problem.

RE: Problem installing on OS X - Added by St Ev almost 13 years ago

$ RAILS_ENV=production rake db:migrate --trace
(in /Users/stev/hosting/redmine-1.2)
  • Invoke db:migrate (first_time)
  • Invoke environment (first_time)
  • Execute environment
    rake aborted!
    Object is not missing constant Issue!
    /Library/Ruby/Gems/1.8/gems/activesupport-2.3.11/lib/active_support/dependencies.rb:443:in `load_missing_constant'
    /Library/Ruby/Gems/1.8/gems/activesupport-2.3.11/lib/active_support/dependencies.rb:106:in `const_missing'
    /Library/Ruby/Gems/1.8/gems/activesupport-2.3.11/lib/active_support/dependencies.rb:118:in `const_missing'
    /Library/Ruby/Gems/1.8/gems/activesupport-2.3.11/lib/active_support/dependencies.rb:124:in `send'
    /Library/Ruby/Gems/1.8/gems/activesupport-2.3.11/lib/active_support/dependencies.rb:124:in `const_missing'
    /Users/stev/hosting/redmine-1.2/app/models/project.rb:40
    /Library/Ruby/Site/1.8/rubygems/custom_require.rb:29:in `gem_original_require'
    /Library/Ruby/Site/1.8/rubygems/custom_require.rb:29:in `require'
    /Library/Ruby/Gems/1.8/gems/activesupport-2.3.11/lib/active_support/dependencies.rb:184:in `require'
    /Library/Ruby/Gems/1.8/gems/activesupport-2.3.11/lib/active_support/dependencies.rb:291:in `require_or_load_without_engine_additions'
    /Users/stev/hosting/redmine-1.2/vendor/plugins/engines/lib/engines/rails_extensions/dependencies.rb:132:in `require_or_load'
    /Library/Ruby/Gems/1.8/gems/activesupport-2.3.11/lib/active_support/dependencies.rb:451:in `load_missing_constant'
    /Library/Ruby/Gems/1.8/gems/activesupport-2.3.11/lib/active_support/dependencies.rb:106:in `const_missing'
    /Library/Ruby/Gems/1.8/gems/activesupport-2.3.11/lib/active_support/dependencies.rb:118:in `const_missing'
    /Library/Ruby/Gems/1.8/gems/activesupport-2.3.11/lib/active_support/dependencies.rb:463:in `load_missing_constant'
    /Library/Ruby/Gems/1.8/gems/activesupport-2.3.11/lib/active_support/dependencies.rb:122:in `const_missing'
    /Users/stev/hosting/redmine-1.2/app/models/attachment.rb:36
    /Library/Ruby/Site/1.8/rubygems/custom_require.rb:29:in `gem_original_require'
    /Library/Ruby/Site/1.8/rubygems/custom_require.rb:29:in `require'
    /Library/Ruby/Gems/1.8/gems/activesupport-2.3.11/lib/active_support/dependencies.rb:184:in `require'
    /Library/Ruby/Gems/1.8/gems/activesupport-2.3.11/lib/active_support/dependencies.rb:291:in `require_or_load_without_engine_additions'
    /Users/stev/hosting/redmine-1.2/vendor/plugins/engines/lib/engines/rails_extensions/dependencies.rb:132:in `require_or_load'
    /Library/Ruby/Gems/1.8/gems/activesupport-2.3.11/lib/active_support/dependencies.rb:451:in `load_missing_constant'
    /Library/Ruby/Gems/1.8/gems/activesupport-2.3.11/lib/active_support/dependencies.rb:106:in `const_missing'
    /Library/Ruby/Gems/1.8/gems/activesupport-2.3.11/lib/active_support/dependencies.rb:118:in `const_missing'
    /Library/Ruby/Gems/1.8/gems/activesupport-2.3.11/lib/active_support/dependencies.rb:463:in `load_missing_constant'
    /Library/Ruby/Gems/1.8/gems/activesupport-2.3.11/lib/active_support/dependencies.rb:106:in `const_missing'
    /Library/Ruby/Gems/1.8/gems/activesupport-2.3.11/lib/active_support/dependencies.rb:463:in `load_missing_constant'
    /Library/Ruby/Gems/1.8/gems/activesupport-2.3.11/lib/active_support/dependencies.rb:106:in `const_missing'
    /Library/Ruby/Gems/1.8/gems/activesupport-2.3.11/lib/active_support/dependencies.rb:463:in `load_missing_constant'
    /Library/Ruby/Gems/1.8/gems/activesupport-2.3.11/lib/active_support/dependencies.rb:106:in `const_missing'
    /Library/Ruby/Gems/1.8/gems/activesupport-2.3.11/lib/active_support/dependencies.rb:463:in `load_missing_constant'
    /Library/Ruby/Gems/1.8/gems/activesupport-2.3.11/lib/active_support/dependencies.rb:106:in `const_missing'
    /Users/stev/hosting/redmine-1.2/vendor/plugins/acts_as_attachable/lib/acts_as_attachable.rb:33:in `acts_as_attachable'
    /Users/stev/hosting/redmine-1.2/app/models/message.rb:22
    /Library/Ruby/Site/1.8/rubygems/custom_require.rb:29:in `gem_original_require'
    /Library/Ruby/Site/1.8/rubygems/custom_require.rb:29:in `require'
    /Library/Ruby/Gems/1.8/gems/activesupport-2.3.11/lib/active_support/dependencies.rb:184:in `require'
    /Library/Ruby/Gems/1.8/gems/activesupport-2.3.11/lib/active_support/dependencies.rb:291:in `require_or_load_without_engine_additions'
    /Users/stev/hosting/redmine-1.2/vendor/plugins/engines/lib/engines/rails_extensions/dependencies.rb:132:in `require_or_load'
    /Library/Ruby/Gems/1.8/gems/activesupport-2.3.11/lib/active_support/dependencies.rb:451:in `load_missing_constant'
    /Library/Ruby/Gems/1.8/gems/activesupport-2.3.11/lib/active_support/dependencies.rb:106:in `const_missing'
    /Library/Ruby/Gems/1.8/gems/activesupport-2.3.11/lib/active_support/dependencies.rb:118:in `const_missing'
    /Library/Ruby/Gems/1.8/gems/activesupport-2.3.11/lib/active_support/inflector.rb:364:in `constantize'
    /Library/Ruby/Gems/1.8/gems/activesupport-2.3.11/lib/active_support/inflector.rb:363:in `each'
    /Library/Ruby/Gems/1.8/gems/activesupport-2.3.11/lib/active_support/inflector.rb:363:in `constantize'
    /Library/Ruby/Gems/1.8/gems/activesupport-2.3.11/lib/active_support/core_ext/string/inflections.rb:162:in `constantize'
    /Library/Ruby/Gems/1.8/gems/activerecord-2.3.11/lib/active_record/observer.rb:157:in `observed_class'
    /Library/Ruby/Gems/1.8/gems/activerecord-2.3.11/lib/active_record/observer.rb:183:in `observed_classes'
    /Library/Ruby/Gems/1.8/gems/activerecord-2.3.11/lib/active_record/observer.rb:166:in `initialize'
    /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/singleton.rb:94:in `new'
    /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/singleton.rb:94:in `instance'
    /Library/Ruby/Gems/1.8/gems/activerecord-2.3.11/lib/active_record/observer.rb:38:in `instantiate_observers'
    /Library/Ruby/Gems/1.8/gems/activerecord-2.3.11/lib/active_record/observer.rb:36:in `each'
    /Library/Ruby/Gems/1.8/gems/activerecord-2.3.11/lib/active_record/observer.rb:36:in `instantiate_observers'
    /Library/Ruby/Gems/1.8/gems/actionpack-2.3.11/lib/action_controller/dispatcher.rb:15:in `define_dispatcher_callbacks'
    /Library/Ruby/Gems/1.8/gems/activesupport-2.3.11/lib/active_support/callbacks.rb:182:in `call'
    /Library/Ruby/Gems/1.8/gems/activesupport-2.3.11/lib/active_support/callbacks.rb:182:in `evaluate_method'
    /Library/Ruby/Gems/1.8/gems/activesupport-2.3.11/lib/active_support/callbacks.rb:166:in `call'
    /Library/Ruby/Gems/1.8/gems/activesupport-2.3.11/lib/active_support/callbacks.rb:90:in `run'
    /Library/Ruby/Gems/1.8/gems/activesupport-2.3.11/lib/active_support/callbacks.rb:90:in `each'
    /Library/Ruby/Gems/1.8/gems/activesupport-2.3.11/lib/active_support/callbacks.rb:90:in `send'
    /Library/Ruby/Gems/1.8/gems/activesupport-2.3.11/lib/active_support/callbacks.rb:90:in `run'
    /Library/Ruby/Gems/1.8/gems/activesupport-2.3.11/lib/active_support/callbacks.rb:276:in `run_callbacks'
    /Library/Ruby/Gems/1.8/gems/actionpack-2.3.11/lib/action_controller/dispatcher.rb:51:in `send'
    /Library/Ruby/Gems/1.8/gems/actionpack-2.3.11/lib/action_controller/dispatcher.rb:51:in `run_prepare_callbacks'
    /Library/Ruby/Gems/1.8/gems/rails-2.3.11/lib/initializer.rb:631:in `prepare_dispatcher'
    /Library/Ruby/Gems/1.8/gems/rails-2.3.11/lib/initializer.rb:185:in `process'
    /Library/Ruby/Gems/1.8/gems/rails-2.3.11/lib/initializer.rb:113:in `send'
    /Library/Ruby/Gems/1.8/gems/rails-2.3.11/lib/initializer.rb:113:in `run'
    /Users/stev/hosting/redmine-1.2/config/environment.rb:20
    /Library/Ruby/Site/1.8/rubygems/custom_require.rb:29:in `gem_original_require'
    /Library/Ruby/Site/1.8/rubygems/custom_require.rb:29:in `require'
    /Library/Ruby/Gems/1.8/gems/activesupport-2.3.11/lib/active_support/dependencies.rb:182:in `require'
    /Library/Ruby/Gems/1.8/gems/activesupport-2.3.11/lib/active_support/dependencies.rb:547:in `new_constants_in'
    /Library/Ruby/Gems/1.8/gems/activesupport-2.3.11/lib/active_support/dependencies.rb:182:in `require'
    /Library/Ruby/Gems/1.8/gems/rails-2.3.11/lib/tasks/misc.rake:4
    /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call'
    /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
    /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each'
    /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
    /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_call_chain'
    /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
    /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
    /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:607:in `invoke_prerequisites'
    /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in `each'
    /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in `invoke_prerequisites'
    /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:596:in `invoke_with_call_chain'
    /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
    /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
    /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
    /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
    /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
    /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
    /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
    /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
    /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
    /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run'
    /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
    /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
    /Library/Ruby/Gems/1.8/gems/rake-0.8.7/bin/rake:31
    /usr/bin/rake:19:in `load'
    /usr/bin/rake:19

RE: Problem installing on OS X - Added by Alex A almost 13 years ago

what databse do you use?

RE: Problem installing on OS X - Added by St Ev almost 13 years ago

$ /usr/local/mysql/bin/mysql -V
/usr/local/mysql/bin/mysql Ver 14.14 Distrib 5.5.11, for osx10.6 (i386) using readline 5.1

RE: Problem installing on OS X - Added by Alex A almost 13 years ago

It`s work correctly? Can you try to use postgresql insteed. I suppose this error links with incorrect database working.

    (1-10/10)