librelist archives

« back to archive

Re: Themes

Re: Themes

From:
Graham Ashton
Date:
2010-06-15 @ 18:49
On 15 Jun 2010, at 19:17, Graham Ashton wrote:
> 
> I think you got lucky - I just went through each of your commands 
verbatim and I'm getting this (in the browser and in the heroku logs):
> 
> 
/home/slugs/212519_6e982f4_1bf9/mnt/.bundle/gems/gems/rack-1.2.1/lib/rack/utils.rb:138:in
`union': can't convert Array into String (TypeError)

Okay, this was easy to clear up. I hadn't uncommented config.yml in 
.gitignore, so the app had no chance to start up. My fault...

The problem you were having was due to some dubious behaviour from the 
./scripts/theme script. It was cloning the theme's repository into the 
themes/postal3 directory, and then appending its name to the 
.git/info/exclude file. The exclude file is a cheeky unversioned way of 
ignoring a file or directory, as I didn't want to start updating people's 
.gitignore files. I also felt that a theme didn't really belong with the 
code; it'd be nice to update a theme without having to merge changes into 
your own repository.

This was clearly a mistake, as it confused us both! I've just pushed a 
commit to the themes branch that changes the behaviour, so that you'll 
have the option to add and commit a copy of the theme's files to your 
repository.

http://github.com/gma/nesta/commit/3887b330b34bfd1e63165962b8efed2331ae408a

I now think it's better that running `./scripts/theme install` will create
a local copy of the theme inside your app, rather than trying to do 
anything clever like installing a submodule, as Heroku doesn't support 
submodules. I want to document how to deploy Nesta and Heroku is looking 
like a very sensible default. Those of us with a more complicated setup 
can modify the config accordingly.

I'm hoping to merge the themes branch into master this evening; I'll tweet
my success and post to the list if all goes well. To get your site 
deployed I think you'll need to completely remove the theme from your 
repository before re-running the new script:

1. Edit .git/info/exclude
2. git rm -f themes/postal3 && git commit
3. ./script/theme install <url>

Cheers,
Graham

P.S. I deployed a Nesta instance to Heroku using the Bamboo stack and Ruby
1.8.7 here:

http://freezing-moon-16.heroku.com/

Re: Themes

From:
Graham Ashton
Date:
2010-06-15 @ 18:51
Re-sending this message to the list (to ensure it gets archived) as I 
suspect it never came through.

On 1 Jun 2010, at 08:40, José Salinas wrote:

> Hi, Graham, thanks for your fast reply!

Hey. This time it's more a case of "better late than never"...

> Initially, I considered what you say, not pushing with themes:master 
(thank you, I didn't know that feature!), what I did is creating a 
personal repo with the themes branch in 
http://github.com/josal/Nesta-themed-heroku, but the content was at the 
master branch, because I needed to deploy from master (now from any 
branch, with your tip, jeje).

I just cloned Nesta-themed-heroku and started up a local copy. There was 
no theme applied, though it said schmitzelburger in config.yml. This is 
why:

 $ ls -R themes
 penguinclassics/	postal3/		schmitzelburger/

 themes/penguinclassics:

 themes/postal3:

 themes/schmitzelburger:

Empty folders.

> This morning I tried to deploy it exactly as you say. These were my steps:

Mmm, clearly something is not right with my instructions!

> git clone git://github.com/gma/nesta.git
> cd nesta
> git checkout -t origin/themes
> cp config/config.yml.sample config/config.yml
> vi config/config.yml (production, cache: false, content: content - (that
way it will be deployable to heroku))
> vi .gitignore - comment config/config.yml and content (that way it will 
be deployable to heroku)
> mkdir themes
> scripts/theme install http://github.com/gma/nesta-theme-postal3.git
> heroku create
> git add .
> git commit -m "themed and deployable to heroku"
> git push heroku themes:master
> 
> So, the deployment is at http://morning-mist-62.heroku.com/, and it has 
no theme... And locally, it works perfectly...

I think you got lucky - I just went through each of your commands verbatim
and I'm getting this (in the browser and in the heroku logs):


/home/slugs/212519_6e982f4_1bf9/mnt/.bundle/gems/gems/rack-1.2.1/lib/rack/utils.rb:138:in
`union': can't convert Array into String (TypeError)
	from 
/home/slugs/212519_6e982f4_1bf9/mnt/.bundle/gems/gems/rack-1.2.1/lib/rack/utils.rb:138
	from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in 
`gem_original_require'
	from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
	from 
/home/slugs/212519_6e982f4_1bf9/mnt/.bundle/gems/gems/rack-1.2.1/lib/rack/request.rb:1
	from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in 
`gem_original_require'
	from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
	from 
/home/slugs/212519_6e982f4_1bf9/mnt/.bundle/gems/gems/rack-1.2.1/lib/rack/showexceptions.rb:3
	from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in 
`gem_original_require'
	 ... 21 levels...
	from 
/home/slugs/212519_6e982f4_1bf9/mnt/.bundle/gems/gems/rack-1.2.1/lib/rack/builder.rb:46:in
`instance_eval'
	from 
/home/slugs/212519_6e982f4_1bf9/mnt/.bundle/gems/gems/rack-1.2.1/lib/rack/builder.rb:46:in
`initialize'
	from /home/heroku_rack/heroku.ru:1:in `new'
	from /home/heroku_rack/heroku.ru:1

Or maybe they've changed something since you tried it. I'll see if I can 
debug it, but it looks like the error is occurring fairly early on in the 
app's bootup process. It's probably time for me to investigate Heroku's 
bamboo stack, and tidy up Nesta's use of Bundler (I've been a bit lazy on 
that front so far).

I'll let you know how I get on.

Cheers,
Graham

P.S. I've cc'd the mailing list so that this stuff gets recorded for the 
benefit of search engines.