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

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

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 Davis wrote in post #1024385:

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

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:

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.

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

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)

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

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

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

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

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

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:

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.

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

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

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:

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

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

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

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:

>> 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

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 TABLE `schema_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.

Please add development details in your database config file.