Ed Howland
2006-Sep-15 20:44 UTC
[Masterview-users] Have site, now must travel. IOW, how do I generate a non-MV site from MV?
Hi, Now that we have completed development, we need to publish our site to the hosting co. I need to get the actual ERB (.rhtml) files for that. I tried rake mv:parse, but that didn''t actually create any files. I set my RAILS_ENV to ''production'', and it says "Generated erb/rhtml output was created in app/views/** tree. But there are none there. Only .html files. What have I done wrong? Thanks Ed -- Ed Howland http://greenprogrammer.blogspot.com
Jeff Barczewski
2006-Sep-15 20:57 UTC
[Masterview-users] Have site, now must travel. IOW, how do I generate a non-MV site from MV?
Ed, All you need to do is set your config setting config.generate_rhtml_files = true You can do this in config/masterview/settings.rb or one of the config/masterview/environments files. When you restart your app it will generate all of them on startup. Best, Jeff On 9/15/06, Ed Howland <ed.howland at gmail.com> wrote:> Hi, > > Now that we have completed development, we need to publish our site to > the hosting co. I need to get the actual ERB (.rhtml) files for that. > I tried rake mv:parse, but that didn''t actually create any files. I > set my RAILS_ENV to ''production'', and it says "Generated erb/rhtml > output was created in app/views/** tree. But there are none there. > Only .html files. > > What have I done wrong? > > Thanks > Ed > > -- > Ed Howland > http://greenprogrammer.blogspot.com > _______________________________________________ > Masterview-users mailing list > Masterview-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/masterview-users >
Ed Howland
2006-Sep-15 21:54 UTC
[Masterview-users] Have site, now must travel. IOW, how do I generate a non-MV site from MV?
Thanks, That worked. I assume I can just rm -rf vendor/p;ugins/masterview for production. ? Ed On 9/15/06, Jeff Barczewski <jeff.barczewski at gmail.com> wrote:> Ed, > > All you need to do is set your config setting > > config.generate_rhtml_files = true > > You can do this in config/masterview/settings.rb or one of the > config/masterview/environments files. > > When you restart your app it will generate all of them on startup. > > Best, > > Jeff > > On 9/15/06, Ed Howland <ed.howland at gmail.com> wrote: > > Hi, > > > > Now that we have completed development, we need to publish our site to > > the hosting co. I need to get the actual ERB (.rhtml) files for that. > > I tried rake mv:parse, but that didn''t actually create any files. I > > set my RAILS_ENV to ''production'', and it says "Generated erb/rhtml > > output was created in app/views/** tree. But there are none there. > > Only .html files. > > > > What have I done wrong? > > > > Thanks > > Ed > > > > -- > > Ed Howland > > http://greenprogrammer.blogspot.com > > _______________________________________________ > > Masterview-users mailing list > > Masterview-users at rubyforge.org > > http://rubyforge.org/mailman/listinfo/masterview-users > > > _______________________________________________ > Masterview-users mailing list > Masterview-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/masterview-users >-- Ed Howland http://greenprogrammer.blogspot.com
Jeff Barczewski
2006-Sep-15 22:13 UTC
[Masterview-users] Have site, now must travel. IOW, how do I generate a non-MV site from MV?
On 9/15/06, Ed Howland <ed.howland at gmail.com> wrote:> Thanks, > > That worked. I assume I can just rm -rf vendor/p;ugins/masterview for > production. >Yes, once you have generated rhtml, then you don''t need masterview it will function without anything. So you can simply remove the vendor/plugins/masterview tree on your production server if you want. I just run with MasterView on the production server the same way I do in development, since it caches the same as rails does in production, but if you gen the rhtml then you don''t really don''t need it. Which ever way works best for you :-) Ruby is all about choices :-)
Ed Howland
2006-Sep-15 22:15 UTC
[Masterview-users] Have site, now must travel. IOW, how do I generate a non-MV site from MV?
Great. they don''t have the Mv gem installed. Ed On 9/15/06, Jeff Barczewski <jeff.barczewski at gmail.com> wrote:> On 9/15/06, Ed Howland <ed.howland at gmail.com> wrote: > > Thanks, > > > > That worked. I assume I can just rm -rf vendor/p;ugins/masterview for > > production. > > > > Yes, once you have generated rhtml, then you don''t need masterview it > will function without anything. So you can simply remove the > vendor/plugins/masterview tree on your production server if you want. > > I just run with MasterView on the production server the same way I do > in development, since it caches the same as rails does in production, > but if you gen the rhtml then you don''t really don''t need it. Which > ever way works best for you :-) Ruby is all about choices :-) > _______________________________________________ > Masterview-users mailing list > Masterview-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/masterview-users >-- Ed Howland http://greenprogrammer.blogspot.com
Deb Lewis
2006-Sep-16 03:44 UTC
[Masterview-users] Have site, now must travel. IOW, how do I generate a non-MV site from MV?
>> they don''t have the Mv gem installed.Ed - if you''ve pre-generated the .rthml files from masterview templates on your development system and pushed those up to your production server rails installation directory, you shouldn''t need the MasterView plugin in your production configuration. If you *do* want to run your production server directly from the MasterView templates and you can''t install the gem (e.g., you''re on a shared hosting system), you just need to install a copy of the MasterView plugin code in a directory that rails can load it from. This procedure is described in the installation documentation: http://masterview.org/installation.html#install_plugin To download and install manually, just get the current release of "masterview_plugin" from rubyforge (masterview_plugin-0.2.5.tgz on the Files tab - you have to scroll down to find it, the organization of that downloads page is by package rather than release, unfortunately) and unpack it into the vendor/plugins directory. From there, rails loads it automatically (just as is does when the gem is installed). (you can also put the files anywhere accessible and add the directory to config.plugin_paths, e.g., do this into your rails config/environments/production.rb configuration] ~ Deb
Ed Howland
2006-Sep-17 18:15 UTC
[Masterview-users] Have site, now must travel. IOW, how do I generate a non-MV site from MV?
On 9/15/06, Deb Lewis <djlewis at acm.org> wrote:> >> they don''t have the Mv gem installed. > > Ed - if you''ve pre-generated the .rthml files from masterview templates on > your development system and pushed those up to your production server rails > installation directory, you shouldn''t need the MasterView plugin in your > production configuration. > > If you *do* want to run your production server directly from the MasterView > templates and you can''t install the gem (e.g., you''re on a shared hosting > system), you just need to install a copy of the MasterView plugin code in a > directory that rails can load it from. This procedure is described in the > installation documentation: > > http://masterview.org/installation.html#install_plugin > > To download and install manually, just get the current release of > "masterview_plugin" from rubyforge (masterview_plugin-0.2.5.tgz on the Files > tab - you have to scroll down to find it, the organization of that downloads > page is by package rather than release, unfortunately) and unpack it into > the vendor/plugins directory. From there, rails loads it automatically > (just as is does when the gem is installed). > > (you can also put the files anywhere accessible and add the directory to > config.plugin_paths, e.g., do this into your rails > config/environments/production.rb configuration] > > ~ DebThanks, Deb. That is very useful information. I think I prefer to generate the rhtml files and then delete the masterview plugin from vendor/plugins. But its nice to know I can do it the other way as well. I am not sure why we''d need to regenerate the .rhtml files on a production server. We always TDD, create a release with all tests passing, svn copy to a tag dir named for the release, export that and publish. It seems we will have to do a few post-export tasks as well. Maybe that is where Capistrano comes in? We published it live on Friday. It went well. We used Bluehost.com which has very good Rails support, and a responsive support staff. Two things people should be aware of. Ruby is in /usr/bin/ruby, not /usr/local/bin/ruby. So you need to edit dispatch.fcgi. Your have to make a few other changes to .htaccess as well. I googled for those and it worked. I''ll blog about the settings full later. All in all, it went pretty smoothly. Ed -- Ed Howland http://greenprogrammer.blogspot.com
Jeff Barczewski
2006-Sep-17 21:04 UTC
[Masterview-users] Have site, now must travel. IOW, how do I generate a non-MV site from MV?
Yeah, I always use /usr/bin/env ruby instead of a hardcoded path since this seems to work well in accomodating where ever ruby is installed. Glad to hear the deployment went well! On 9/17/06, Ed Howland <ed.howland at gmail.com> wrote:> > We published it live on Friday. It went well. We used Bluehost.com > which has very good Rails support, and a responsive support staff. Two > things people should be aware of. Ruby is in /usr/bin/ruby, not > /usr/local/bin/ruby. So you need to edit dispatch.fcgi. Your have to > make a few other changes to .htaccess as well. I googled for those and > it worked. I''ll blog about the settings full later. All in all, it > went pretty smoothly. >
Deb Lewis
2006-Sep-18 18:35 UTC
[Masterview-users] Have site, now must travel. IOW, how do I generate a non-MV site from MV?
Ed - glad to hear your deployment went well! Here''s a couple other thoughts on structuring plugins for dev/deployment that you might want to think about, since you indicated you''re using Subversion for your VCS. I''ll use MasterView as the example here, but these are actually general issues. Consider using the SVN property svn:igore on the vendor/plugins directory in your rails app. In your development configuration, check out your rails app in the usual fashion and then install the MasterView plugin (as gem or a complete copy of the plugin, your preference). The svn:ignore property on vendor/plugins means only your own app code is managed in the repository, which is usually what you want. Since you''re pregenerating the .rhtml view files and don''t need mv in your production installation, you''re now all set - the masterview plugin isn''t part of your app in the repository (and really shouldn''t be in any case); when you deploy to your production system from the release tag you just get your own app files. Keep in mind also that plugins don''t *have* to be installed in vendor/plugins; you can append additional directories to the Rails plugin load path by putting the following in your config/environment.rb or a suitable config/environments/{env}.rb: config.plugin_paths << ''/path/to/local/copy/of/masterview'' (I do this in my config/environments/development.rb for running my rails app on development versions of masterview rather than a released version that''s used in production) There''s also some very nice things you can do with svn:externals to automate the developer''s checkout mechanics, if it''s onerous to have each developer install masterview or other plugins that you''re using. (Ordinarily that would be kind of a one-shot deal: install the gem + run the mv gem install script). This could also apply to automating a build testing setup or a pregenerate-rhtml-from-release-tag-templates process, I expect. The technique is to set up a separate project which assembles the complete working copy you want by using svn:externals references to pull in various elements from the repository. So a developer''s checkout config would have an svn:externals reference to your rails application and an additional svn:externals to map in the vender/plugins/masterview directory from, say, a vendors section in your repository where you archive the version of external components you want to work with. RE: Capistrano - I recently heard Mike Clark give his talk on rails deployment with Capistrano and it''s definitely on my to-do list for deploying my own sites. Depending on what the post-export tasks you''re doing are, that might fit in with Capistrano. Or maybe you just need a few rake tasks to automate your build/deploy procedure. ~ Deb