Hi All, It is my understanding that there are 3 environments built-in to Rails (Test, Development[default], Production). Can someone please explain exactly how you switch between them (specially between Development and Production)? Let''s say I use the default Sqlite3 database for both Development and Production; what are the exact steps to push out the completed site so it''s viewable via Apache web server (instead of WEBrick) Please excuse my ignorance but it seems rather difficult to find a concise answer to this question anywhere. Thank You Very Much. ~Kal -- 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 Tue, Apr 17, 2012 at 8:02 PM, Kal <calcruby-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> It is my understanding that there are 3 environments built-in to Rails > (Test, Development[default], Production). > > Can someone please explain exactly how you switch between them > (specially between Development and Production)?bundle exec rails s # starts development RAILS_ENV=production bundle exec rails s # starts production (simplistically - varies depending on web server/platform)> Let''s say I use the default Sqlite3 database for both Development and > Production;You almost certainly don''t want to use the same DB instance for both.> what are the exact steps to push out the completed site so > it''s viewable via Apache web server (instead of WEBrick)What do you mean by "push out"? Where are you doing your coding and testing, and where do you intend to run production? And the choice of web server has nothing to do with the question of development/test/production mode.> Please excuse my ignorance but it seems rather difficult to find a > concise answer to this question anywhere.Maybe because you''re conflating multiple activities/concepts. -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org http://about.me/hassanschroeder twitter: @hassan -- 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.
First of all, thank you Hassan. Why "bundle execute"? What does that do? I don''t mean database instance. I mean a scenario where I''m using Sqlite3 application for both Development and Production. By "push out", I mean after you''ve finished the application development (which can be viewed using port 3000), how do we then "migrate" the finished production into production? I most likely have multiple concepts confused but I certainly do appreciate you taking the time to clarify. Thank Again, ~Kal On Apr 18, 12:48 am, Hassan Schroeder <hassan.schroe...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Tue, Apr 17, 2012 at 8:02 PM, Kal <calcr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > It is my understanding that there are 3 environments built-in to Rails > > (Test, Development[default], Production). > > > Can someone please explain exactly how you switch between them > > (specially between Development and Production)? > > bundle exec rails s # starts development > RAILS_ENV=production bundle exec rails s # starts production > > (simplistically - varies depending on web server/platform) > > > Let''s say I use the default Sqlite3 database for both Development and > > Production; > > You almost certainly don''t want to use the same DB instance for both. > > > what are the exact steps to push out the completed site so > > it''s viewable via Apache web server (instead of WEBrick) > > What do you mean by "push out"? Where are you doing your > coding and testing, and where do you intend to run production? > > And the choice of web server has nothing to do with the question > of development/test/production mode. > > > Please excuse my ignorance but it seems rather difficult to find a > > concise answer to this question anywhere. > > Maybe because you''re conflating multiple activities/concepts. > > -- > Hassan Schroeder ------------------------ hassan.schroe...-Re5JQEeQqe80Tx58lXaADg@public.gmane.org://about.me/hassanschroeder > twitter: @hassan-- 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 Tue, Apr 17, 2012 at 10:05 PM, Kal <calcruby-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Why "bundle execute"? What does that do?`bundle exec> I don''t mean database instance. I mean a scenario where I''m using > Sqlite3 application for both Development and Production. > > By "push out", I mean after you''ve finished the application > development (which can be viewed using port 3000), how do we then > "migrate" the finished production into production? > > I most likely have multiple concepts confused but I certainly do > appreciate you taking the time to clarify. > > Thank Again, > > ~Kal > > On Apr 18, 12:48 am, Hassan Schroeder <hassan.schroe...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: >> On Tue, Apr 17, 2012 at 8:02 PM, Kal <calcr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> > It is my understanding that there are 3 environments built-in to Rails >> > (Test, Development[default], Production). >> >> > Can someone please explain exactly how you switch between them >> > (specially between Development and Production)? >> >> bundle exec rails s # starts development >> RAILS_ENV=production bundle exec rails s # starts production >> >> (simplistically - varies depending on web server/platform) >> >> > Let''s say I use the default Sqlite3 database for both Development and >> > Production; >> >> You almost certainly don''t want to use the same DB instance for both. >> >> > what are the exact steps to push out the completed site so >> > it''s viewable via Apache web server (instead of WEBrick) >> >> What do you mean by "push out"? Where are you doing your >> coding and testing, and where do you intend to run production? >> >> And the choice of web server has nothing to do with the question >> of development/test/production mode. >> >> > Please excuse my ignorance but it seems rather difficult to find a >> > concise answer to this question anywhere. >> >> Maybe because you''re conflating multiple activities/concepts. >> >> -- >> Hassan Schroeder ------------------------ hassan.schroe...-Re5JQEeQqe80Tx58lXaADg@public.gmane.org://about.me/hassanschroeder >> twitter: @hassan > > -- > 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. >-- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org http://about.me/hassanschroeder twitter: @hassan -- 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.
/* sorry for the near-empty response - fat-fingered it */ On Tue, Apr 17, 2012 at 10:05 PM, Kal <calcruby-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Why "bundle execute"? What does that do?`bundle exec` runs your app with the gems specifically described in your Gemfile.> I don''t mean database instance. I mean a scenario where I''m using > Sqlite3 application for both Development and Production.Probably still not a great idea unless the production instance will be very lightly loaded.> By "push out", I mean after you''ve finished the application > development (which can be viewed using port 3000), how do we then > "migrate" the finished production into production?What exactly do you mean by "production"? Is this an Intranet app for your company, an application for a wide Internet public, or ____? If it''s a public app, you need to decide on hosting; there''s a range of options, from having your own server in a datacenter to using a cloud provider like AWS or Heroku. If it''s company-internal, you still need a server, but the options may be more limited :-) That''s a decision that''s only slightly related to Rails, though. -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org http://about.me/hassanschroeder twitter: @hassan -- 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.
Thanks Hassan, This is exactly what I don''t get! The "Development" environment is the default environment in Rails, yes? Now, that means my data is contained in development.sqlite3 and ''rails server'' starts WEBrick and so we can view the site from www.homepage.com:3000. The step after this is precisely what I''m missing... because nobody talks about it... all the books and guides pretty much stop short of this... So this is my question: How do I move everything to the "production environment". I''d imagine that is the ultimate goal, is it not? How do I copy the data to production.sqlite3 (just issue: rake db:migrate RAILS_ENV=production) and have all the code (which I created in the Development Env) working in the "Production" environment so it doesn''t have to be served out using WEBRick. Thanks Much, ~Kal It''s just a test app. However, my plan is to deploy a web application on a public website... someday :) --------------------------------------------------------------------------------------------------------------- By the way, I''m running: Ruby 1.9.3p0 Rails 3.1.3 Phusion Passenger version 3.0.11 CentOS release 5.6 Server version: Apache/2.2.3 ---------------------------------------------- On Apr 18, 2:42 am, Hassan Schroeder <hassan.schroe...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> /* sorry for the near-empty response - fat-fingered it */ > > On Tue, Apr 17, 2012 at 10:05 PM, Kal <calcr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Why "bundle execute"? What does that do? > > `bundle exec` runs your app with the gems specifically described in > your Gemfile. > > > I don''t mean database instance. I mean a scenario where I''m using > > Sqlite3 application for both Development and Production. > > Probably still not a great idea unless the production instance will > be very lightly loaded. > > > By "push out", I mean after you''ve finished the application > > development (which can be viewed using port 3000), how do we then > > "migrate" the finished production into production? > > What exactly do you mean by "production"? Is this an Intranet app > for your company, an application for a wide Internet public, or ____? > > If it''s a public app, you need to decide on hosting; there''s a range of > options, from having your own server in a datacenter to using a cloud > provider like AWS or Heroku. If it''s company-internal, you still need a > server, but the options may be more limited :-) > > That''s a decision that''s only slightly related to Rails, though. > > -- > Hassan Schroeder ------------------------ hassan.schroe...-Re5JQEeQqe80Tx58lXaADg@public.gmane.org://about.me/hassanschroeder > twitter: @hassan-- 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.
http://stackoverflow.com/questions/7291381/rails-how-to-migrate-data-from-development-sqlite3-database-to-production-mysql....this may be helpful to migrate from development to production. On Wed, Apr 18, 2012 at 12:29 PM, Kal <calcruby-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Thanks Hassan, > > This is exactly what I don''t get! > > The "Development" environment is the default environment in Rails, > yes? > > Now, that means my data is contained in development.sqlite3 and ''rails > server'' starts WEBrick and so we can view the site from > www.homepage.com:3000. > > The step after this is precisely what I''m missing... because nobody > talks about it... all the books and guides pretty much stop short of > this... > > So this is my question: How do I move everything to the "production > environment". I''d imagine that is the ultimate goal, is it not? > > How do I copy the data to production.sqlite3 (just issue: rake > db:migrate RAILS_ENV=production) and have all the code (which I > created in the Development Env) working in the "Production" > environment so it doesn''t have to be served out using WEBRick. > > Thanks Much, > > ~Kal > > It''s just a test app. However, my plan is to deploy a web application > on a public website... someday :) > > --------------------------------------------------------------------------------------------------------------- > > By the way, I''m running: > > Ruby 1.9.3p0 > Rails 3.1.3 > Phusion Passenger version 3.0.11 > CentOS release 5.6 > Server version: Apache/2.2.3 > > ---------------------------------------------- > > > On Apr 18, 2:42 am, Hassan Schroeder <hassan.schroe...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > > /* sorry for the near-empty response - fat-fingered it */ > > > > On Tue, Apr 17, 2012 at 10:05 PM, Kal <calcr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Why "bundle execute"? What does that do? > > > > `bundle exec` runs your app with the gems specifically described in > > your Gemfile. > > > > > I don''t mean database instance. I mean a scenario where I''m using > > > Sqlite3 application for both Development and Production. > > > > Probably still not a great idea unless the production instance will > > be very lightly loaded. > > > > > By "push out", I mean after you''ve finished the application > > > development (which can be viewed using port 3000), how do we then > > > "migrate" the finished production into production? > > > > What exactly do you mean by "production"? Is this an Intranet app > > for your company, an application for a wide Internet public, or ____? > > > > If it''s a public app, you need to decide on hosting; there''s a range of > > options, from having your own server in a datacenter to using a cloud > > provider like AWS or Heroku. If it''s company-internal, you still need a > > server, but the options may be more limited :-) > > > > That''s a decision that''s only slightly related to Rails, though. > > > > -- > > Hassan Schroeder ------------------------ hassan.schroe... > @gmail.comhttp://about.me/hassanschroeder > > twitter: @hassan > > -- > 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.
vmoroz-Y3woaq0unKCHXe+LvDLADg@public.gmane.org
2012-Apr-18 07:42 UTC
Re: Re: Switch between environments
Send me your profile. Thank you. 18.04.2012 10:59, Kal написал:> Thanks Hassan, > > This is exactly what I don''t get! > > The "Development" environment is the default environment in Rails, > yes? > > Now, that means my data is contained in development.sqlite3 and ''rails > server'' starts WEBrick and so we can view the site from www.homepage.com:3000. > > The step after this is precisely what I''m missing... because nobody > talks about it... all the books and guides pretty much stop short of > this... > > So this is my question: How do I move everything to the "production > environment". I''d imagine that is the ultimate goal, is it not? > > How do I copy the data to production.sqlite3 (just issue: rake > db:migrate RAILS_ENV=production) and have all the code (which I > created in the Development Env) working in the "Production" > environment so it doesn''t have to be served out using WEBRick. > > Thanks Much, > > ~Kal > > It''s just a test app. However, my plan is to deploy a web application > on a public website... someday :) > --------------------------------------------------------------------------------------------------------------- > > By the way, I''m running: > > Ruby 1.9.3p0 > Rails 3.1.3 > Phusion Passenger version 3.0.11 > CentOS release 5.6 > Server version: Apache/2.2.3 > > ---------------------------------------------- > > > On Apr 18, 2:42 am, Hassan Schroeder <hassan.schroe...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: >> /* sorry for the near-empty response - fat-fingered it */ >> >> On Tue, Apr 17, 2012 at 10:05 PM, Kal <calcr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >>> Why "bundle execute"? What does that do? >> `bundle exec` runs your app with the gems specifically described in >> your Gemfile. >> >>> I don''t mean database instance. I mean a scenario where I''m using >>> Sqlite3 application for both Development and Production. >> Probably still not a great idea unless the production instance will >> be very lightly loaded. >> >>> By "push out", I mean after you''ve finished the application >>> development (which can be viewed using port 3000), how do we then >>> "migrate" the finished production into production? >> What exactly do you mean by "production"? Is this an Intranet app >> for your company, an application for a wide Internet public, or ____? >> >> If it''s a public app, you need to decide on hosting; there''s a range of >> options, from having your own server in a datacenter to using a cloud >> provider like AWS or Heroku. If it''s company-internal, you still need a >> server, but the options may be more limited :-) >> >> That''s a decision that''s only slightly related to Rails, though. >> >> -- >> Hassan Schroeder ------------------------ hassan.schroe...-Re5JQEeQqe80Tx58lXaADg@public.gmane.org://about.me/hassanschroeder >> twitter: @hassan-- 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.
Thanks Much Aash, But as someone already replied: "It only creates tables, but how to transfer data from these tables? And I think It is same that rake db:migrate RAILS_ENV=production" I''ve gotten as far as "rake db:migrate RAILS_ENV=production" from my research thus far... Seriously, there''s no official document for a "Standard" way of doing this? Cheers, ~Kal On Apr 18, 3:14 am, aash dhariya <aash.disco...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> http://stackoverflow.com/questions/7291381/rails-how-to-migrate-data-... > may be helpful to migrate from development to production. > > > > > > > > On Wed, Apr 18, 2012 at 12:29 PM, Kal <calcr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Thanks Hassan, > > > This is exactly what I don''t get! > > > The "Development" environment is the default environment in Rails, > > yes? > > > Now, that means my data is contained in development.sqlite3 and ''rails > > server'' starts WEBrick and so we can view the site from > >www.homepage.com:3000. > > > The step after this is precisely what I''m missing... because nobody > > talks about it... all the books and guides pretty much stop short of > > this... > > > So this is my question: How do I move everything to the "production > > environment". I''d imagine that is the ultimate goal, is it not? > > > How do I copy the data to production.sqlite3 (just issue: rake > > db:migrate RAILS_ENV=production) and have all the code (which I > > created in the Development Env) working in the "Production" > > environment so it doesn''t have to be served out using WEBRick. > > > Thanks Much, > > > ~Kal > > > It''s just a test app. However, my plan is to deploy a web application > > on a public website... someday :) > > > --------------------------------------------------------------------------------------------------------------- > > > By the way, I''m running: > > > Ruby 1.9.3p0 > > Rails 3.1.3 > > Phusion Passenger version 3.0.11 > > CentOS release 5.6 > > Server version: Apache/2.2.3 > > > ---------------------------------------------- > > > On Apr 18, 2:42 am, Hassan Schroeder <hassan.schroe...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > wrote: > > > /* sorry for the near-empty response - fat-fingered it */ > > > > On Tue, Apr 17, 2012 at 10:05 PM, Kal <calcr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Why "bundle execute"? What does that do? > > > > `bundle exec` runs your app with the gems specifically described in > > > your Gemfile. > > > > > I don''t mean database instance. I mean a scenario where I''m using > > > > Sqlite3 application for both Development and Production. > > > > Probably still not a great idea unless the production instance will > > > be very lightly loaded. > > > > > By "push out", I mean after you''ve finished the application > > > > development (which can be viewed using port 3000), how do we then > > > > "migrate" the finished production into production? > > > > What exactly do you mean by "production"? Is this an Intranet app > > > for your company, an application for a wide Internet public, or ____? > > > > If it''s a public app, you need to decide on hosting; there''s a range of > > > options, from having your own server in a datacenter to using a cloud > > > provider like AWS or Heroku. If it''s company-internal, you still need a > > > server, but the options may be more limited :-) > > > > That''s a decision that''s only slightly related to Rails, though. > > > > -- > > > Hassan Schroeder ------------------------ hassan.schroe... > > @gmail.comhttp://about.me/hassanschroeder > > > twitter: @hassan > > > -- > > 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@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
ok...I browsed across some gems and found this: https://github.com/mattconnolly/rails-backup-migrate .....this helps in dumping the whole database in a single file which can then be restored. Let me know if it works in your case On Wed, Apr 18, 2012 at 1:53 PM, Kal <calcruby-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Thanks Much Aash, > > But as someone already replied: > > "It only creates tables, but how to transfer data from these tables? > And I think It is same that rake db:migrate RAILS_ENV=production" > > I''ve gotten as far as "rake db:migrate RAILS_ENV=production" from my > research thus far... > > Seriously, there''s no official document for a "Standard" way of doing > this? > > Cheers, > > ~Kal > > > On Apr 18, 3:14 am, aash dhariya <aash.disco...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > http://stackoverflow.com/questions/7291381/rails-how-to-migrate-data-... > > may be helpful to migrate from development to production. > > > > > > > > > > > > > > > > On Wed, Apr 18, 2012 at 12:29 PM, Kal <calcr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Thanks Hassan, > > > > > This is exactly what I don''t get! > > > > > The "Development" environment is the default environment in Rails, > > > yes? > > > > > Now, that means my data is contained in development.sqlite3 and ''rails > > > server'' starts WEBrick and so we can view the site from > > >www.homepage.com:3000. > > > > > The step after this is precisely what I''m missing... because nobody > > > talks about it... all the books and guides pretty much stop short of > > > this... > > > > > So this is my question: How do I move everything to the "production > > > environment". I''d imagine that is the ultimate goal, is it not? > > > > > How do I copy the data to production.sqlite3 (just issue: rake > > > db:migrate RAILS_ENV=production) and have all the code (which I > > > created in the Development Env) working in the "Production" > > > environment so it doesn''t have to be served out using WEBRick. > > > > > Thanks Much, > > > > > ~Kal > > > > > It''s just a test app. However, my plan is to deploy a web application > > > on a public website... someday :) > > > > > > --------------------------------------------------------------------------------------------------------------- > > > > > By the way, I''m running: > > > > > Ruby 1.9.3p0 > > > Rails 3.1.3 > > > Phusion Passenger version 3.0.11 > > > CentOS release 5.6 > > > Server version: Apache/2.2.3 > > > > > ---------------------------------------------- > > > > > On Apr 18, 2:42 am, Hassan Schroeder <hassan.schroe...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > > wrote: > > > > /* sorry for the near-empty response - fat-fingered it */ > > > > > > On Tue, Apr 17, 2012 at 10:05 PM, Kal <calcr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Why "bundle execute"? What does that do? > > > > > > `bundle exec` runs your app with the gems specifically described in > > > > your Gemfile. > > > > > > > I don''t mean database instance. I mean a scenario where I''m using > > > > > Sqlite3 application for both Development and Production. > > > > > > Probably still not a great idea unless the production instance will > > > > be very lightly loaded. > > > > > > > By "push out", I mean after you''ve finished the application > > > > > development (which can be viewed using port 3000), how do we then > > > > > "migrate" the finished production into production? > > > > > > What exactly do you mean by "production"? Is this an Intranet app > > > > for your company, an application for a wide Internet public, or ____? > > > > > > If it''s a public app, you need to decide on hosting; there''s a range > of > > > > options, from having your own server in a datacenter to using a cloud > > > > provider like AWS or Heroku. If it''s company-internal, you still > need a > > > > server, but the options may be more limited :-) > > > > > > That''s a decision that''s only slightly related to Rails, though. > > > > > > -- > > > > Hassan Schroeder ------------------------ hassan.schroe... > > > @gmail.comhttp://about.me/hassanschroeder > > > > twitter: @hassan > > > > > -- > > > 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-/JYPxA39Uh5TLH3MbocFFw@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. > >-- 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 Apr 18, 2012, at 4:23 AM, Kal wrote:> Thanks Much Aash, > > But as someone already replied: > > "It only creates tables, but how to transfer data from these tables? > And I think It is same that rake db:migrate RAILS_ENV=production" > > I''ve gotten as far as "rake db:migrate RAILS_ENV=production" from my > research thus far...The whole idea behind separate databases and separate /data/ is that you want your development environment to run quickly and lightly (on your local computer) and you may want to entirely drop the database at some point to try out a different approach. Then you migrate the changes made during development to the production server (a separate physical machine or cloud appliance). The database on your production server should have nothing to do with the database you hack on in development. (It is good practice to use the same type of database in both places, but even that is not entirely required. I have often made simple sites with squilte3 in development and MySQL in production.) Any production content should only be entered into the production server''s database. If you make changes to the dev server, you do so using migrations, and when you next synch the server with your latest changes, you shell into the server and run RAILS_ENV=production bundle exec rake db:migrate to /alter/ the database with existing data intact.> > Seriously, there''s no official document for a "Standard" way of doing > this?The standard way of doing this is to have development and test run on the development computer (usually a Mac or *nix desktop or laptop) and to have production run on a real server somewhere (usually Apache/Nginx + Passenger on a *nix server). More elaborate or server-coupled sites may have a staging or test environment on a duplicate *nix server, but that depends a lot on your application. I recommend that you read through the entire Rails Tutorial by Michael Hartl. It''s free to read online, and there''s a paid version with screencasts that''s also very nice. This will walk you through the standard way of working in Rails, starting with tests and development on your local computer, culminating with hosting the site on Heroku. Really start at the beginning and work your way all the way to the end. I think you''re missing a few steps here in your understanding. Walter> > Cheers, > > ~Kal > > > On Apr 18, 3:14 am, aash dhariya <aash.disco...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> http://stackoverflow.com/questions/7291381/rails-how-to-migrate-data-... >> may be helpful to migrate from development to production. >> >> >> >> >> >> >> >> On Wed, Apr 18, 2012 at 12:29 PM, Kal <calcr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >>> Thanks Hassan, >> >>> This is exactly what I don''t get! >> >>> The "Development" environment is the default environment in Rails, >>> yes? >> >>> Now, that means my data is contained in development.sqlite3 and ''rails >>> server'' starts WEBrick and so we can view the site from >>> www.homepage.com:3000. >> >>> The step after this is precisely what I''m missing... because nobody >>> talks about it... all the books and guides pretty much stop short of >>> this... >> >>> So this is my question: How do I move everything to the "production >>> environment". I''d imagine that is the ultimate goal, is it not? >> >>> How do I copy the data to production.sqlite3 (just issue: rake >>> db:migrate RAILS_ENV=production) and have all the code (which I >>> created in the Development Env) working in the "Production" >>> environment so it doesn''t have to be served out using WEBRick. >> >>> Thanks Much, >> >>> ~Kal >> >>> It''s just a test app. However, my plan is to deploy a web application >>> on a public website... someday :) >> >>> --------------------------------------------------------------------------------------------------------------- >> >>> By the way, I''m running: >> >>> Ruby 1.9.3p0 >>> Rails 3.1.3 >>> Phusion Passenger version 3.0.11 >>> CentOS release 5.6 >>> Server version: Apache/2.2.3 >> >>> ---------------------------------------------- >> >>> On Apr 18, 2:42 am, Hassan Schroeder <hassan.schroe...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> >>> wrote: >>>> /* sorry for the near-empty response - fat-fingered it */ >> >>>> On Tue, Apr 17, 2012 at 10:05 PM, Kal <calcr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >>>>> Why "bundle execute"? What does that do? >> >>>> `bundle exec` runs your app with the gems specifically described in >>>> your Gemfile. >> >>>>> I don''t mean database instance. I mean a scenario where I''m using >>>>> Sqlite3 application for both Development and Production. >> >>>> Probably still not a great idea unless the production instance will >>>> be very lightly loaded. >> >>>>> By "push out", I mean after you''ve finished the application >>>>> development (which can be viewed using port 3000), how do we then >>>>> "migrate" the finished production into production? >> >>>> What exactly do you mean by "production"? Is this an Intranet app >>>> for your company, an application for a wide Internet public, or ____? >> >>>> If it''s a public app, you need to decide on hosting; there''s a range of >>>> options, from having your own server in a datacenter to using a cloud >>>> provider like AWS or Heroku. If it''s company-internal, you still need a >>>> server, but the options may be more limited :-) >> >>>> That''s a decision that''s only slightly related to Rails, though. >> >>>> -- >>>> Hassan Schroeder ------------------------ hassan.schroe... >>> @gmail.comhttp://about.me/hassanschroeder >>>> twitter: @hassan >> >>> -- >>> 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@googlegroups.com. > 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@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Tue, Apr 17, 2012 at 11:59 PM, Kal <calcruby-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> So this is my question: How do I move everything to the "production > environment". I''d imagine that is the ultimate goal, is it not?Actually, no.> How do I copy the data to production.sqlite3To amplify on other responses, it''s *not* at all typical to share data between dev and prod databases. There are sometimes tables of common data: search on ''Rails seed data'' for more info, or look at the result of `bundle exec rake -T | grep seed` . But if you want to load *all* the data from your dev instance to your production system, that''s not a Rails function, and how to best do it really depends on your particular databases and requirements. HTH, -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org http://about.me/hassanschroeder twitter: @hassan -- 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.
Thank you very much Walter, not only for this very concise answer (which explains a lot), but for all of your help with my previous inquiries. Yes, I was very much under the impression that development and production is meant to be (or at least, can be) performed on the same physical machine running Rails. I''ve been working off of Agile Web Development with Rails (4th Edition). On your recommendation, I picked up Michael Hartl''s book today. I also think this book will help fill in the gaps of information in this rat maze of my brain. Thanks Much, ~Kal On Apr 18, 11:00 am, Walter Lee Davis <wa...-HQgmohHLjDZWk0Htik3J/w@public.gmane.org> wrote:> On Apr 18, 2012, at 4:23 AM, Kal wrote: > > > Thanks Much Aash, > > > But as someone already replied: > > > "It only creates tables, but how to transfer data from these tables? > > And I think It is same that rake db:migrate RAILS_ENV=production" > > > I''ve gotten as far as "rake db:migrate RAILS_ENV=production" from my > > research thus far... > > The whole idea behind separate databases and separate /data/ is that you want your development environment to run quickly and lightly (on your local computer) and you may want to entirely drop the database at some point to try out a different approach. Then you migrate the changes made during development to the production server (a separate physical machine or cloud appliance). > > The database on your production server should have nothing to do with the database you hack on in development. (It is good practice to use the same type of database in both places, but even that is not entirely required. I have often made simple sites with squilte3 in development and MySQL in production.) Any production content should only be entered into the production server''s database. > > If you make changes to the dev server, you do so using migrations, and when you next synch the server with your latest changes, you shell into the server and run > > RAILS_ENV=production bundle exec rake db:migrate > > to /alter/ the database with existing data intact. > > > > > Seriously, there''s no official document for a "Standard" way of doing > > this? > > The standard way of doing this is to have development and test run on the development computer (usually a Mac or *nix desktop or laptop) and to have production run on a real server somewhere (usually Apache/Nginx + Passenger on a *nix server). More elaborate or server-coupled sites may have a staging or test environment on a duplicate *nix server, but that depends a lot on your application. > > I recommend that you read through the entire Rails Tutorial by Michael Hartl. It''s free to read online, and there''s a paid version with screencasts that''s also very nice. This will walk you through the standard way of working in Rails, starting with tests and development on your local computer, culminating with hosting the site on Heroku. Really start at the beginning and work your way all the way to the end. I think you''re missing a few steps here in your understanding. > > Walter > > > > > > > > > > > Cheers, > > > ~Kal > > > On Apr 18, 3:14 am, aash dhariya <aash.disco...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >>http://stackoverflow.com/questions/7291381/rails-how-to-migrate-data-... > >> may be helpful to migrate from development to production. > > >> On Wed, Apr 18, 2012 at 12:29 PM, Kal <calcr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >>> Thanks Hassan, > > >>> This is exactly what I don''t get! > > >>> The "Development" environment is the default environment in Rails, > >>> yes? > > >>> Now, that means my data is contained in development.sqlite3 and ''rails > >>> server'' starts WEBrick and so we can view the site from > >>>www.homepage.com:3000. > > >>> The step after this is precisely what I''m missing... because nobody > >>> talks about it... all the books and guides pretty much stop short of > >>> this... > > >>> So this is my question: How do I move everything to the "production > >>> environment". I''d imagine that is the ultimate goal, is it not? > > >>> How do I copy the data to production.sqlite3 (just issue: rake > >>> db:migrate RAILS_ENV=production) and have all the code (which I > >>> created in the Development Env) working in the "Production" > >>> environment so it doesn''t have to be served out using WEBRick. > > >>> Thanks Much, > > >>> ~Kal > > >>> It''s just a test app. However, my plan is to deploy a web application > >>> on a public website... someday :) > > >>> --------------------------------------------------------------------------------------------------------------- > > >>> By the way, I''m running: > > >>> Ruby 1.9.3p0 > >>> Rails 3.1.3 > >>> Phusion Passenger version 3.0.11 > >>> CentOS release 5.6 > >>> Server version: Apache/2.2.3 > > >>> ---------------------------------------------- > > >>> On Apr 18, 2:42 am, Hassan Schroeder <hassan.schroe...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > >>> wrote: > >>>> /* sorry for the near-empty response - fat-fingered it */ > > >>>> On Tue, Apr 17, 2012 at 10:05 PM, Kal <calcr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >>>>> Why "bundle execute"? What does that do? > > >>>> `bundle exec` runs your app with the gems specifically described in > >>>> your Gemfile. > > >>>>> I don''t mean database instance. I mean a scenario where I''m using > >>>>> Sqlite3 application for both Development and Production. > > >>>> Probably still not a great idea unless the production instance will > >>>> be very lightly loaded. > > >>>>> By "push out", I mean after you''ve finished the application > >>>>> development (which can be viewed using port 3000), how do we then > >>>>> "migrate" the finished production into production? > > >>>> What exactly do you mean by "production"? Is this an Intranet app > >>>> for your company, an application for a wide Internet public, or ____? > > >>>> If it''s a public app, you need to decide on hosting; there''s a range of > >>>> options, from having your own server in a datacenter to using a cloud > >>>> provider like AWS or Heroku. If it''s company-internal, you still need a > >>>> server, but the options may be more limited :-) > > >>>> That''s a decision that''s only slightly related to Rails, though. > > >>>> -- > >>>> Hassan Schroeder ------------------------ hassan.schroe... > >>> @gmail.comhttp://about.me/hassanschroeder > >>>> twitter: @hassan > > >>> -- > >>> 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-/JYPxA39Uh4Ykp1iOSErHA@public.gmane.orgm. > >>> 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 athttp://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@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Thank you very much, Hassan. Your answer definitely helps a lot. I''m obviously framing the ROR environments concept incorrectly. It looks like I''ve got to hit the books a lot harder to avoid straying down the wrong path. Thanks, ~Kal On Apr 18, 12:35 pm, Hassan Schroeder <hassan.schroe...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Tue, Apr 17, 2012 at 11:59 PM, Kal <calcr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > So this is my question: How do I move everything to the "production > > environment". I''d imagine that is the ultimate goal, is it not? > > Actually, no. > > > How do I copy the data to production.sqlite3 > > To amplify on other responses, it''s *not* at all typical to share databetweendev and prod databases. There are sometimes tables of > common data: search on ''Rails seed data'' for more info, or look at > the result of `bundle exec rake -T | grep seed` . > > But if you want to load *all* the data from your dev instance to your > production system, that''s not a Rails function, and how to best do > it really depends on your particular databases and requirements. > > HTH, > -- > Hassan Schroeder ------------------------ hassan.schroe...-Re5JQEeQqe80Tx58lXaADg@public.gmane.org://about.me/hassanschroeder > twitter: @hassan-- 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.