How to enable production enviornment in RoR 2.3.5

I want to enable production enviornment for my appication.The content
of
database.yml file is as

SQLite version 3.x

gem install sqlite3-ruby (not necessary on OS X Leopard)

development:
adapter: mysql
database: amritpal
username: root
password: 12345
pool: 5
timeout: 5000

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: sqlite3
database: db/test.sqlite3
pool: 5
timeout: 5000

production:
adapter: mysql
database: production
username: root
password: 12345
pool: 5
timeout: 5000

                       I ran "RAILS_ENV=production rake  db:create 

",it
created a production database.Here is assume that the production
enviornment
is enable(But i was wrong).Then i created a simple scaffold as.

                 script/generate scaffold person firstname:string

lastname:string;

                 rake db:migrate(it created a table named"people"

in amritpal database that is used in development envionrment.But in
production enviornment ,the database production hasn’t any talbe)

How to enable it?

Thanks

On 20 April 2011 17:21, amritpal pathak [email protected]
wrote:

password: 12345
timeout: 5000
created a production database.Here is assume that the production enviornment
is enable(But i was wrong).Then i created a simple scaffold as.

      script/generate scaffold person firstname:string

lastname:string;

      rake db:migrate(it created a table named"people"

inamritpal database that is used in development envionrment.But in
production enviornment ,the database production hasn’t any talbe)

How to enable it?

How many times do I have to tell you?
RAILS_ENV=production rake db:migrate
will run the migrations on the production database.

If you do not understand or it does not work please say what you are
having difficulty with.

Colin

On Wed, Apr 20, 2011 at 11:21 AM, amritpal pathak
<[email protected]

wrote:

password: 12345
timeout: 5000
created a production database.Here is assume that the production enviornment

Thanks

I believe Colin already discussed with with you in another thread.

"As I have tried to explain several times the value of RAILS_ENV
determines which environment will be used when you execute a rake
command. The environment defaults to development. So:

rake db:migrate will migrate the development db.

RAILS_ENV=production rake db:migrate
will migrate the production db.

Colin "

If you are looking to be always running in production mode and never in
any
other mode then my advice would be the set the environment variable
RAILS_ENV on your system to production.

RAILS_ENV=production

You can look up how to do that for your OS anywhere on the internet.

B.

On Apr 20, 1:01pm, Bryan C. [email protected] wrote:

wrote:
password: 12345
timeout: 5000
created a production database.Here is assume that the production enviornment

RAILS_ENV=production rake db:migrate
You can look up how to do that for your OS anywhere on the internet.
At other thread ,i followed collin instrutions but at last i
strucked a error to which i didnt receive a reply yet.So i post a new
thread.Please look at that thread and see if you can help
http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/d911b888dbd30c58

Thanks

On Apr 20, 12:36pm, Colin L. [email protected] wrote:

I want to enable production enviornment for my appication.The content of
pool: 5

is enable(But i was wrong).Then i created a simple scaffold as.
How many times do I have to tell you?
RAILS_ENV=production rake db:migrate
will run the migrations on the production database.

i ran " RAILS_ENV=production rake
db:create “,it created a production database.I hope now the prduction
enviornment is enable
If you do not understand or it does not work please say what you are
having difficulty with.
Then i ran script/generate scaffold person firstname:string
lastname:string;
rake db:migrate(it created a table named"people”
in
production database .Then i put some entries into form and try to
check table at back end(mysql) and did
use production
select * from people(it gave table is
empty) why?
but all entries went into amritpal database that is being used in
deveoplement phase,why?

Thanks

On 21 April 2011 12:42, amrit pal pathak [email protected]
wrote:


Then i put some entries into form and try to
check table at back end(mysql) and did
use production
select * from people(it gave table is
empty) why?
but all entries went into amritpal database that is being used in
deveoplement phase,why?

Did you remember to start the server in production mode? How to do
this was one of the very first questions you asked. In case you have
lost the answer, use -e production when you start the server.

Colin

On Apr 21, 8:40am, Colin L. [email protected] wrote:

Did you remember to start the server in production mode? How to do
this was one of the very first questions you asked. In case you have
lost the answer, use -e production when you start the server.

Thank you very much collin.
Great!!!

On 20 Apr 2011, at 18:22, amrit pal pathak [email protected]
wrote:

re-generated from your development database when you run “rake”.

username: root

"As I have tried to explain several times the value of RAILS_ENV
If you are looking to be always running in production mode and never in any
other mode then my advice would be the set the environment variable
RAILS_ENV on your system to production.

RAILS_ENV=production

You can look up how to do that for your OS anywhere on the internet.
At other thread ,i followed collin instrutions but at last i
strucked a error to which i didnt receive a reply yet.So i post a new
thread.Please look at that thread and see if you can help

Next time try looking at the second page of the thread - Colin replied
yesterday. Even if he hadn’t, proliferation of identical threads helps
no-one.

Fred

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs