Проблемы с базой данных при первоначальной настройке Phusion Passenger - PullRequest
0 голосов
/ 10 мая 2010

Я новый пользователь ruby ​​/ rails, пытающийся впервые настроить мой mac с существующим проектом rails. Приложение работает нормально при использовании mongrel, но не запускается должным образом при использовании Phusion Passenger.

Проблема, кажется, при загрузке первой модели проекта. Я предполагаю, что есть проблема с доступом к моей базе данных, но я не знаю почему.

Что-то отличается между моей конфигурацией дворняги и пассажира. Возможно, rvm указывает на неправильную вещь? Возможно мои драгоценные камни отличаются как-то? Возможно, мой mysql gem установлен неправильно? А может, мой Railsenv как-то не так? Не знаю, есть идеи?

Ниже вы найдете сообщение об ошибке, а также мои различные файлы конфигурации.

Expected /Users/mike/Projects/XXX/XXX/app/models/user/identity.rb to define User::Identity
0   /Users/mike/Projects/XXX/XXX/vendor/rails/activesupport/lib/active_support/dependencies.rb  426 in `load_missing_constant'
1   /Users/mike/Projects/XXX/XXX/vendor/rails/activesupport/lib/active_support/dependencies.rb  96  in `const_missing'
2   /Users/mike/Projects/XXX/XXX/app/models/user.rb 22  
3   /Users/mike/Projects/XXX/XXX/vendor/rails/activesupport/lib/active_support/dependencies.rb  380 in `load_without_new_constant_marking'
4   /Users/mike/Projects/XXX/XXX/vendor/rails/activesupport/lib/active_support/dependencies.rb  380 in `load_file'
5   /Users/mike/Projects/XXX/XXX/vendor/rails/activesupport/lib/active_support/dependencies.rb  521 in `new_constants_in'
6   /Users/mike/Projects/XXX/XXX/vendor/rails/activesupport/lib/active_support/dependencies.rb  379 in `load_file'
7   /Users/mike/Projects/XXX/XXX/vendor/rails/activesupport/lib/active_support/dependencies.rb  259 in `require_or_load'
8   /Users/mike/Projects/XXX/XXX/vendor/rails/activesupport/lib/active_support/dependencies.rb  425 in `load_missing_constant'
9   /Users/mike/Projects/XXX/XXX/vendor/rails/activesupport/lib/active_support/dependencies.rb  80  in `rake_original_const_missing'
10  /Users/mike/Projects/XXX/XXX/vendor/gems/rake-0.8.7/lib/rake.rb 2503    in `const_missing'
11  /Users/mike/Projects/XXX/XXX/vendor/rails/activesupport/lib/active_support/dependencies.rb  92  in `const_missing'
12  /Users/mike/Projects/XXX/XXX/spec/factories/point_allocation_factory.rb 1   
13  /Users/mike/.rvm/rubies/ree-1.8.7-2010.01/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb 31  in `gem_original_require'
14  /Users/mike/.rvm/rubies/ree-1.8.7-2010.01/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb 31  in `require'
15  /Users/mike/Projects/XXX/XXX/vendor/rails/activesupport/lib/active_support/dependencies.rb  156 in `require'
16  /Users/mike/Projects/XXX/XXX/vendor/rails/activesupport/lib/active_support/dependencies.rb  521 in `new_constants_in'
17  /Users/mike/Projects/XXX/XXX/vendor/rails/activesupport/lib/active_support/dependencies.rb  156 in `require'
18  /Users/mike/Projects/XXX/XXX/vendor/gems/factory_girl-1.2.3/lib/factory_girl/factory.rb 300 in `find_definitions'
19  /Users/mike/Projects/XXX/XXX/vendor/gems/factory_girl-1.2.3/lib/factory_girl/factory.rb 299 in `each'
20  /Users/mike/Projects/XXX/XXX/vendor/gems/factory_girl-1.2.3/lib/factory_girl/factory.rb 299 in `find_definitions'
21  /Users/mike/Projects/XXX/XXX/vendor/gems/factory_girl-1.2.3/lib/factory_girl/factory.rb 295 in `each'
22  /Users/mike/Projects/XXX/XXX/vendor/gems/factory_girl-1.2.3/lib/factory_girl/factory.rb 295 in `find_definitions'
23  /Users/mike/Projects/XXX/XXX/config/environments/development.rb 26  
24  /Users/mike/Projects/XXX/XXX/vendor/rails/railties/lib/initializer.rb   592 in `call'
25  /Users/mike/Projects/XXX/XXX/vendor/rails/railties/lib/initializer.rb   592 in `after_initialize'
26  /Users/mike/Projects/XXX/XXX/vendor/rails/railties/lib/initializer.rb   591 in `each'
27  /Users/mike/Projects/XXX/XXX/vendor/rails/railties/lib/initializer.rb   591 in `after_initialize'
28  /Users/mike/Projects/XXX/XXX/vendor/rails/railties/lib/initializer.rb   177 in `process'
29  /Users/mike/Projects/XXX/XXX/vendor/rails/railties/lib/initializer.rb   113 in `send'
30  /Users/mike/Projects/XXX/XXX/vendor/rails/railties/lib/initializer.rb   113 in `run'
31  /Users/mike/Projects/XXX/XXX/config/environment.rb  12  
32  /Users/mike/.rvm/rubies/ree-1.8.7-2010.01/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb 31  in `gem_original_require'
33  /Users/mike/.rvm/rubies/ree-1.8.7-2010.01/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb 31  in `require'
34  /Users/mike/.rvm/gems/ree-1.8.7-2010.01/gems/passenger-2.2.11/lib/phusion_passenger/railz/application_spawner.rb    303 in `preload_application'
35  /Users/mike/.rvm/gems/ree-1.8.7-2010.01/gems/passenger-2.2.11/lib/phusion_passenger/railz/application_spawner.rb    252 in `initialize_server'
36  /Users/mike/.rvm/gems/ree-1.8.7-2010.01/gems/passenger-2.2.11/lib/phusion_passenger/utils.rb    255 in `report_app_init_status'
37  /Users/mike/.rvm/gems/ree-1.8.7-2010.01/gems/passenger-2.2.11/lib/phusion_passenger/railz/application_spawner.rb    237 in `initialize_server'
38  /Users/mike/.rvm/gems/ree-1.8.7-2010.01/gems/passenger-2.2.11/lib/phusion_passenger/abstract_server.rb  194 in `start_synchronously'
39  /Users/mike/.rvm/gems/ree-1.8.7-2010.01/gems/passenger-2.2.11/lib/phusion_passenger/abstract_server.rb  163 in `start'
40  /Users/mike/.rvm/gems/ree-1.8.7-2010.01/gems/passenger-2.2.11/lib/phusion_passenger/railz/application_spawner.rb    213 in `start'
41  /Users/mike/.rvm/gems/ree-1.8.7-2010.01/gems/passenger-2.2.11/lib/phusion_passenger/spawn_manager.rb    262 in `spawn_rails_application'
42  /Users/mike/.rvm/gems/ree-1.8.7-2010.01/gems/passenger-2.2.11/lib/phusion_passenger/abstract_server_collection.rb   126 in `lookup_or_add'
43  /Users/mike/.rvm/gems/ree-1.8.7-2010.01/gems/passenger-2.2.11/lib/phusion_passenger/spawn_manager.rb    256 in `spawn_rails_application'
44  /Users/mike/.rvm/gems/ree-1.8.7-2010.01/gems/passenger-2.2.11/lib/phusion_passenger/abstract_server_collection.rb   80  in `synchronize'
45  /Users/mike/.rvm/gems/ree-1.8.7-2010.01/gems/passenger-2.2.11/lib/phusion_passenger/abstract_server_collection.rb   79  in `synchronize'
46  /Users/mike/.rvm/gems/ree-1.8.7-2010.01/gems/passenger-2.2.11/lib/phusion_passenger/spawn_manager.rb    255 in `spawn_rails_application'
47  /Users/mike/.rvm/gems/ree-1.8.7-2010.01/gems/passenger-2.2.11/lib/phusion_passenger/spawn_manager.rb    154 in `spawn_application'
48  /Users/mike/.rvm/gems/ree-1.8.7-2010.01/gems/passenger-2.2.11/lib/phusion_passenger/spawn_manager.rb    287 in `handle_spawn_application'
49  /Users/mike/.rvm/gems/ree-1.8.7-2010.01/gems/passenger-2.2.11/lib/phusion_passenger/abstract_server.rb  352 in `__send__'
50  /Users/mike/.rvm/gems/ree-1.8.7-2010.01/gems/passenger-2.2.11/lib/phusion_passenger/abstract_server.rb  352 in `main_loop'
51  /Users/mike/.rvm/gems/ree-1.8.7-2010.01/gems/passenger-2.2.11/lib/phusion_passenger/abstract_server.rb  196 in `start_synchronously'
52  /Users/mike/.rvm/gems/ree-1.8.7-2010.01/gems/passenger-2.2.11/bin/passenger-spawn-server    61  

.profile

if [[ -s /Users/mike/.rvm/scripts/rvm ]] ; then source /Users/mike/.rvm/scripts/rvm ; fi

httpd.conf

LoadModule passenger_module /Users/mike/.rvm/gems/ree-1.8.7-2010.01/gems/passenger-2.2.11/ext/apache2/mod_passenger.so
PassengerRoot /Users/mike/.rvm/gems/ree-1.8.7-2010.01/gems/passenger-2.2.11
#PassengerRuby /Users/mike/.rvm/rubies/ree-1.8.7-2010.01/bin/ruby
PassengerRuby /Users/mike/.rvm/bin/passenger_ruby
RailsEnv development

HTTPD-vhosts.conf

<VirtualHost *:80>
    DocumentRoot /Library/WebServer/Documents
    ServerName localhost
</VirtualHost>

<VirtualHost *:80>
   ServerName XXX.local
   DocumentRoot /Users/mike/Projects/XXX/XXX/public/
      <Directory  /Users/mike/Projects/XXX/XXX/public/>
         AllowOverride all
         Options -MultiViews
         Allow from all
      </Directory>
</VirtualHost>

/ и т.д. / хосты

127.0.0.1       XXX.local

рамочные

  • Установка Mac Apache по умолчанию
  • Пассажир (устанавливается так: http://www.modrails.com/install.html)
  • rvm (rvm - по умолчанию ree; rvm gemset create XXX; echo "rvm ree @ XXX;"> /Users/mike/Projects/XXX/XXX/.rvmrc)
  • ree (rvm install ree)
  • mysql 5.1.46 64 от dmg (gem install mysql - --with-mysql-lib = / usr / local / mysql / lib --with-mysql-include = / usr / local / mysql / include)

1 Ответ

0 голосов
/ 10 мая 2010

Проблема была в моем файле ~ / .rvm / bin / passenger_ruby. По некоторым причинам GEM_PATH и PATH включали ree-1.8.7-2010.01 и ree-1.8.7-2010.01@global, но НЕ включали ree-1.8.7-2010.01@XXX, где я установил все свои драгоценные камни.

Добавление ree-1.8.7-2010.01@XXX к GEM_PATH и PATH устранило проблему. Я не знаю, есть ли лучшее решение.

...