Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Running 'rails foo' under Ruby 1.9.1 fails w/ undefined method `camelize' for "app":String

#3552

This simple test passes with Ruby 1.8.7 (rvm), but fails with 1.9.1.

Example, trying to create a new rails app in the /tmp dir:

glenn@macbook-pro /tmp[ruby-1.9.1]$ rails foo
undefined method `camelize' for "app":String

Environment:

  • Ruby 1.9.1 installed with rvm (ruby-1.9.1-p376 [x86_64])

Gems:

glenn@macbook-pro /tmp[ruby-1.9.1]$ gem list

LOCAL GEMS

actionmailer (2.3.5)
actionpack (2.3.5)
activerecord (2.3.5)
activeresource (2.3.5)
activesupport (2.3.5)
bundler (0.7.1)
ffi (0.5.4)
gemcutter (0.2.0)
git (1.2.5)
jeweler (1.4.0)
json_pure (1.2.0)
mocha (0.9.8)
mysql (2.8.1)
net-scp (1.0.2)
net-ssh (2.0.16)
rack (1.0.1)
rails (2.3.5)
rake (0.8.7)
rubyforge (2.0.3)
rubygems-update (1.3.5)
sqlite3 (0.0.3)
test-spec (0.10.0)
test-unit (2.0.5)
xml-simple (1.0.12)
yard (0.4.0)

Reported by Glenn Rempe · December 8th, 2009 @ 07:42 PM

State: invalid
Milestone: none
Assigned to: nobody
Importance: none

Activity

  1. José Valim
    José Valim

    I cannot reproduce here:

    ruby 1.9.1p243 (2009-07-16 revision 24175) [i686-darwin10.2.0]

    January 3rd, 2010 @ 12:37 AM

  2. Conrad Taylor
    Conrad Taylor

    I was unable to reproduce on the following platforms using Ruby 1.9.1p376:

    Mac OS 10.5.8 (PPC)
    Mac OS 10.6.2 (Intel)

    January 3rd, 2010 @ 02:08 AM

  3. Glenn Rempe
    Glenn Rempe

    I was still able to reproduce using an rvm installed 1.9.1 p243. So I uninstalled rvm entirely (rvm implode) and started from scratch. I still get the same results, but only with 1.9.1 builds.

    I googled for the error and there are a number of related reports going back a couple of years which are identical to my report. Some of these suggest installing ruby-iconv to fix the problem. Most of these reports seem related to BSD or Cygwin installs (I am on OS X 10.6).

    http://bit.ly/6sJIsf

    So this may not be a new issue, but perhaps related to how rvm is compiling ruby 1.9.1 and rails doesn't fail gracefully?

    January 3rd, 2010 @ 02:25 AM

  4. Mikel Lindsaar
    Mikel Lindsaar

    Do check if your iconv library is all good.

    If it is not, you might have problems as a common way to regex strings in 1.9 is to convert them to 8-bit ascii first, this requires iconv.

    Do you get this output?

     $ rvm ruby-1.9.1-head
     $ irb
    irb(main):001:0> require 'iconv'
    => true
    irb(main):002:0> Iconv.conv('US-ASCII', 'UTF-8', 'Hello')
    => "Hello"
    irb(main):003:0> exit
    

    Mikel

    January 3rd, 2010 @ 08:21 AM

  5. Glenn Rempe
    Glenn Rempe

    I have found the solution to this error, and it is in fact related to iconv. Here is the solution for fixing it when installing ruby 1.9.x using RVM:

    http://exceptionz.wordpress.com/2010/02/03/how-to-fix-the-iconv-req...

    (please also note my comment for the proper command line as his wordpress blog is messing with the formatting.)

    Installing Ruby 1.9.x using RVM requires first installing a new vanilla iconv and readline within the rvm install, and then telling rvm to use that version when compiling, and not the version that comes with snow leopard. I suspect this will bite many people as rvm and 1.9.x become more popular.

    You may close bug this if you like as it is environment specific (unless rails would be able to test and warn if an improper install of iconv is present, which would be great).

    Thanks for the help pointing me towards the probable solution.

    February 3rd, 2010 @ 08:23 PM

  6. José Valim
    José Valim
    • State changed from new to invalid

    February 4th, 2010 @ 01:09 PM