Question

The official guide says:

git pull octopress master # Get the latest Octopress
bundle install # Keep gems updated
rake update_source # update the template's source
rake update_style # update the template's style

I am stuck at rake update_source:

Welcome to Git (version 1.8.5.2-preview20131230)

MrD@MRSD /c/Dropbox/Udun/octopress (source) # source, where I write the blog
$ git checkout master
Branch master set up to track remote branch master from octopress.
Switched to a new branch 'master'
MrD@MRSD /c/Dropbox/Udun/octopress (master)
$ git pull octopress master
From git://github.com/imathis/octopress
 * branch            master     -> FETCH_HEAD
Already up-to-date.
MrD@MRSD /c/Dropbox/Udun/octopress (master)
$ bundle install
Fetching gem metadata from https://rubygems.org/........
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
Using rake (0.9.2.2)
# ...
Using bundler (1.3.5)
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.
MrD@MRSD /c/Dropbox/Udun/octopress (master)
$ rake update_source
## Set the codepage to 65001 for Windows machines
mkdir source.old
cp -r source/. source.old
## Copied source into source.old/
cp -r --remove-destination .themes/classic/source/. source
cp -r --remove-destination source.old/_includes/custom/. source/_includes/custom
/
rake aborted!
No such file or directory - source.old/_includes/custom/.
c:/Dropbox/Udun/octopress/Rakefile:206:in `block in <top (required)>'
Tasks: TOP => update_source
(See full trace by running task with --trace)

So how do I proceed ?

EDIT: I opened an issue on Jul 16, 2014: https://github.com/imathis/octopress/issues/1604

I have since rebased source on master (need I say I do not care about the source history nor my typos are meant to be shared) and the blog functions but I'd like some feedback on this - namely:

do I need to rebase my source branch on master to properly update ?

Was it helpful?

Solution

Well the real answer is I should never have checked out master. The process went smoothly when I did it from source...

MrD@MRSD /c/Dropbox/Udun/octopress (source)
$ rake update_source
## Removed existing source.old directory
rm -r source.old
mkdir source.old
cp -r source/. source.old
## Copied source into source.old/
cp -r --remove-destination .themes/classic/source/. source
cp -r --remove-destination source.old/_includes/custom/. source/_includes/custom
/
cp source.old/favicon.png source
## Updated source ##

MrD@MRSD /c/Dropbox/Udun/octopress (source)
$ rake update_style
mv sass sass.old
## Moved styles into sass.old/
cp -r .themes/classic/sass/ sass
cp -r sass/custom/. sass.old/custom
## Updated Sass ##

Still it overwrote:

source/_includes/navigation.html
source/_layouts/post.html

on rake update_source and:

sass/custom/_styles.scss

on rake update_style.

Also I wonder - should I rebase on master ?

EDIT: to the best of my belief one should issue git rebase master and closing this

OTHER TIPS

I've noticed a few 'issues' with Octopress' Rakefile for this kind of stuff, usually syntax errors.

Your error is there in the log output:

No such file or directory - source.old/_includes/custom/.

This rings a bell to me... The author of Octopress only recently added that _includes/custom/ set of templates late last year, or early this year or something. So, older installs may not have it. Odd how that blows up the entire script - it should just ignore it.

Can you look into your original files/directory to see if you have that _includes/custom/? I'm willing to bet you don't, hence why you are trying to update.

Looking at my Rakefile as of April 4th or so (the first time I downloaded Octopress to convert, and last time), the code is:

desc "Move source to source.old, install source theme updates, replace source/_includes/navigation.html with source.old's navigation"
task :update_source, :theme do |t, args|
  theme = args.theme || 'classic'
  if File.directory?("#{source_dir}.old")
    puts "## Removed existing #{source_dir}.old directory"
    rm_r "#{source_dir}.old", :secure=>true
  end
  mkdir "#{source_dir}.old"
  cp_r "#{source_dir}/.", "#{source_dir}.old"
  puts "## Copied #{source_dir} into #{source_dir}.old/"
  cp_r "#{themes_dir}/"+theme+"/source/.", source_dir, :remove_destination=>true
  cp_r "#{source_dir}.old/_includes/custom/.", "#{source_dir}/_includes/custom/", :remove_destination=>true
  cp "#{source_dir}.old/favicon.png", source_dir
  mv "#{source_dir}/index.html", "#{blog_index_dir}", :force=>true if blog_index_dir != source_dir
  cp "#{source_dir}.old/index.html", source_dir if blog_index_dir != source_dir && File.exists?("#{source_dir}.old/index.html")
  puts "## Updated #{source_dir} ##"
end

So, open your Rakefile and find that line above:

cp_r "#{source_dir}.old/_includes/custom/.", "#{source_dir}/_includes/custom/", :remove_destination=>true

And comment it out:

#cp_r "#{source_dir}.old/_includes/custom/.", "#{source_dir}/_includes/custom/", :remove_destination=>true

The rest looks like it should be there.

Also note the update_style method of that Rakefile:

desc "Move sass to sass.old, install sass theme updates, replace sass/custom with sass.old/custom"
task :update_style, :theme do |t, args|
  theme = args.theme || 'classic'
  if File.directory?("sass.old")
    puts "removed existing sass.old directory"
    rm_r "sass.old", :secure=>true
  end
  mv "sass", "sass.old"
  puts "## Moved styles into sass.old/"
  cp_r "#{themes_dir}/"+theme+"/sass/", "sass"
  cp_r "sass/custom/.", "sass.old/custom"
  puts "## Updated Sass ##"
end

That may error as well depending on how hold your install is.

All in all, you'll just need to hack your Rakefile (and Gemfile, argh) to meet your install/requirements. That's why you chose to run a Hacker's Blogging framework: to hack away at it. Else you'd be on Wordpress, right?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top