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 -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 20 April 2011 17:21, amritpal pathak <amritpalpathak1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 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?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 -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Bryan Crossland
2011-Apr-20 17:01 UTC
Re: How to enable production enviornment in RoR 2.3.5
On Wed, Apr 20, 2011 at 11:21 AM, amritpal pathak <amritpalpathak1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 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 > > >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. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
amrit pal pathak
2011-Apr-20 17:22 UTC
Re: How to enable production enviornment in RoR 2.3.5
On Apr 20, 1:01 pm, Bryan Crossland <bacrossl...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Wed, Apr 20, 2011 at 11:21 AM, amritpal pathak <amritpalpath...@gmail.com > > > > > > > > > > > wrote: > > 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 > > 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.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 -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Frederick Cheung
2011-Apr-20 17:55 UTC
Re: Re: How to enable production enviornment in RoR 2.3.5
On 20 Apr 2011, at 18:22, amrit pal pathak <amritpalpathak1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > On Apr 20, 1:01 pm, Bryan Crossland <bacrossl...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> On Wed, Apr 20, 2011 at 11:21 AM, amritpal pathak <amritpalpath...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org >> >>> wrote: >>> 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 >> >> 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. > 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 helpNext 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> http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/d911b888dbd30c58 > > Thanks > > -- > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
amrit pal pathak
2011-Apr-21 11:42 UTC
Re: How to enable production enviornment in RoR 2.3.5
On Apr 20, 12:36 pm, Colin Law <clan...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> On 20 April 2011 17:21, amritpal pathak <amritpalpath...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > > > > > 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? > > 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 rakedb: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 -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 21 April 2011 12:42, amrit pal pathak <amritpalpathak1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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 -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
amrit pal pathak
2011-Apr-21 14:25 UTC
Re: How to enable production enviornment in RoR 2.3.5
On Apr 21, 8:40 am, Colin Law <clan...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> On 21 April 2011 12:42, amrit pal pathak <amritpalpath...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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.Thank you very much collin. Great!!! -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.