Topic: RedCloth 4.1.1 and config.gem sadness

I am using RedCloth 4.1.1 in a Rails 2.2.2 project, and thought I'd try out the new gem dependency stuff. After overcoming a foible of ruby on FreeBSD (who knew you needed to set RB_USER_INSTALL to enable installing gems in ~/.gem?), I got the gem installed correctly. It works, but I must explicitly require it in environment.rb.

Then I removed the explicit call to require, and added `config.gem "RedCloth"' in the configuration block, and ran `rake gems:unpack'. The gem is correctly copied to vendor/gems, but now when I start the app, I get this error:

zsh 1663  (svn)-[steam:9]-% ./script/server webrick
=> Booting WEBrick...
no such file to load -- redcloth_scan
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in `require'

--- backtrace snipped ---

/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in `require'
/usr/local/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/commands/server.rb:49
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
./script/server:3
Missing these required gems:
  RedCloth 

You're running:
  ruby 1.8.6.287 at /usr/local/bin/ruby18
  rubygems 1.3.1 at /home/dan/.gem/ruby/1.8, /usr/local/lib/ruby/gems/1.8


The supposedly missing file (redcloth_scan) is in vendor/gems/RedCloth-4.1.1, exactly where you'd expect to find it.

I have tried specifying :lib => 'redcloth' in environment.rb, but to no avail. The only way I can get it all working again is to remove the copy of the gem under vendor, remove the gem dependency in the configuration and explicitly call require 'RedCloth'.

Anyone else seen this problem? Anyone figured out how to fix it?

Re: RedCloth 4.1.1 and config.gem sadness

I got a similar error too but it comes out when I "rake gems:install"

$ sudo rake gems:install
(in /media/storage/rails/theinksquad_to_rails_2-2-2)
gem install mislav-will_paginate --version "~> 2.2.3" --source http://gems.github.com
Successfully installed mislav-will_paginate-2.2.3
1 gem installed
Installing ri documentation for mislav-will_paginate-2.2.3...
Installing RDoc documentation for mislav-will_paginate-2.2.3...
ramon@ramon-desktop:/media/storage/rails/theinksquad_to_rails_2-2-2$ rake gems
(in /media/storage/rails/theinksquad_to_rails_2-2-2)
no such file to load -- redcloth_scan
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in `require'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:521:in `new_constants_in'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in `require'
/media/storage/rails/theinksquad_to_rails_2-2-2/vendor/gems/RedCloth-4.1.1/lib/case_sensitive_require/../redcloth.rb:10
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in `require'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:521:in `new_constants_in'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in `require'
/media/storage/rails/theinksquad_to_rails_2-2-2/vendor/gems/RedCloth-4.1.1/lib/case_sensitive_require/RedCloth.rb:6
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in `require'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:521:in `new_constants_in'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in `require'
/home/ramon/.gem/ruby/1.8/gems/rails-2.2.2/lib/rails/gem_dependency.rb:94:in `load'
/home/ramon/.gem/ruby/1.8/gems/rails-2.2.2/lib/initializer.rb:281:in `load_gems'
/home/ramon/.gem/ruby/1.8/gems/rails-2.2.2/lib/initializer.rb:281:in `each'
/home/ramon/.gem/ruby/1.8/gems/rails-2.2.2/lib/initializer.rb:281:in `load_gems'
/home/ramon/.gem/ruby/1.8/gems/rails-2.2.2/lib/initializer.rb:159:in `process'
/home/ramon/.gem/ruby/1.8/gems/rails-2.2.2/lib/initializer.rb:112:in `send'
/home/ramon/.gem/ruby/1.8/gems/rails-2.2.2/lib/initializer.rb:112:in `run'
/media/storage/rails/theinksquad_to_rails_2-2-2/config/environment.rb:7
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in `require'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:521:in `new_constants_in'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in `require'
/home/ramon/.gem/ruby/1.8/gems/rails-2.2.2/lib/tasks/misc.rake:3
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:in `call'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in `each'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:578:in `invoke_with_call_chain'
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:571:in `invoke_with_call_chain'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:564:in `invoke'
/home/ramon/.gem/ruby/1.8/gems/rails-2.2.2/lib/tasks/gems.rake:21
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:in `call'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in `each'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:578:in `invoke_with_call_chain'
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:571:in `invoke_with_call_chain'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:588:in `invoke_prerequisites'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:585:in `each'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:585:in `invoke_prerequisites'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:577:in `invoke_with_call_chain'
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:571:in `invoke_with_call_chain'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:564:in `invoke'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2019:in `invoke_task'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in `each'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2036:in `standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1991:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1970:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2036:in `standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1967:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/bin/rake:31
/usr/bin/rake:19:in `load'
/usr/bin/rake:19
no such file to load -- redcloth_scan
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in `require'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:521:in `new_constants_in'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in `require'
/media/storage/rails/theinksquad_to_rails_2-2-2/vendor/gems/RedCloth-4.1.1/lib/case_sensitive_require/../redcloth.rb:10
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in `require'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:521:in `new_constants_in'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in `require'
/media/storage/rails/theinksquad_to_rails_2-2-2/vendor/gems/RedCloth-4.1.1/lib/case_sensitive_require/RedCloth.rb:6
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in `require'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:521:in `new_constants_in'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in `require'
/home/ramon/.gem/ruby/1.8/gems/rails-2.2.2/lib/rails/gem_dependency.rb:94:in `load'
/home/ramon/.gem/ruby/1.8/gems/rails-2.2.2/lib/initializer.rb:281:in `load_gems'
/home/ramon/.gem/ruby/1.8/gems/rails-2.2.2/lib/initializer.rb:281:in `each'
/home/ramon/.gem/ruby/1.8/gems/rails-2.2.2/lib/initializer.rb:281:in `load_gems'
/home/ramon/.gem/ruby/1.8/gems/rails-2.2.2/lib/initializer.rb:164:in `process'
/home/ramon/.gem/ruby/1.8/gems/rails-2.2.2/lib/initializer.rb:112:in `send'
/home/ramon/.gem/ruby/1.8/gems/rails-2.2.2/lib/initializer.rb:112:in `run'
/media/storage/rails/theinksquad_to_rails_2-2-2/config/environment.rb:7
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in `require'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:521:in `new_constants_in'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in `require'
/home/ramon/.gem/ruby/1.8/gems/rails-2.2.2/lib/tasks/misc.rake:3
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:in `call'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in `each'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:578:in `invoke_with_call_chain'
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:571:in `invoke_with_call_chain'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:564:in `invoke'
/home/ramon/.gem/ruby/1.8/gems/rails-2.2.2/lib/tasks/gems.rake:21
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:in `call'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in `each'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:578:in `invoke_with_call_chain'
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:571:in `invoke_with_call_chain'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:588:in `invoke_prerequisites'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:585:in `each'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:585:in `invoke_prerequisites'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:577:in `invoke_with_call_chain'
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:571:in `invoke_with_call_chain'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:564:in `invoke'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2019:in `invoke_task'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in `each'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2036:in `standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1991:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1970:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2036:in `standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1967:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/bin/rake:31
/usr/bin/rake:19:in `load'
/usr/bin/rake:19
- [ ] RedCloth >= 4.1.0
- [F] haml >= 2.0.4
- [F] mini_magick >= 1.2.3
    - [ ] hoe = 1.8.2
- [F] ruby-openid >= 2.1.2
- [R] aws-s3 = 0.5.1
- [F] chronic >= 0.2.3
    - [ ] hoe = 1.8.2
- [F] mislav-will_paginate ~> 2.2.3
- [R] cucumber = 0.1.10
- [R] hoe = 1.8.2
- [F] money >= 1.7.1
- [F] packet >= 0.1.14
- [F] ruby-openid >= 2.0.4

I = Installed
F = Frozen
R = Framework (loaded before rails starts)

Last edited by ramon.tayag (2008-12-12 09:49:16)

Re: RedCloth 4.1.1 and config.gem sadness

I'm seeing a similar error to CambridgeDan:

rake db:migrate
no such file to load -- RedCloth
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:32:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:32:in `require'
/home/pb/public_html/sb/releases/20081214100119/vendor/rails/activesupport/lib/active_support/dependencies.rb:155:in `require'
/home/pb/public_html/sb/releases/20081214100119/config/../vendor/rails/railties/lib/rails/gem_dependency.rb:95:in `load'
/home/pb/public_html/sb/releases/20081214100119/config/../vendor/rails/railties/lib/initializer.rb:281:in `load_gems'
/home/pb/public_html/sb/releases/20081214100119/config/../vendor/rails/railties/lib/initializer.rb:281:in `each'
/home/pb/public_html/sb/releases/20081214100119/config/../vendor/rails/railties/lib/initializer.rb:281:in `load_gems'
/home/pb/public_html/sb/releases/20081214100119/config/../vendor/rails/railties/lib/initializer.rb:164:in `process'
/home/pb/public_html/sb/releases/20081214100119/config/../vendor/rails/railties/lib/initializer.rb:112:in `send'
/home/pb/public_html/sb/releases/20081214100119/config/../vendor/rails/railties/lib/initializer.rb:112:in `run'
/home/pb/public_html/sb/releases/20081214100119/config/environment.rb:13
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
/home/pb/public_html/sb/releases/20081214100119/vendor/rails/activesupport/lib/active_support/dependencies.rb:153:in `require'
/home/pb/public_html/sb/releases/20081214100119/vendor/rails/activesupport/lib/active_support/dependencies.rb:521:in `new_constants_in'
/home/pb/public_html/sb/releases/20081214100119/vendor/rails/activesupport/lib/active_support/dependencies.rb:153:in `require'
/home/pb/public_html/sb/releases/20081214100119/vendor/rails/railties/lib/tasks/misc.rake:3
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:in `call'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in `each'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:578:in `invoke_with_call_chain'
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:571:in `invoke_with_call_chain'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:588:in `invoke_prerequisites'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:585:in `each'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:585:in `invoke_prerequisites'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:577:in `invoke_with_call_chain'
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:571:in `invoke_with_call_chain'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:564:in `invoke'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2019:in `invoke_task'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in `each'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2036:in `standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1991:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1970:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2036:in `standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1967:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/bin/rake:31
/usr/bin/rake:19:in `load'
/usr/bin/rake:19
Missing these required gems:
  RedCloth  = 4.1.1

You're running:
  ruby 1.8.6.111 at /usr/bin/ruby1.8
  rubygems 1.2.0 at /usr/lib/ruby/gems/1.8

Run `rake gems:install` to install the missing gems.


When I run
rake gems:install

as suggested:
no such file to load -- RedCloth
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:32:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:32:in `require'
/home/pb/public_html/sb/releases/20081214100119/vendor/rails/activesupport/lib/active_support/dependencies.rb:155:in `require'
/home/pb/public_html/sb/releases/20081214100119/config/../vendor/rails/railties/lib/rails/gem_dependency.rb:95:in `load'
/home/pb/public_html/sb/releases/20081214100119/config/../vendor/rails/railties/lib/initializer.rb:281:in `load_gems'
/home/pb/public_html/sb/releases/20081214100119/config/../vendor/rails/railties/lib/initializer.rb:281:in `each'
/home/pb/public_html/sb/releases/20081214100119/config/../vendor/rails/railties/lib/initializer.rb:281:in `load_gems'
/home/pb/public_html/sb/releases/20081214100119/config/../vendor/rails/railties/lib/initializer.rb:164:in `process'
/home/pb/public_html/sb/releases/20081214100119/config/../vendor/rails/railties/lib/initializer.rb:112:in `send'
/home/pb/public_html/sb/releases/20081214100119/config/../vendor/rails/railties/lib/initializer.rb:112:in `run'
/home/pb/public_html/sb/releases/20081214100119/config/environment.rb:13
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
/home/pb/public_html/sb/releases/20081214100119/vendor/rails/activesupport/lib/active_support/dependencies.rb:153:in `require'
/home/pb/public_html/sb/releases/20081214100119/vendor/rails/activesupport/lib/active_support/dependencies.rb:521:in `new_constants_in'
/home/pb/public_html/sb/releases/20081214100119/vendor/rails/activesupport/lib/active_support/dependencies.rb:153:in `require'
/home/pb/public_html/sb/releases/20081214100119/vendor/rails/railties/lib/tasks/misc.rake:3
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:in `call'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in `each'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:578:in `invoke_with_call_chain'
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:571:in `invoke_with_call_chain'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:564:in `invoke'
/home/pb/public_html/sb/releases/20081214100119/vendor/rails/railties/lib/tasks/gems.rake:21
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:in `call'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in `each'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:578:in `invoke_with_call_chain'
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:571:in `invoke_with_call_chain'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:588:in `invoke_prerequisites'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:585:in `each'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:585:in `invoke_prerequisites'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:577:in `invoke_with_call_chain'
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:571:in `invoke_with_call_chain'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:564:in `invoke'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2019:in `invoke_task'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in `each'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2036:in `standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1991:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1970:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2036:in `standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1967:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/bin/rake:31
/usr/bin/rake:19:in `load'
/usr/bin/rake:19
gem install RedCloth --version "= 4.1.1" --source http://code.whytheluckystiff.net
ERROR:  could not find gem RedCloth locally or in a repository

After I run
sudo gem install RedCloth --version "= 4.1.1" --source http://code.whytheluckystiff.net

as suggested (even though it's already installed) and I try running
rake db:migrate

again, I just get the same error as the first one I listed.

I get the same results on both OS X and Ubuntu with:
Rails 2.2.0
ruby 1.8.6
rubygems 1.3.1

Re: RedCloth 4.1.1 and config.gem sadness

Hmm, I begin to suspect a regression with using Rails 2.2.2's gems dependency hooks. I just went to the RedCloth lighthouse site to raise a ticket, and found berkelep has beaten me to it!

Re: RedCloth 4.1.1 and config.gem sadness

I have been able to fix the error:

no such file to load -- redcloth_scan

after unpacking the gem by doing the following at the command line:

rake gems:build

which I believe built the required redcloth_scan extension (which you get when you install the gem, but not when you unpack the gem).  I noticed it places this in vendor/gems/RedCloth-4.1.1/ext/redcloth_scan, so I also added this to the front of my load paths in environment.rb:

config.load_paths.unshift "#{RAILS_ROOT}/vendor/gems/RedCloth-4.1.1/ext/redcloth_scan"

Re: RedCloth 4.1.1 and config.gem sadness

I found this rather enlightening for this situation, since I didn't know a lot about native extensions in gems: http://www.theagiledeveloper.com/commentaries/45

Re: RedCloth 4.1.1 and config.gem sadness

@moklett

I tried `rake gems:build' already, and got the same error. Additionally, after `rake gems:unpack', the supposedly missing redcloth_scan is exactly where it should be. Argh!

And hacking the load_path smells bad to me - the Configuration instance should handle all that for you, so there should be no need to do it. Indeed, it works for all the other gems my current project utilises (haml, RubyInline, ImageScience, mislav-will_paginate, inter alia) which leads me to conclude that there is a regression with RedCloth 4.1.1 in Rails 2.2.2.

The article you ref'd is almost a year old, from the days before this functionality was included in Rails Core, I believe.

Unfortunately, I'm not smart enough to be able to fix it :-(

Thanks for your input, though - I'm glad you got it working, even if I haven't!

Re: RedCloth 4.1.1 and config.gem sadness

The article you ref'd is almost a year old, from the days before this functionality was included in Rails Core, I believe.

Right, but I don't think the config.gem functionality can yet handle native extensions without some hand holding.  You'll need some way of referencing the correct extension for each platform you're working with - that's where I found the article helpful.

On linux, building the redcloth_scan extension should yield redcloth_scan.so, and that's what you need to have in your load path someplace when redcloth.rd goes to require it.

This all applies to trying to use the gem in a vendored (frozen) manner.

Re: RedCloth 4.1.1 and config.gem sadness

@moklett:

Your solution worked on OS X. However on my server running Ubuntu Hardy I receive the following error:

 sudo rake gems:build --trace
(in /home/p/public_html/s/releases/20081220094647)
** Invoke gems:build (first_time)
** Execute gems:build
Built gem: '/home/p/public_html/s/releases/20081220094647/vendor/gems/rspec-rails-1.1.11'
Built gem: '/home/p/public_html/s/releases/20081220094647/vendor/gems/mislav-will_paginate-2.3.6'
Built gem: '/home/p/public_html/s/releases/20081220094647/vendor/gems/capistrano-ext-1.2.1'
Built gem: '/home/p/public_html/s/releases/20081220094647/vendor/gems/rubyist-aasm-2.0.2'
Built gem: '/home/p/public_html/s/releases/20081220094647/vendor/gems/rspec-1.1.11'
rake aborted!
ERROR: Failed to build gem native extension.

/usr/bin/ruby1.8 extconf.rb gems:build --trace
creating Makefile

make
cc -shared -o redcloth_scan.so redcloth_attributes.o redcloth_scan.o redcloth_inline.o -L"." -L"/usr/lib" -L. -Wl,-Bsymbolic-functions -rdynamic -Wl,-export-dynamic -lruby1.8 -lpthread -ldl -lcrypt -lm -lc
redcloth_attributes.o: file not recognized: File format not recognized
collect2: ld returned 1 exit status
make: *** [redcloth_scan.so] Error 1


Gem files will remain installed in /home/p/public_html/s/releases/20081220094647/vendor/gems/RedCloth-4.1.1 for inspection.
Results logged to /home/p/public_html/s/releases/20081220094647/vendor/gems/RedCloth-4.1.1/ext/redcloth_scan/gem_make.out
/usr/local/lib/site_ruby/1.8/rubygems/installer.rb:502:in `build_extensions'
/usr/local/lib/site_ruby/1.8/rubygems/installer.rb:465:in `each'
/usr/local/lib/site_ruby/1.8/rubygems/installer.rb:465:in `build_extensions'
/home/p/public_html/s/releases/20081220094647/vendor/rails/railties/lib/tasks/gems.rake:33
/home/p/public_html/s/releases/20081220094647/vendor/rails/railties/lib/tasks/gems.rake:28:in `each'
/home/p/public_html/s/releases/20081220094647/vendor/rails/railties/lib/tasks/gems.rake:28
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:in `call'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in `each'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:578:in `invoke_with_call_chain'
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:571:in `invoke_with_call_chain'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:564:in `invoke'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2019:in `invoke_task'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in `each'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2036:in `standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1991:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1970:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2036:in `standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1967:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/bin/rake:31
/usr/bin/rake:19:in `load'
/usr/bin/rake:19


I'd like your help if you know how to fix this. Thanks.

Last edited by berkelep (2008-12-20 06:15:14)

Re: RedCloth 4.1.1 and config.gem sadness

moklett wrote:

Right, but I don't think the config.gem functionality can yet handle native extensions without some hand holding.  You'll need some way of referencing the correct extension for each platform you're working with - that's where I found the article helpful.

On linux, building the redcloth_scan extension should yield redcloth_scan.so, and that's what you need to have in your load path someplace when redcloth.rd goes to require it.

This all applies to trying to use the gem in a vendored (frozen) manner.

Ah, that makes sense.

However, building the RedCloth gem did indeed create redcloth_scan.so, and the subsequent rake gems:unpack copied it correctly to the vendor/gems dir. I thought the config.gem stuff would automatically build an appropriate load path for you when your app starts.

I think I'll leave it alone for the time being - the app works, and installing a gem on my VPS is no big deal...

Thanks for your insight.

Re: RedCloth 4.1.1 and config.gem sadness

I've been having the same problem and wasn't able to get the gem to build on the Ubuntu machine using 'sudo rake gems:build'. It threw the same error @berkelep has above. Well if you go into the redcloth_scan directory and run 'make clean' first then it will build properly when you run 'sudo rake gems:build'

I updated the Lighthouse ticket with this information. I'm not sure why or how this fixes the problem but it worked for me. Hope it helps - and I hope a permanent fix is found soon.

Re: RedCloth 4.1.1 and config.gem sadness

etandrib's solution worked for me smile

Re: RedCloth 4.1.1 and config.gem sadness

I don't understand this problem at all...but I'm having it on my production server.
After reading all this, I have so many questions and I don't know which are the right ones to ask, so here's all of them:

1. It must not be common because there's very little I can find on Google about it.  So then why am I having this problem?  Should I be using a different markup to be more mainstream and avoid these kinds of issues?

2.  If this functionality is built into rails core, then why do I need the gem?

3. Why do I have to explicitly call the gem with config gem in my environment.rb?

4. It ran fine on my dev machine, but to deploy it am I supposed to unpack it?  Why?

5.  Do I need to unpack the gem if it shows up in the server's gem list?

6.  Where is this "redcloth_scan" directory?
I found _A_ "redcloth_scan" directory, entered it, ran "make clean" and got this result:

blog/current/vendor/gems/RedCloth-4.1.9/ext/redcloth_scan$ make clean
make: *** No rule to make target `clean'.  Stop.

I'm sure I don't understand what you guys mean by running "make clean"...it's not just a simple command, right?

7.  Do I perform these opperations on both my local and remote versions?

8.  If I have to perform these opperations on unpacked gems in my vendors/gems folder that's part of my project repository, then will I have to redo this make clean (whatever that means)

9.  Was it a mistake for me to unpack the gem?   How do I un-unpack it?  Just remove the files?
Where is this stuff formally documented in a logical way?

UPDATE:  Meh.  This might be my hosting company's fault?   

I was able to get my app launched by removing the vendor/gems folder form my app, uninstalling RedCloth 4.x and installing RedCloth 3.0.3.  That is up and running for now...however WHY I couldn't get anything later than 3.0.4 installed and running on my webhost remains a mystery.

Last edited by Hamoth (2009-04-15 21:13:26)

High-Tech Creative Services http://new.techism.com/

Re: RedCloth 4.1.1 and config.gem sadness

Wow, there are a lot of questions at the same time. What's exactly is not working?

RedCloth 3 is old and slow, install version 4.x at all cost. Beware of RedCloth camelcase stupidity:

$ sudo gem install RedCloth

Then in environment.rb:

config.gem 'RedCloth', :lib => 'redcloth'

Re: RedCloth 4.1.1 and config.gem sadness

RedCloth 3 is old and slow, install version 4.x at all cost.

Lol, the cost is that application doesn't start.
I get this error:

** Daemonized, any open files are closed.  Look at log/mongrel.pid and log/mongrel.log for info.
** Starting Mongrel listening at 0.0.0.0:2016
** Starting Rails with production environment...
libruby1.8.so.1.8: cannot open shared object file: No such file or directory - /home/12345/data/rubygems/gems/gems
/RedCloth-4.1.1/lib/redcloth_scan.so

I can't "sudo" since I'm on a shared host, but RedCloth 4.1.1 is installed.

Here's my gem list:

*** LOCAL GEMS ***
actionmailer (2.3.2, 2.2.2, 2.0.2)
actionpack (2.3.2, 2.2.2, 2.0.2)
activerecord (2.3.2, 2.2.2, 2.0.2)
activeresource (2.3.2, 2.2.2, 2.0.2)
activesupport (2.3.2, 2.2.2, 2.0.2)
cgi_multipart_eof_fix (2.5.0)
daemons (1.0.10)
echoe (3.1.1)
fastthread (1.0.1)
gem_plugin (0.2.3)
gravtastic (2.0.0)
highline (1.5.0)
mongrel (1.1.5)
mysql (2.7)
postgres (0.7.9.2008.01.28)
rails (2.3.2, 2.2.2, 2.0.2)
rake (0.8.3)
RedCloth (4.1.1, 3.0.3)
rmagick (1.15.15)
rubyforge (1.0.3)
rubygems-update (1.3.2)

blog/current$ script/about

About your application's environment
Ruby version              1.8.5 (i386-linux)
RubyGems version          1.3.2
Rack version              1.0 bundled
Rails version             2.3.2
Active Record version     2.3.2
Action Pack version       2.3.2
Active Resource version   2.3.2
Action Mailer version     2.3.2
Active Support version    2.3.2
Application root          -- censored --
Environment               development
Database adapter          mysql

Last edited by Hamoth (2009-04-16 14:57:28)

High-Tech Creative Services http://new.techism.com/

Re: RedCloth 4.1.1 and config.gem sadness

It was my host's setup that was causing my problem.  They fixed it.

High-Tech Creative Services http://new.techism.com/

Re: RedCloth 4.1.1 and config.gem sadness

That's why dedicated boxes are a much better solution, you control your setup.

Re: RedCloth 4.1.1 and config.gem sadness

On Rails 2.3.2 I ran into exactly the same problem with my Joyent account, so to help people out, here's what I did to solve the problem.

First, I unpacked RedCloth:

rake gems:unpack

Next, I tried running my specs, and they failed with
no such file to load -- redcloth_scan
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in `require'
/Users/jbrains/Workspaces/jbrains.ca/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in `require'
/Users/jbrains/Workspaces/jbrains.ca/vendor/rails/activesupport/lib/active_support/dependencies.rb:521:in `new_constants_in'
...

I looked in vendor/gems/RedCloth-4.1.9/ext and found a redcloth_scan directory, so I went there to build the native extensions myself.
cd /Users/jbrains/Workspaces/jbrains.ca/vendor/gems/RedCloth-4.1.9/ext/redcloth_scan
ruby extconf.rb
make clean
make
cd -

Then I added a line to the environment to load the RedCloth native extension.

(in environment.rb)

REDCLOTH_VERSION="4.1.9"
...
  config.load_paths.unshift "#{RAILS_ROOT}/vendor/gems/RedCloth-#{REDCLOTH_VERSION}/ext/redcloth_scan"
...
  config.gem "RedCloth", :version => REDCLOTH_VERSION, :source => "http://code.whytheluckystiff.net"

When I ran my specs again, they ran correctly and passed. I started the application, poked around, and it worked.

When I deployed to Joyent, the application wouldn't start with the same error as I saw in my development environment, so I rebuilt the native extensions there, too:

cd ./applications/weblog/vendor/gems/RedCloth-4.1.9/ext/redcloth_scan
ruby extconf.rb
make clean
make
cd -

It annoys me that I had to do that, but at least now when they upgrade RedCloth, it won't affect me.

Problem solved, at least for now.

Last edited by jbrains (2009-05-12 11:35:44)

Re: RedCloth 4.1.1 and config.gem sadness

Make sure not to check in native builds and install them on your server.
Just delete gems that actually have native builds and run sudo rake gems:install && sudo rake gems:build.

Best,
Jan Riethmayer

Re: RedCloth 4.1.1 and config.gem sadness

In case anyone comes to this page and is having similar issues, try installing RVM and setting up Rails that way. I was having an issue with redcloth_scan, and — although I don't know if it was something else that I did that resolved it — setting up RVM seems to have set everything right. RVM is at http://rvm.beginrescueend.com/