RedCloth .... PILES of warnings when I require it

(Jeff Wood) #1

I've downloaded and have the Gem for RedCloth 3.0.3 installed.

When I require it ( after require 'rubygems' ) I get a PILE of warning messages about constants that are already defined ...

Anybody have any input on this?

I'd love to have a quiet this stuff down...

j.

(Alex) #2

Jeff Wood wrote:

I've downloaded and have the Gem for RedCloth 3.0.3 installed.

When I require it ( after require 'rubygems' ) I get a PILE of warning messages about constants that are already defined ...

Anybody have any input on this?

I'd love to have a quiet this stuff down...

j.

Comstants? Strange...
This is what I get:

C:\instiki>ruby -w -e "require 'redcloth'"
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/redcloth.rb:612: warning: ambiguous first argument; put parentheses or even spaces
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/redcloth.rb:832: warning: ambiguous first argument; put parentheses or even spaces
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/redcloth.rb:1037: warning: ambiguous first argument; put parentheses or even spaces
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/redcloth.rb:815: warning: method redefined; discarding old inline_markdown_link

same with require_gem 'RedCloth'

Alex

(Jeff Wood) #3

Alex Verhovsky wrote:

Jeff Wood wrote:

I've downloaded and have the Gem for RedCloth 3.0.3 installed.

When I require it ( after require 'rubygems' ) I get a PILE of warning messages about constants that are already defined ...

Anybody have any input on this?

I'd love to have a quiet this stuff down...

j.

Comstants? Strange...
This is what I get:

C:\instiki>ruby -w -e "require 'redcloth'"
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/redcloth.rb:612: warning: ambiguous first argument; put parentheses or even spaces
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/redcloth.rb:832: warning: ambiguous first argument; put parentheses or even spaces
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/redcloth.rb:1037: warning: ambiguous first argument; put parentheses or even spaces
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/redcloth.rb:815: warning: method redefined; discarding old inline_markdown_link

same with require_gem 'RedCloth'

Alex

I'm getting:

irb(main):001:0> require 'RedCloth'
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:169: warning: already initialized constant VERSION
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:170: warning: already initialized constant DEFAULT_RULES
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:311: warning: already initialized constant TEXTILE_TAGS
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:324: warning: already initialized constant A_HLGN
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:325: warning: already initialized constant A_VLGN
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:326: warning: already initialized constant C_CLAS
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:327: warning: already initialized constant C_LNGE
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:328: warning: already initialized constant C_STYL
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:329: warning: already initialized constant S_CSPN
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:330: warning: already initialized constant S_RSPN
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:331: warning: already initialized constant A
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:332: warning: already initialized constant S
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:333: warning: already initialized constant C
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:335: warning: already initialized constant PUNCT
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:336: warning: already initialized constant HYPERLINK
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:342: warning: already initialized constant SIMPLE_HTML_TAGS
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:364: warning: already initialized constant GLYPHS
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:371: warning: already initialized constant H_ALGN_VALS
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:377: warning: already initialized constant V_ALGN_VALS
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:390: warning: already initialized constant QTAGS
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:475: warning: already initialized constant TABLE_RE
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:513: warning: already initialized constant LISTS_RE
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:514: warning: already initialized constant LISTS_CONTENT_RE
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:565: warning: already initialized constant CODE_RE
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:583: warning: already initialized constant BLOCKS_GROUP_RE
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:655: warning: already initialized constant BLOCK_RE
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:671: warning: already initialized constant SETEXT_RE
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:686: warning: already initialized constant ATX_RE
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:696: warning: already initialized constant MARKDOWN_BQ_RE
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:709: warning: already initialized constant MARKDOWN_RULE_RE
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:749: warning: already initialized constant LINK_RE
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:781: warning: already initialized constant MARKDOWN_REFLINK_RE
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:813: warning: already initialized constant MARKDOWN_LINK_RE
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:827: warning: already initialized constant TEXTILE_REFS_RE
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:828: warning: already initialized constant MARKDOWN_REFS_RE
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:868: warning: already initialized constant IMAGE_RE
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:961: warning: already initialized constant OFFTAGS
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:962: warning: already initialized constant OFFTAG_MATCH
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:963: warning: already initialized constant OFFTAG_OPEN
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:964: warning: already initialized constant OFFTAG_CLOSE
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:965: warning: already initialized constant HASTAG_MATCH
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:966: warning: already initialized constant ALLTAG_MATCH
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:1085: warning: already initialized constant BASIC_TAGS
=> true
irb(main):002:0>

... I get these same errors in my output when I do the require from a script instead of IRB ... I'd LOVE to see these go away...

As far as environment specifics ... I'm running Ruby for Windows ( one-click 1.8.2 - 15 ) ... and I used Gem to install RedCloth ( version 3.0.3 )

So, if ANYBODY can provide a bit of information to help get rid of these, I'd really appreciate it.

j.

(Jeff Wood) #4

Jeff Wood wrote:

Alex Verhovsky wrote:

Jeff Wood wrote:

I've downloaded and have the Gem for RedCloth 3.0.3 installed.

When I require it ( after require 'rubygems' ) I get a PILE of warning messages about constants that are already defined ...

Anybody have any input on this?

I'd love to have a quiet this stuff down...

j.

Comstants? Strange...
This is what I get:

C:\instiki>ruby -w -e "require 'redcloth'"
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/redcloth.rb:612: warning: ambiguous first argument; put parentheses or even spaces
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/redcloth.rb:832: warning: ambiguous first argument; put parentheses or even spaces
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/redcloth.rb:1037: warning: ambiguous first argument; put parentheses or even spaces
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/redcloth.rb:815: warning: method redefined; discarding old inline_markdown_link

same with require_gem 'RedCloth'

Alex

I'm getting:

irb(main):001:0> require 'RedCloth'
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:169: warning: already initialized constant VERSION
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:170: warning: already initialized constant DEFAULT_RULES
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:311: warning: already initialized constant TEXTILE_TAGS
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:324: warning: already initialized constant A_HLGN
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:325: warning: already initialized constant A_VLGN
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:326: warning: already initialized constant C_CLAS
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:327: warning: already initialized constant C_LNGE
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:328: warning: already initialized constant C_STYL
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:329: warning: already initialized constant S_CSPN
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:330: warning: already initialized constant S_RSPN
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:331: warning: already initialized constant A
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:332: warning: already initialized constant S
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:333: warning: already initialized constant C
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:335: warning: already initialized constant PUNCT
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:336: warning: already initialized constant HYPERLINK
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:342: warning: already initialized constant SIMPLE_HTML_TAGS
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:364: warning: already initialized constant GLYPHS
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:371: warning: already initialized constant H_ALGN_VALS
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:377: warning: already initialized constant V_ALGN_VALS
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:390: warning: already initialized constant QTAGS
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:475: warning: already initialized constant TABLE_RE
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:513: warning: already initialized constant LISTS_RE
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:514: warning: already initialized constant LISTS_CONTENT_RE
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:565: warning: already initialized constant CODE_RE
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:583: warning: already initialized constant BLOCKS_GROUP_RE
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:655: warning: already initialized constant BLOCK_RE
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:671: warning: already initialized constant SETEXT_RE
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:686: warning: already initialized constant ATX_RE
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:696: warning: already initialized constant MARKDOWN_BQ_RE
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:709: warning: already initialized constant MARKDOWN_RULE_RE
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:749: warning: already initialized constant LINK_RE
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:781: warning: already initialized constant MARKDOWN_REFLINK_RE
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:813: warning: already initialized constant MARKDOWN_LINK_RE
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:827: warning: already initialized constant TEXTILE_REFS_RE
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:828: warning: already initialized constant MARKDOWN_REFS_RE
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:868: warning: already initialized constant IMAGE_RE
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:961: warning: already initialized constant OFFTAGS
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:962: warning: already initialized constant OFFTAG_MATCH
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:963: warning: already initialized constant OFFTAG_OPEN
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:964: warning: already initialized constant OFFTAG_CLOSE
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:965: warning: already initialized constant HASTAG_MATCH
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:966: warning: already initialized constant ALLTAG_MATCH
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:1085: warning: already initialized constant BASIC_TAGS
=> true
irb(main):002:0>

... I get these same errors in my output when I do the require from a script instead of IRB ... I'd LOVE to see these go away...

As far as environment specifics ... I'm running Ruby for Windows ( one-click 1.8.2 - 15 ) ... and I used Gem to install RedCloth ( version 3.0.3 )

So, if ANYBODY can provide a bit of information to help get rid of these, I'd really appreciate it.

j.

Reading your mail further, I tried the same using require_gem 'RedCloth' and don't get all of those messages, why should that make a difference?

j.

(Gavin Kistner) #5

I'm guessing that you have redcloth installed both as a gem and as a library, and that it is being required from both locations, and the second require is redefining the constants. Guessing. Heavily.

···

On Aug 18, 2005, at 11:29 PM, Jeff Wood wrote:

Reading your mail further, I tried the same using require_gem 'RedCloth' and don't get all of those messages, why should that make a difference?

(Alex) #6

Gavin Kistner wrote:

Reading your mail further, I tried the same using require_gem 'RedCloth' and don't get all of those messages, why should that make a difference?

I'm guessing that you have redcloth installed both as a gem and as a library, and that it is being required from both locations, and the second require is redefining the constants. Guessing. Heavily.

Aha! I know, I know! Case-insensitive Windows file system strikes again, and this time it bites RubyGems in the stern. Amusing :slight_smile:

try require'redcloth' instead (note the lower case!), and see for yourself.

This is a RubyGems bug. To reproduce:

1. Take fresh Ruby install (must be on Windows)
2. Install RubyGems
3. Install RedCloth by gem install redcloth
4. Modify \ruby\lib\ruby\gems\1.8\gems\RedCloth3.0.3\redcloth.rb by adding puts 'HERE' in the beginning.
5. ruby -w -e "require 'RedCloth'"

C:\>ruby -w -e "require 'RedCloth'"
HERE
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/redcloth.rb:612: warning: ambiguous first argument; put parentheses or even spaces
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/redcloth.rb:832: warning: ambiguous first argument; put parentheses or even spaces
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/redcloth.rb:1037: warning: amiguous first argument; put parentheses or even spaces
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/redcloth.rb:815: warning: method redefined; discarding old inline_markdown_link
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:612: warning: ambiguous first argument; put parentheses or even spaces
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:832: warning: ambiguous first argument; put parentheses or even spaces
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:1037: warning: amiguous first argument; put parentheses or even spaces
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:169: warning: already initialized constant VERSION
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:170: warning: already initialized constant DEFAULT_RULES
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:242: warning: metod redefined; discarding old initialize
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:254: warning: metod redefined; discarding old to_html
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:311: warning: already initialized constant TEXTILE_TAGS
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:324: warning: already initialized constant A_HLGN
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:325: warning: already initialized constant A_VLGN
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:326: warning: already initialized constant C_CLAS
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:327: warning: already initialized constant C_LNGE
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:328: warning: already initialized constant C_STYL
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:329: warning: already initialized constant S_CSPN
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:330: warning: already initialized constant S_RSPN
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:331: warning: already initialized constant A
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:332: warning: already initialized constant S
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:333: warning: already initialized constant C
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:335: warning: already initialized constant PUNCT
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:336: warning: already initialized constant HYPERLINK
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:342: warning: already initialized constant SIMPLE_HTML_TAGS
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:364: warning: already initialized constant GLYPHS
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:371: warning: alre
this causes redcloth.rb to be loaded twice - first from ruby/lib/

Alex

···

On Aug 18, 2005, at 11:29 PM, Jeff Wood wrote:

(Krishna Dole) #7

I get the same double-load on Mac OS 10.3.9:

$ ruby -w -e "require 'rubygems'; require 'RedCloth'"
/usr/local/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/redcloth.rb:612:
warning: ambiguous first argument; put parentheses or even spaces
/usr/local/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/redcloth.rb:832:
warning: ambiguous first argument; put parentheses or even spaces
/usr/local/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/redcloth.rb:1037:
warning: ambiguous first argument; put parentheses or even spaces
/usr/local/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/redcloth.rb:815:
warning: method redefined; discarding old inline_markdown_link
/usr/local/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:612:
warning: ambiguous first argument; put parentheses or even spaces
/usr/local/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:832:
warning: ambiguous first argument; put parentheses or even spaces
/usr/local/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:1037:
warning: ambiguous first argument; put parentheses or even spaces
/usr/local/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:169:
warning: already initialized constant VERSION
/usr/local/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:170:
warning: already initialized constant DEFAULT_RULES
/usr/local/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:242:
warning: method redefined; discarding old initialize
/usr/local/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:254:
warning: method redefined; discarding old to_html
/usr/local/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:311:
warning: already initialized constant TEXTILE_TAGS
-- (and so on) --

Krishna

···

On 8/19/05, Alexey Verkhovsky <alex@verk.info> wrote:

Gavin Kistner wrote:

> On Aug 18, 2005, at 11:29 PM, Jeff Wood wrote:
>
>> Reading your mail further, I tried the same using require_gem
>> 'RedCloth' and don't get all of those messages, why should that make
>> a difference?
>
>
> I'm guessing that you have redcloth installed both as a gem and as a
> library, and that it is being required from both locations, and the
> second require is redefining the constants. Guessing. Heavily.
>
Aha! I know, I know! Case-insensitive Windows file system strikes again,
and this time it bites RubyGems in the stern. Amusing :slight_smile:

try require'redcloth' instead (note the lower case!), and see for yourself.

This is a RubyGems bug. To reproduce:

1. Take fresh Ruby install (must be on Windows)
2. Install RubyGems
3. Install RedCloth by gem install redcloth
4. Modify \ruby\lib\ruby\gems\1.8\gems\RedCloth3.0.3\redcloth.rb by
adding puts 'HERE' in the beginning.
5. ruby -w -e "require 'RedCloth'"

C:\>ruby -w -e "require 'RedCloth'"
HERE
HERE
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/redcloth.rb:612:
warning: ambiguous first argument; put parentheses or even spaces
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/redcloth.rb:832:
warning: ambiguous first argument; put parentheses or even spaces
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/redcloth.rb:1037:
warning: amiguous first argument; put parentheses or even spaces
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/redcloth.rb:815:
warning: method redefined; discarding old inline_markdown_link
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:612:
warning: ambiguous first argument; put parentheses or even spaces
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:832:
warning: ambiguous first argument; put parentheses or even spaces
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:1037:
warning: amiguous first argument; put parentheses or even spaces
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:169:
warning: already initialized constant VERSION
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:170:
warning: already initialized constant DEFAULT_RULES
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:242:
warning: metod redefined; discarding old initialize
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:254:
warning: metod redefined; discarding old to_html
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:311:
warning: already initialized constant TEXTILE_TAGS
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:324:
warning: already initialized constant A_HLGN
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:325:
warning: already initialized constant A_VLGN
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:326:
warning: already initialized constant C_CLAS
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:327:
warning: already initialized constant C_LNGE
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:328:
warning: already initialized constant C_STYL
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:329:
warning: already initialized constant S_CSPN
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:330:
warning: already initialized constant S_RSPN
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:331:
warning: already initialized constant A
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:332:
warning: already initialized constant S
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:333:
warning: already initialized constant C
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:335:
warning: already initialized constant PUNCT
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:336:
warning: already initialized constant HYPERLINK
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:342:
warning: already initialized constant SIMPLE_HTML_TAGS
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:364:
warning: already initialized constant GLYPHS
c:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.3/lib/RedCloth.rb:371:
warning: alre
this causes redcloth.rb to be loaded twice - first from ruby/lib/

Alex

(Stefan Schmiedl) #8

FWIW, I had a similar experience with a lib, whose name I've forgotten
(don't you just love this precision), but the problem disappeared after
I removed an environment variable RUBYOPT (IIRC) which seemed to have
survived from an *earlier* ruby installation.

So you might check your environment and remove suspicious RUBY.... variables.

HTH
s.

···

On Fri, 19 Aug 2005 20:17:14 +0900, Krishna Dole <dontfall@gmail.com> wrote:

1. Take fresh Ruby install (must be on Windows)
2. Install RubyGems
3. Install RedCloth by gem install redcloth
4. Modify \ruby\lib\ruby\gems\1.8\gems\RedCloth3.0.3\redcloth.rb by
adding puts 'HERE' in the beginning.
5. ruby -w -e "require 'RedCloth'"

(James Edward Gray II) #9

I see the same messages when I launch Instiki on TextDrive.

James Edward Gray II

···

On Aug 19, 2005, at 6:17 AM, Krishna Dole wrote:

I get the same double-load on Mac OS 10.3.9:

(Stephan Kämper) #10

Stefan Schmiedl wrote:

···

On Fri, 19 Aug 2005 20:17:14 +0900, Krishna Dole <dontfall@gmail.com> > wrote:

1. Take fresh Ruby install (must be on Windows)
2. Install RubyGems
3. Install RedCloth by gem install redcloth
4. Modify \ruby\lib\ruby\gems\1.8\gems\RedCloth3.0.3\redcloth.rb by
adding puts 'HERE' in the beginning.
5. ruby -w -e "require 'RedCloth'"

FWIW, I had a similar experience with a lib, whose name I've forgotten
(don't you just love this precision), but the problem disappeared after
I removed an environment variable RUBYOPT (IIRC) which seemed to have
survived from an *earlier* ruby installation.

So you might check your environment and remove suspicious RUBY.... variables.

HTH
s.

Or you might like to remove double entries in RUBYOPT. I had 'rubygems' twice mentioned in RUBYOPT.
BTW, that happened on a WinXP box running the one-click installer.

Happy rubying

Stephan

(Alex) #11

James Edward Gray II wrote:

···

On Aug 19, 2005, at 6:17 AM, Krishna Dole wrote:

I get the same double-load on Mac OS 10.3.9:

I see the same messages when I launch Instiki on TextDrive.

That's for a different reason - you see those when Madeleine replaces those things with object space from a snapshot.

Alex