Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NameError: uninitialized constant RedCloth #405

Closed
nvie opened this issue Mar 23, 2014 · 11 comments
Closed

NameError: uninitialized constant RedCloth #405

nvie opened this issue Mar 23, 2014 · 11 comments

Comments

@nvie
Copy link
Contributor

nvie commented Mar 23, 2014

Is this a known issue? I haven't touched my blog in a while and wanted to update it, but now got this error. I've reinstalled all of the packages to their latest versions, but could not understand this error. Any clues?

Crashlog created at 2014-03-23 21:38:39 +0100

===== MESSAGE:

NameError: uninitialized constant RedCloth

===== COMPILATION STACK:

  (empty)

===== STACK TRACE:

  0. /Users/nvie/.rvm/gems/ruby-1.9.3-p125@blog/gems/nanoc-3.6.8/lib/nanoc/filters/redcloth.rb:30:in `run'
  1. ./Rules:23:in `block (2 levels) in load'
  2. ./Rules:16:in `each'
  3. ./Rules:16:in `block in load'
  4. /Users/nvie/.rvm/gems/ruby-1.9.3-p125@blog/gems/nanoc-3.6.8/lib/nanoc/base/compilation/compiler.rb:198:in `instance_eval'
  5. /Users/nvie/.rvm/gems/ruby-1.9.3-p125@blog/gems/nanoc-3.6.8/lib/nanoc/base/compilation/compiler.rb:198:in `preprocess'
  6. /Users/nvie/.rvm/gems/ruby-1.9.3-p125@blog/gems/nanoc-3.6.8/lib/nanoc/base/compilation/compiler.rb:121:in `load'
  7. /Users/nvie/.rvm/gems/ruby-1.9.3-p125@blog/gems/nanoc-3.6.8/lib/nanoc/base/source_data/site.rb:250:in `load'
  8. /Users/nvie/.rvm/gems/ruby-1.9.3-p125@blog/gems/nanoc-3.6.8/lib/nanoc/cli/command_runner.rb:63:in `load_site'
  9. /Users/nvie/.rvm/gems/ruby-1.9.3-p125@blog/gems/nanoc-3.6.8/lib/nanoc/cli/commands/compile.rb:388:in `run'
  10. /Users/nvie/.rvm/gems/ruby-1.9.3-p125@blog/gems/nanoc-3.6.8/lib/nanoc/cli/command_runner.rb:14:in `block in call'
  11. /Users/nvie/.rvm/gems/ruby-1.9.3-p125@blog/gems/nanoc-3.6.8/lib/nanoc/cli/error_handler.rb:70:in `handle_while'
  12. /Users/nvie/.rvm/gems/ruby-1.9.3-p125@blog/gems/nanoc-3.6.8/lib/nanoc/cli/error_handler.rb:26:in `handle_while'
  13. /Users/nvie/.rvm/gems/ruby-1.9.3-p125@blog/gems/nanoc-3.6.8/lib/nanoc/cli/command_runner.rb:13:in `call'
  14. /Users/nvie/.rvm/gems/ruby-1.9.3-p125@blog/gems/cri-2.5.0/lib/cri/command_dsl.rb:185:in `block in runner'
  15. /Users/nvie/.rvm/gems/ruby-1.9.3-p125@blog/gems/cri-2.5.0/lib/cri/command.rb:298:in `call'
  16. /Users/nvie/.rvm/gems/ruby-1.9.3-p125@blog/gems/cri-2.5.0/lib/cri/command.rb:298:in `run_this'
  17. /Users/nvie/.rvm/gems/ruby-1.9.3-p125@blog/gems/cri-2.5.0/lib/cri/command.rb:251:in `run'
  18. /Users/nvie/.rvm/gems/ruby-1.9.3-p125@blog/gems/cri-2.5.0/lib/cri/command.rb:264:in `run'
  19. /Users/nvie/.rvm/gems/ruby-1.9.3-p125@blog/gems/nanoc-3.6.8/lib/nanoc/cli.rb:59:in `block in run'
  20. /Users/nvie/.rvm/gems/ruby-1.9.3-p125@blog/gems/nanoc-3.6.8/lib/nanoc/cli/error_handler.rb:70:in `handle_while'
  21. /Users/nvie/.rvm/gems/ruby-1.9.3-p125@blog/gems/nanoc-3.6.8/lib/nanoc/cli/error_handler.rb:26:in `handle_while'
  22. /Users/nvie/.rvm/gems/ruby-1.9.3-p125@blog/gems/nanoc-3.6.8/lib/nanoc/cli.rb:57:in `run'
  23. /Users/nvie/.rvm/gems/ruby-1.9.3-p125@blog/gems/nanoc-3.6.8/bin/nanoc:19:in `<top (required)>'
  24. /Users/nvie/.rvm/gems/ruby-1.9.3-p125@blog/bin/nanoc:23:in `load'

===== VERSION INFORMATION:

nanoc 3.6.8 © 2007-2013 Denis Defreyne.
Running ruby 1.9.3 (2012-02-16) on x86_64-darwin11.3.0 with RubyGems 2.2.2.

===== SYSTEM INFORMATION:

Darwin turkish.fritz.box 13.1.0 Darwin Kernel Version 13.1.0: Thu Jan 16 19:40:37 PST 2014; root:xnu-2422.90.20~2/RELEASE_X86_64 x86_64

===== INSTALLED GEMS:

  RedCloth 4.2.9
  adsf 1.2.0
  builder 3.2.2
  bundler 1.0.22
  colored 1.2
  commonjs 0.2.7
  cri 2.5.0
  less 2.5.0
  mime-types 2.2
  mini_portile 0.5.2
  nanoc 3.6.8
  nokogiri 1.6.1
  rack 1.5.2
  rainpress 1.0
  systemu 2.6.4

===== ENVIRONMENT:

Apple_PubSub_Socket_Render => "/tmp/launch-0KufkC/Render"
COLORFGBG => "12;8"
DIRENV_BACKUP => "eJyUVGFzsjgQ_i9-Pgho7dTel-MAlakVBvDafsoEjEoLSd4kUH1v7r_fhtp2Tu3cWz9gss_z7G6S3f174AlRU5y0RdYWOOPlC9U4pWxN5eB2gHQjUE1aVu4s567dvPjoiP028ONFnE5nf86A5w5_vwFTEGXJwns6Eb48sPG8QFxu7YaUXG1gRe39j5ZI_fPWAV0YRHmcgqyrGtjOwns8j-9D42elqFSIdRVFtuwatKWNQrItDpZrT-yRJdzh-I-i5tujLvHy-bd0t79G3da8IDUEOU8MjFEephA7jafRwqAB3ZC21h9IFmZZFC9xFAD46mhHmGMvvKW5PFbj5cJe5VPL3OEini29PsTR97dPhIqKfetUlwXAreiZ5DK3N7ZKopqX7_4-t-p0vyOSIiaOuv7zyflYqNNQp_tE8mdaaoVUKSuh1RfggZUbyZvL6LbSlua8Lmit_8MIJBcF36OAl21DGVCz9yhcaPTouudXIQ56x9lP9PavkJ_0C2tkj-zh_9OTQ3KwhrbzzjWtWZVEVz3Ild5KqiYjmwiBfM50n9U9KePM8E2pRAkO4oflIvYC7Hv-_LSFFlUhiTwgn5Q7eFtRCWvNX1nNyVoZ_VM-j5dZ7qX5KjmtubcsZQkLoGahv0qj_OlY2X1huzfX5cRg2Rx7q3yOs9i_OxkGKVmu__oBiShIH5wD3XQIsPaaysYajq9LXnN5tJuemqWewasccHN2A90nQWQGBuqIRBter02eokTjTedOrrtnB4_xc13evAi9uxk3Vw78tgzlCMSrLEw_2-shTu-gMy_Nm66SuiU1ZZ1JE2N_io0W5-FjjsOlHwdR38DO3p2Ob51-lAFrHvp30-jRvRpdT0ZX5l7AvqnUDsP7UV2xLdjABI2D4d2wIHp3qcHf3tSwvmC8o5Juqv3ZTDKQJmaKm-_bvmWkoWY-Efn64b0DEZSYSdR2ofgG__wbAAD___vt--0="
DIRENV_DIR => "-/Users/nvie/Projects/blog"
DIRENV_MTIME => "1395606753"
DISPLAY => "/tmp/launch-kWn5Hb/org.macosforge.xquartz:0"
EDITOR => "vim"
GEM_HOME => "/Users/nvie/.rvm/gems/ruby-1.9.3-p125@blog"
GEM_PATH => "/Users/nvie/.rvm/gems/ruby-1.9.3-p125@blog:/Users/nvie/.rvm/gems/ruby-1.9.3-p125@global"
HOME => "/Users/nvie"
IRBRC => "/Users/nvie/.rvm/rubies/ruby-1.9.3-p125/.irbrc"
ITERM_PROFILE => "Default"
ITERM_SESSION_ID => "w0t0p0"
LANG => "nl_NL.UTF-8"
LOGNAME => "nvie"
MY_RUBY_HOME => "/Users/nvie/.rvm/rubies/ruby-1.9.3-p125"
PATH => "/Users/nvie/.rvm/gems/ruby-1.9.3-p125/bin:/Users/nvie/.rvm/gems/ruby-1.9.3-p125@global/bin:/Users/nvie/.rvm/rubies/ruby-1.9.3-p125/bin:/Users/nvie/.rvm/gems/ruby-1.9.3-p125@blog/bin:/Users/nvie/.rvm/gems/ruby-1.9.3-p125@global/bin:/Users/nvie/.rvm/rubies/ruby-1.9.3-p125/bin:/Users/nvie/.rvm/bin:/Users/nvie/Projects/blog/node_modules/.bin:/Users/nvie/Projects/blog/.direnv/virtualenv/bin:/usr/local/bin:/usr/local/sbin:/usr/local/share/npm/bin:/bin:/sbin:/usr/bin:/usr/sbin:/Users/nvie/bin:/Users/nvie/Projects/scripts:/Users/nvie/Projects/syncfrom:/Users/nvie/Projects/git-toolbelt:/Users/nvie/Dropbox/Documents/Scripts:/opt/X11/bin:/Users/nvie/.pythonz/pythons/CPython-3.3.2/bin:/Users/nvie/.pythonz/pythons/PyPy-2.0.2/bin:/Applications/Postgres93.app/Contents/MacOS/bin"
PIP_DOWNLOAD_CACHE => "/Users/nvie/Library/Caches/pip-downloads"
PWD => "/Users/nvie/Projects/blog"
PYTHONSTARTUP => "/Users/nvie/.pythonrc.py"
RUBY_VERSION => "ruby-1.9.3-p125"
SECURITYSESSIONID => "186c9"
SHELL => "/usr/local/bin/fish"
SHLVL => "2"
SSH_AUTH_SOCK => "/tmp/launch-RaNdVq/Listeners"
TERM => "xterm-256color"
TERM_PROGRAM => "iTerm.app"
TMPDIR => "/var/folders/pc/5fv196vj0_5_jlc8kpth85m40000gn/T/"
USER => "nvie"
VIRTUAL_ENV => "/Users/nvie/Projects/blog/.direnv/virtualenv"
WORKON_HOME => "/Users/nvie/.virtualenvs"
__CF_USER_TEXT_ENCODING => "0x1F5:0:0"
__CHECKFIX1436934 => "1"
__array_start => "0"
__fish_bin_dir => "/usr/local/Cellar/fish/HEAD/bin"
__fish_datadir => "/usr/local/Cellar/fish/HEAD/share/fish"
__fish_help_dir => "/usr/local/Cellar/fish/HEAD/share/doc/fish"
__fish_initialized => "1"
__fish_sysconfdir => "/usr/local/Cellar/fish/HEAD/etc/fish"
_first => "0"
_second => "1"
escape_flag => "1"
fish_greeting => ""
rvm_archive_extension => "tar.bz2"
rvm_bin_path => "/Users/nvie/.rvm/bin"
rvm_delete_flag => "0"
rvm_path => "/Users/nvie/.rvm"
rvm_prefix => "/Users/nvie"
rvm_reload_flag => "0"
rvm_ruby_string => "ruby-1.9.3-p125"
rvm_sticky_flag => "1"
rvm_tar => "tar"
rvm_uname => "Darwin"
rvm_version => "1.10.2"

===== LOAD PATHS:

  0. /Users/nvie/.rvm/gems/ruby-1.9.3-p125@blog/gems/nanoc-3.6.8/lib
  1. /Users/nvie/.rvm/gems/ruby-1.9.3-p125@blog/gems/colored-1.2/lib
  2. /Users/nvie/.rvm/gems/ruby-1.9.3-p125@blog/gems/cri-2.5.0/lib
  3. /Users/nvie/.rvm/gems/ruby-1.9.3-p125@blog/gems/nanoc-3.6.8/lib
  4. /Users/nvie/.rvm/gems/ruby-1.9.3-p125@global/gems/bundler-1.0.22/lib
  5. /Users/nvie/.rvm/gems/ruby-1.9.3-p125@blog/gems/mini_portile-0.5.2/lib
  6. /Users/nvie/.rvm/gems/ruby-1.9.3-p125@blog/extensions/x86_64-darwin-11/1.9.1/nokogiri-1.6.1
  7. /Users/nvie/.rvm/gems/ruby-1.9.3-p125@blog/gems/nokogiri-1.6.1/lib
  8. /Users/nvie/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1
  9. /Users/nvie/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/x86_64-darwin11.3.0
  10. /Users/nvie/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby
  11. /Users/nvie/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/vendor_ruby/1.9.1
  12. /Users/nvie/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/vendor_ruby/1.9.1/x86_64-darwin11.3.0
  13. /Users/nvie/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/vendor_ruby
  14. /Users/nvie/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1
  15. /Users/nvie/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/x86_64-darwin11.3.0
@denisdefreyne
Copy link
Member

Hmm, odd. Can you try the following?

% irb
irb> require 'nanoc'
=> true
irb> Nanoc::Filter.named(:redcloth).new.setup_and_run('h1. Foo')
=> "<h1>Foo</h1>"

Does that work?

Alternatively, does going into irb and requiring 'RedCloth' work?

RubyGems can act up from time to time. Uninstalling and reinstalling RedCloth might help.

@nvie
Copy link
Contributor Author

nvie commented Mar 23, 2014

Thanks for the quick reply. Here's the output, seems to work fine:

$ irb
1.9.3p125 :001 > require 'nanoc'
 => true
1.9.3p125 :002 > Nanoc::Filter.named(:redcloth).new.setup_and_run('h1. Foo')
 => "<h1>Foo</h1>"
1.9.3p125 :003 > require 'RedCloth'
 => true

I also tried reinstalling RedCloth, but it had no effect.

@denisdefreyne
Copy link
Member

Do you have different versions of RedCloth installed? (A lowercase redcloth maybe?)

@nvie
Copy link
Contributor Author

nvie commented Mar 23, 2014

Nope:

$ gem list

*** LOCAL GEMS ***

adsf (1.2.0)
builder (3.2.2)
bundler (1.0.22)
colored (1.2)
commonjs (0.2.7)
cri (2.5.0)
less (2.5.0)
mime-types (2.2)
mini_portile (0.5.2)
nanoc (3.6.8)
nokogiri (1.6.1)
rack (1.5.2)
rainpress (1.0)
RedCloth (4.2.9)
systemu (2.6.4)

@denisdefreyne
Copy link
Member

Weird. Do you have issues with any other nanoc filters?

The fact that running the filter in irb works is troubling.

@denisdefreyne
Copy link
Member

What happens if you open /Users/nvie/.rvm/gems/ruby-1.9.3-p125@blog/gems/nanoc-3.6.8/lib/nanoc/filters/redcloth.rb and change

requires 'redcloth'

to

requires 'RedCloth'

?

@nvie
Copy link
Contributor Author

nvie commented Mar 23, 2014

It has no effect.

@nvie
Copy link
Contributor Author

nvie commented Mar 23, 2014

Here's how I call the filter: https://gist.github.com/nvie/4f2d90e5b3068bb23159#file-rules-rb-L9

@denisdefreyne
Copy link
Member

Ahh! Change the .run to .setup_and_run.

Seems like I introduced a backwards incompatibility.

@nvie
Copy link
Contributor Author

nvie commented Mar 23, 2014

Thanks for the quick help, Denis, will try later tonight.

@nvie
Copy link
Contributor Author

nvie commented Mar 23, 2014

All systems back to normal :) Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants