1

У меня есть несколько сложных вопросов, связанных с несколькими различными программами, включая Redmine, MySQL, Ruby, Ruby on Rails и т.д. Это на Windows XP.

Я следую инструкциям Redmine здесь: http://www.redmine.org/projects/redmine/wiki/RedmineInstall

Я на шаге 5. где я должен набрать RAILS_ENV=production rake db:migrate

Когда я набираю это в командной строке и нажимаю ввод, я получаю сообщение об ошибке:

"RAILS_ENV" не команда бла-бла.

Поэтому я переупорядочиваю его следующим образом: rake db:migrate RAILS_ENV=production

Кажется, это работает правильно, но я получаю следующее:

C:\redmine-1.2.1>rake db:migrate RAILS_ENV=production --trace
NOTE: SourceIndex.new(hash) is deprecated; From C:/redmine-1.2.1/config/../vendo
r/rails/railties/lib/rails/vendor_gem_source_index.rb:100:in `new'.
rake/rdoctask is deprecated. Use rdoc/task instead (in RDoc 2.4.2+)
WARNING: 'task :t, arg, :needs => [deps]' is deprecated. Please use 'task :t, [
args] => [deps]' instead.
at C:/redmine-1.2.1/lib/tasks/email.rake:170

    * Invoke db:migrate (first_time)
    * Invoke environment (first_time)
    * Execute environment
      rake aborted!
      Access denied for user 'redmine'@'localhost' (using password: YES)
      C:/redmine-1.2.1/vendor/rails/activerecord/lib/active_record/connection_adapters
      /mysql_adapter.rb:620:in `real_connect'
      C:/redmine-1.2.1/vendor/rails/activerecord/lib/active_record/connection_adapters
      /mysql_adapter.rb:620:in `connect'
      C:/redmine-1.2.1/vendor/rails/activerecord/lib/active_record/connection_adapters
      /mysql_adapter.rb:203:in `initialize'
      C:/redmine-1.2.1/vendor/rails/activerecord/lib/active_record/connection_adapters
      /mysql_adapter.rb:75:in `new'
      C:/redmine-1.2.1/vendor/rails/activerecord/lib/active_record/connection_adapters
      /mysql_adapter.rb:75:in `mysql_connection'
      C:/redmine-1.2.1/vendor/rails/activerecord/lib/active_record/connection_adapters
      /abstract/connection_pool.rb:223:in `send'
      C:/redmine-1.2.1/vendor/rails/activerecord/lib/active_record/connection_adapters
      /abstract/connection_pool.rb:223:in `new_connection'
      C:/redmine-1.2.1/vendor/rails/activerecord/lib/active_record/connection_adapters
      /abstract/connection_pool.rb:245:in `checkout_new_connection'
      C:/redmine-1.2.1/vendor/rails/activerecord/lib/active_record/connection_adapters
      /abstract/connection_pool.rb:188:in `checkout'
      C:/redmine-1.2.1/vendor/rails/activerecord/lib/active_record/connection_adapters
      /abstract/connection_pool.rb:184:in `loop'
      C:/redmine-1.2.1/vendor/rails/activerecord/lib/active_record/connection_adapters
      /abstract/connection_pool.rb:184:in `checkout'
      C:/Ruby187/lib/ruby/1.8/monitor.rb:242:in `synchronize'
      C:/redmine-1.2.1/vendor/rails/activerecord/lib/active_record/connection_adapters
      /abstract/connection_pool.rb:183:in `checkout'
      C:/redmine-1.2.1/vendor/rails/activerecord/lib/active_record/connection_adapters
      /abstract/connection_pool.rb:98:in `connection'
      C:/redmine-1.2.1/vendor/rails/activerecord/lib/active_record/connection_adapters
      /abstract/connection_pool.rb:326:in `retrieve_connection'
      C:/redmine-1.2.1/vendor/rails/activerecord/lib/active_record/connection_adapters
      /abstract/connection_specification.rb:123:in `retrieve_connection'
      C:/redmine-1.2.1/vendor/rails/activerecord/lib/active_record/connection_adapters
      /abstract/connection_specification.rb:115:in `connection'
      C:/redmine-1.2.1/vendor/plugins/awesome_nested_set/lib/awesome_nested_set.rb:217
      :in `quoted_left_column_name'
      C:/redmine-1.2.1/vendor/plugins/awesome_nested_set/lib/awesome_nested_set.rb:93:
      in `acts_as_nested_set'
      C:/redmine-1.2.1/app/models/issue.rb:37
      C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:53:in `gem_original
      _require'
      C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:53:in `require'
      C:/redmine-1.2.1/vendor/rails/activesupport/lib/active_support/dependencies.rb:1
      84:in `require'
      C:/redmine-1.2.1/vendor/rails/activesupport/lib/active_support/dependencies.rb:2
      91:in `require_or_load_without_engine_additions'
      C:/redmine-1.2.1/vendor/plugins/engines/lib/engines/rails_extensions/dependencie
      s.rb:132:in `require_or_load'
      C:/redmine-1.2.1/vendor/rails/activesupport/lib/active_support/dependencies.rb:4
      51:in `load_missing_constant'
      C:/redmine-1.2.1/vendor/rails/activesupport/lib/active_support/dependencies.rb:1
      06:in `const_missing'
      C:/redmine-1.2.1/vendor/rails/activesupport/lib/active_support/dependencies.rb:1
      18:in `const_missing'
      C:/redmine-1.2.1/vendor/rails/activesupport/lib/active_support/dependencies.rb:4
      63:in `load_missing_constant'
      C:/redmine-1.2.1/vendor/rails/activesupport/lib/active_support/dependencies.rb:1
      22:in `const_missing'
      C:/redmine-1.2.1/app/models/project.rb:40
      C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:53:in `gem_original
      _require'
      C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:53:in `require'
      C:/redmine-1.2.1/vendor/rails/activesupport/lib/active_support/dependencies.rb:1
      84:in `require'
      C:/redmine-1.2.1/vendor/rails/activesupport/lib/active_support/dependencies.rb:2
      91:in `require_or_load_without_engine_additions'
      C:/redmine-1.2.1/vendor/plugins/engines/lib/engines/rails_extensions/dependencie
      s.rb:132:in `require_or_load'
      C:/redmine-1.2.1/vendor/rails/activesupport/lib/active_support/dependencies.rb:4
      51:in `load_missing_constant'
      C:/redmine-1.2.1/vendor/rails/activesupport/lib/active_support/dependencies.rb:1
      06:in `const_missing'
      C:/redmine-1.2.1/vendor/rails/activesupport/lib/active_support/dependencies.rb:1
      18:in `const_missing'
      C:/redmine-1.2.1/vendor/rails/activesupport/lib/active_support/dependencies.rb:4
      63:in `load_missing_constant'
      C:/redmine-1.2.1/vendor/rails/activesupport/lib/active_support/dependencies.rb:1
      22:in `const_missing'
      C:/redmine-1.2.1/app/models/attachment.rb:36
      C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:53:in `gem_original
      _require'
      C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:53:in `require'
      C:/redmine-1.2.1/vendor/rails/activesupport/lib/active_support/dependencies.rb:1
      84:in `require'
      C:/redmine-1.2.1/vendor/rails/activesupport/lib/active_support/dependencies.rb:2
      91:in `require_or_load_without_engine_additions'
      C:/redmine-1.2.1/vendor/plugins/engines/lib/engines/rails_extensions/dependencie
      s.rb:132:in `require_or_load'
      C:/redmine-1.2.1/vendor/rails/activesupport/lib/active_support/dependencies.rb:4
      51:in `load_missing_constant'
      C:/redmine-1.2.1/vendor/rails/activesupport/lib/active_support/dependencies.rb:1
      06:in `const_missing'
      C:/redmine-1.2.1/vendor/rails/activesupport/lib/active_support/dependencies.rb:1
      18:in `const_missing'
      C:/redmine-1.2.1/vendor/rails/activesupport/lib/active_support/dependencies.rb:4
      63:in `load_missing_constant'
      C:/redmine-1.2.1/vendor/rails/activesupport/lib/active_support/dependencies.rb:1
      06:in `const_missing'
      C:/redmine-1.2.1/vendor/rails/activesupport/lib/active_support/dependencies.rb:4
      63:in `load_missing_constant'
      C:/redmine-1.2.1/vendor/rails/activesupport/lib/active_support/dependencies.rb:1
      06:in `const_missing'
      C:/redmine-1.2.1/vendor/rails/activesupport/lib/active_support/dependencies.rb:4
      63:in `load_missing_constant'
      C:/redmine-1.2.1/vendor/rails/activesupport/lib/active_support/dependencies.rb:1
      06:in `const_missing'
      C:/redmine-1.2.1/vendor/rails/activesupport/lib/active_support/dependencies.rb:4
      63:in `load_missing_constant'
      C:/redmine-1.2.1/vendor/rails/activesupport/lib/active_support/dependencies.rb:1
      06:in `const_missing'
      C:/redmine-1.2.1/vendor/plugins/acts_as_attachable/lib/acts_as_attachable.rb:33:
      in `acts_as_attachable'
      C:/redmine-1.2.1/app/models/message.rb:22
      C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:53:in `gem_original
      _require'
      C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:53:in `require'
      C:/redmine-1.2.1/vendor/rails/activesupport/lib/active_support/dependencies.rb:1
      84:in `require'
      C:/redmine-1.2.1/vendor/rails/activesupport/lib/active_support/dependencies.rb:2
      91:in `require_or_load_without_engine_additions'
      C:/redmine-1.2.1/vendor/plugins/engines/lib/engines/rails_extensions/dependencie
      s.rb:132:in `require_or_load'
      C:/redmine-1.2.1/vendor/rails/activesupport/lib/active_support/dependencies.rb:4
      51:in `load_missing_constant'
      C:/redmine-1.2.1/vendor/rails/activesupport/lib/active_support/dependencies.rb:1
      06:in `const_missing'
      C:/redmine-1.2.1/vendor/rails/activesupport/lib/active_support/dependencies.rb:1
      18:in `const_missing'
      C:/redmine-1.2.1/vendor/rails/activesupport/lib/active_support/inflector.rb:364:
      in `constantize'
      C:/redmine-1.2.1/vendor/rails/activesupport/lib/active_support/inflector.rb:363:
      in `each'
      C:/redmine-1.2.1/vendor/rails/activesupport/lib/active_support/inflector.rb:363:
      in `constantize'
      C:/redmine-1.2.1/vendor/rails/activesupport/lib/active_support/core_ext/string/i
      nflections.rb:162:in `constantize'
      C:/redmine-1.2.1/vendor/rails/activerecord/lib/active_record/observer.rb:157:in
      `observed_class'
      C:/redmine-1.2.1/vendor/rails/activerecord/lib/active_record/observer.rb:183:in
      `observed_classes'
      C:/redmine-1.2.1/vendor/rails/activerecord/lib/active_record/observer.rb:166:in
      `initialize'
      C:/Ruby187/lib/ruby/1.8/singleton.rb:94:in `new'
      C:/Ruby187/lib/ruby/1.8/singleton.rb:94:in `instance'
      C:/redmine-1.2.1/vendor/rails/activerecord/lib/active_record/observer.rb:38:in `
      instantiate_observers'
      C:/redmine-1.2.1/vendor/rails/activerecord/lib/active_record/observer.rb:36:in `
      each'
      C:/redmine-1.2.1/vendor/rails/activerecord/lib/active_record/observer.rb:36:in `
      instantiate_observers'
      C:/redmine-1.2.1/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:15:
      in `define_dispatcher_callbacks'
      C:/redmine-1.2.1/vendor/rails/activesupport/lib/active_support/callbacks.rb:182:
      in `call'
      C:/redmine-1.2.1/vendor/rails/activesupport/lib/active_support/callbacks.rb:182:
      in `evaluate_method'
      C:/redmine-1.2.1/vendor/rails/activesupport/lib/active_support/callbacks.rb:166:
      in `call'
      C:/redmine-1.2.1/vendor/rails/activesupport/lib/active_support/callbacks.rb:90:i
      n `run'
      C:/redmine-1.2.1/vendor/rails/activesupport/lib/active_support/callbacks.rb:90:i
      n `each'
      C:/redmine-1.2.1/vendor/rails/activesupport/lib/active_support/callbacks.rb:90:i
      n `send'
      C:/redmine-1.2.1/vendor/rails/activesupport/lib/active_support/callbacks.rb:90:i
      n `run'
      C:/redmine-1.2.1/vendor/rails/activesupport/lib/active_support/callbacks.rb:276:
      in `run_callbacks'
      C:/redmine-1.2.1/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:51:
      in `send'
      C:/redmine-1.2.1/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:51:
      in `run_prepare_callbacks'
      C:/redmine-1.2.1/config/../vendor/rails/railties/lib/initializer.rb:631:in `prep
      are_dispatcher'
      C:/redmine-1.2.1/config/../vendor/rails/railties/lib/initializer.rb:185:in `proc
      ess'
      C:/redmine-1.2.1/config/../vendor/rails/railties/lib/initializer.rb:113:in `send
      '
      C:/redmine-1.2.1/config/../vendor/rails/railties/lib/initializer.rb:113:in `run'

C:/redmine-1.2.1/config/environment.rb:20
C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original
require'
C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
C:/redmine-1.2.1/vendor/rails/activesupport/lib/active_support/dependencies.rb:1
82:in `require'
C:/redmine-1.2.1/vendor/rails/activesupport/lib/active_support/dependencies.rb:5
47:in `new_constants_in'
C:/redmine-1.2.1/vendor/rails/activesupport/lib/active_support/dependencies.rb:1
82:in `require'
C:/redmine-1.2.1/vendor/rails/railties/lib/tasks/misc.rake:4
C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:205:in `call'
C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:205:in `execute'
C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:200:in `each'
C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:200:in `execute'
C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:158:in `invoke_wit
h_call_chain'
C:/Ruby187/lib/ruby/1.8/monitor.rb:242:in `synchronize'
C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_wit
h_call_chain'
C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:176:in `invoke_pre
requisites'
C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:174:in `each'
C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:174:in `invoke_pre
requisites'
C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:157:in `invoke_wit
h_call_chain'
C:/Ruby187/lib/ruby/1.8/monitor.rb:242:in `synchronize'
C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_wit
h_call_chain'
C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:144:in `invoke'
C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:112:in `inv
oke_task'
C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:90:in `top
level'
C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:90:in `each
'
C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:90:in `top_
level'
C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:129:in `sta
ndard_exception_handling'
C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:84:in `top_
level'
C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:62:in `run'

C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:129:in `sta
ndard_exception_handling'
C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:59:in `run'

C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.9.2/bin/rake:32
C:/Ruby187/bin/rake:19:in `load'
C:/Ruby187/bin/rake:19
Tasks: TOP => db:migrate => environment

C:\redmine-1.2.1>

Вот мое содержимое файла database.yml:

# MySQL (default setup).

production:
adapter: mysql
database: redmine
host: localhost
username: redmine
password: ****
encoding: utf8

development:
adapter: mysql
database: redmine_development
host: localhost
username: root
password:
encoding: utf8

   # Warning: The database defined as "test" will be erased and
   # re-generated from your development database when you run "rake".
   # Do not set this db to the same as development or production.
      test:
      adapter: mysql
      database: redmine_test
      host: localhost
      username: root
      password:
      encoding: utf8

test_pgsql:
adapter: postgresql
database: redmine_test
host: localhost
username: postgres
password: "postgres"

test_sqlite3:
adapter: sqlite3
database: db/test.sqlite3

Мне действительно нужно какое-то направление здесь. Это похоже на проблему с моими пользователями / паролями. Я изменил пароли, чтобы не содержать "!"или любые другие специальные символы. У меня есть заглавные и строчные буквы.

Любая помощь будет принята с благодарностью.

1 ответ1

2

Две вещи здесь:

  • rake db:migrate RAILS_ENV=production действительно отличается от RAILS_ENV=production rake db:migrate как первый передает строку RAILS_ENV=production в качестве аргумента для rake, а последний объявляет переменную окружения в вашей оболочке. Вы должны использовать export RAILS_ENV=production затем запустить rake db:migrate в том же экземпляре оболочки (консоли).

  • Access denied for user 'redmine'@'localhost' (using password: YES) , совершенно очевидно, что redmine не является допустимым пользователем в вашем экземпляре mysql, я полагаю, вы не создавали его до запуска скрипта. Используйте select * from mysql.user; проверить, существует ли этот пользователь.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками .