Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have somewhat of a complex issue involving several different programs including redmine, MySQL, Ruby, Ruby on Rails etc. This is on Windows XP.

I am following the redmine instructions here: http://www.redmine.org/projects/redmine/wiki/RedmineInstall

I am on step 5. where I am suppose to type RAILS_ENV=production rake db:migrate

When I type this in the command prompt and hit enter I get an error:

"RAILS_ENV" is not a command blah blah.

So I reorder it to: rake db:migrate RAILS_ENV=production

This seems to work correct, but I get the following:

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>

Here is my database.yml file contents:

# 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

I really need some direction here. It's almost like there is a problem with my users/passwords. I have changed the passwords not to contain "!" or any other special characters. I do have capital and lower case letters.

Any help would be greatly appreciated.

share|improve this question
    
Solved the problem, it was a password issue. Now I have a new error: Mysql::Error: query: not connected: CREATE TABLE schema_migrations (version varchar(255) NOT NULL) ENGINE=InnoDB Tasks: TOP => db:migrate – DemiSheep Oct 7 '11 at 13:53
    
Solved that problem too, now I don't have any current problems. – DemiSheep Oct 8 '11 at 12:25
    
Redmine install procedure is not very clear for beginners like me :) I recommend installing it on Windows through MS Web Platform Installer and Helicon Zoo gallery (helicontech.com/articles/…). – kokbira Jun 1 '12 at 13:53
    
The fact is managing a server is a job not a hobby, thus the majority of 'real' users of the app is already pretty good at managing mysql/apache/linux in general. – Shadok Jun 1 '12 at 15:43
up vote 2 down vote accepted

Two things here:

  • rake db:migrate RAILS_ENV=production really is different from RAILS_ENV=production rake db:migrate as the former one pass the string RAILS_ENV=production as an argument to rake while the latter declares an environnement variable in your shell. You should use export RAILS_ENV=production then run rake db:migrate in the same shell instance (console).

  • Access denied for user 'redmine'@'localhost' (using password: YES), it is pretty clear redmine is not a valid user in your mysql instance, I suppose you didn't create it before running the script. Use select * from mysql.user; to check if that user exists.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .