Reputation: 830
everyone. I'm using this ruby script to import my Blogger XML file into Octopress. The initial import works fine, the XML is parsed and HTML files are generate in ./_posts/
(with the proper naming convention). I moved these to ./source/_posts/
so Jekyll could parse them for use in the site. When I try to use rake -t generate
, I get this error:
samurailink3@Manacotti:~/Dropbox/Important Backups/Git Repos/samurailink3.com$ rake -t generate
** Invoke generate (first_time)
** Execute generate
## Generating Site with Jekyll
unchanged sass/screen.scss
Configuration from /home/samurailink3/Dropbox/Important Backups/Git Repos/samurailink3.com/_config.yml
Building site: source -> public
/usr/lib/ruby/1.9.1/uri/common.rb:304:in `escape': undefined method `gsub' for 3:Fixnum (NoMethodError)
from /usr/lib/ruby/1.9.1/uri/common.rb:623:in `escape'
from /var/lib/gems/1.9.1/gems/jekyll-0.12.0/lib/jekyll/post.rb:140:in `block in url'
from /var/lib/gems/1.9.1/gems/jekyll-0.12.0/lib/jekyll/post.rb:140:in `map'
from /var/lib/gems/1.9.1/gems/jekyll-0.12.0/lib/jekyll/post.rb:140:in `url'
from /home/samurailink3/Dropbox/Important Backups/Git Repos/samurailink3.com/plugins/sitemap_generator.rb:69:in `location_on_server'
from /home/samurailink3/Dropbox/Important Backups/Git Repos/samurailink3.com/plugins/sitemap_generator.rb:219:in `fill_location'
from /home/samurailink3/Dropbox/Important Backups/Git Repos/samurailink3.com/plugins/sitemap_generator.rb:181:in `fill_url'
from /home/samurailink3/Dropbox/Important Backups/Git Repos/samurailink3.com/plugins/sitemap_generator.rb:146:in `block in fill_posts'
from /home/samurailink3/Dropbox/Important Backups/Git Repos/samurailink3.com/plugins/sitemap_generator.rb:144:in `each'
from /home/samurailink3/Dropbox/Important Backups/Git Repos/samurailink3.com/plugins/sitemap_generator.rb:144:in `fill_posts'
from /home/samurailink3/Dropbox/Important Backups/Git Repos/samurailink3.com/plugins/sitemap_generator.rb:120:in `generate'
from /var/lib/gems/1.9.1/gems/jekyll-0.12.0/lib/jekyll/site.rb:190:in `block in generate'
from /var/lib/gems/1.9.1/gems/jekyll-0.12.0/lib/jekyll/site.rb:189:in `each'
from /var/lib/gems/1.9.1/gems/jekyll-0.12.0/lib/jekyll/site.rb:189:in `generate'
from /var/lib/gems/1.9.1/gems/jekyll-0.12.0/lib/jekyll/site.rb:40:in `process'
from /var/lib/gems/1.9.1/gems/jekyll-0.12.0/bin/jekyll:264:in `<top (required)>'
from /usr/local/bin/jekyll:23:in `load'
from /usr/local/bin/jekyll:23:in `<main>'
Any ideas? Everything was working perfectly until I attempted the import.
Also, here is the code if you want to have a look. I'm working off of the source
branch.
Upvotes: 1
Views: 252
Reputation: 25475
I expect that these types of errors are pretty common when doing an automatic translation and that each time has its own tricks and turns. When I did an import into jekyll, it choked on iframe HTML tags (for embedded videos) that weren't closed. Even though they were valid, the parser didn't like them. You may have something similar going on.
This line:
/usr/lib/ruby/1.9.1/uri/common.rb:304:in `escape': undefined method `gsub' for 3:Fixnum (NoMethodError)
gives you the first clue of where to start. Something is trying to call 'gsub'. My first step would be to search for that string in your output files. If you find one, temporarily remove all the other files in your ./source/_posts/ directory except for it. This will reduce the size of your problem set and let you experiment more to figure out exactly what's going on. Start hacking on that file until you get it to work.
Update: If you don't find 'gsub' (and I've seen a few more references to it that make me think you won't find that as a string). A good trouble shooting approach is still to only keep one file at a time in your ./source/_posts/ directory to narrow down exactly what is going on.
Upvotes: 2