Redmine MySQL rake command issue

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

I am following the redmine instructions here:

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: indefine_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.

DemiSheep

On Sep 30, 2011, at 12:35 PM, Andre F. wrote:

“RAILS_ENV” is not a command blah blah.

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

If you’re using Rails 2.x, then this should work, although you might
want to try quoting the word production in this syntax. If you’re using
Rails 3.x, then RAILS_ENV is deprecated or removed, depending on 3.0 vs
3.1. The new syntax is Rails.env, I believe.

Walter

Walter D. wrote in post #1024385:

On Sep 30, 2011, at 12:35 PM, Andre F. wrote:

“RAILS_ENV” is not a command blah blah.

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

If you’re using Rails 2.x, then this should work, although you might
want to try quoting the word production in this syntax. If you’re using
Rails 3.x, then RAILS_ENV is deprecated or removed, depending on 3.0 vs
3.1. The new syntax is Rails.env, I believe.

Walter

It’s Rails 2.3.11 as per the requirements for the version of Redmine I
am installing. Rack version 1.1.1.

Neither single or double quotes worked in either ordering of the
command.

DemiSheep

On Fri, Sep 30, 2011 at 6:54 PM, Walter Lee D.
[email protected]wrote:

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

If you’re using Rails 2.x, then this should work, although you might want
to try quoting the word production in this syntax. If you’re using Rails
3.x, then RAILS_ENV is deprecated or removed, depending on 3.0 vs 3.1. The
new syntax is Rails.env, I

believe.

I am not sure that is correct.

In rails 3.1.1.rc1 I am still able to use the RAILS_ENV=production in a
bash
shell
and it behaves as I would expect (same as 2.3 AFAICS)

peterv@ASUS:~/f$ RAILS_ENV=production
peterv@ASUS:~/f$ RAILS_ENV=production rake environment
peterv@ASUS:~/f$ RAILS_ENV=production rails c
Loading production environment (Rails 3.1.1.rc1)
001:0> quit

This is on Ubuntu 10.04 (but I presume this works generally in bash).

Peter

On Fri, Sep 30, 2011 at 6:35 PM, Andre F. [email protected]
wrote:

“RAILS_ENV” is not a command blah blah.

That is strange.

On a bash shell, with Rails 3.1.x (but also 2.3.x) I can do:

peterv@ASUS:~/f$ RAILS_ENV=production
RAILS_ENV=production
peterv@ASUS:~/f$ RAILS_ENV=production rake environment
RAILS_ENV=production rake environment
peterv@ASUS:~/f$ RAILS_ENV=production rails c
RAILS_ENV=production rails c
Loading production environment (Rails 3.1.1.rc1)
001:0> quit

Could you paste literally the output of

$ bash -v
$ RAILS_ENV=production
$ RAILS_ENV=production rake environment # this will probably fail on
your
system

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)

username: redmine

###############################################################

It looks like you are actually using the production environment (good).

Could you verify that this works then:

$ mysql -h localhost -u redmine -p redmine
Enter password:

HTH,

Peter

On Sat, Oct 1, 2011 at 4:05 PM, Walter Lee D. [email protected]
wrote:

I am on step 5. where I am suppose to type "RAILS_ENV=production rake
quoting the value, not the name of the variable.

Walter

Walter, could it be that there is something incorrect in the quoting
depth
of our conversation?

The text that is quoted above (“I have a somewhat … blah blah”)
was not written by me (Peter), but by the Original Poster (Andre).

However, the way I see it quoted in your reply, it looks as if I (Peter)
wrote that and it also looks as if you addressing your advice to
me (which is friendly but not very relevant for the OP).

I think (but could be wrong) that the section under the line

On Fri, Sep 30, 2011 at 6:35 PM, Andre F. [email protected] wrote:

should have been 1 more level indented to the right in your recent reply
(of Oct 1, 14:05 UTC). So it should have been indented with >> Like
this:

On Fri, Sep 30, 2011 at 6:35 PM, Andre F. [email protected] wrote:

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

I think this is relevant to clearly understand who wrote what in a
conversation.

Thanks,

Peter

On Oct 1, 2011, at 8:49 AM, Peter V. wrote:

When I type this in the command prompt and hit enter I get an error:
“RAILS_ENV” is not a command blah blah.

Sorry, I think you typed “RAILS_ENV” and what I meant was

RAILS_ENV=“production”

quoting the value, not the name of the variable.

Walter

Thanks guys for your responses and I appologize for the delay in getting
back here, I only work on this once a week. I just got past that error,
it was a problem with my password, inside my database file for redmine,
database.yml.

Now I am getting this error:

C:\redmine-1.2.1>rake db:migrate RAILS_ENV=production
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 rake aborted! Mysql::Error: query: not connected: CREATE TABLEschema_migrations(version`
varchar(255) NOT NULL) ENGINE=InnoDB

Tasks: TOP => db:migrate
(See full trace by running task with --trace)

C:\redmine-1.2.1>rake db:migrate RAILS_ENV=production

btw, I am using Windows XP, so there is no bash etc.

On Oct 1, 2011, at 10:36 AM, Peter V. wrote:

I am on step 5. where I am suppose to type "RAILS_ENV=production rake
quoting the value, not the name of the variable.
wrote that and it also looks as if you addressing your advice to

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

I think this is relevant to clearly understand who wrote what in a conversation.

Thanks for pointing this out, indeed I was trying to reply to the OP.

Walter

Please add development details in your database config file.