Forum: Ruby Iconv (& sqlite) problems on Leopard: Ruby 1.9.1/Rails 2.3.2

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
7e9f543f0ffdb7c9a899e628fe76e7f3?d=identicon&s=25 Jacob Bandes-storch (jtbandes)
on 2009-04-26 23:34
I have both a PPC Mac and an Intel Mac, and I recently installed Ruby
1.9.1 from source on both the same way, and Rails 2.3.2. I'm trying to
run a Rails app locally that's set to use sqlite3.

This is a side question, not the main issue: on the PPC mac, when I
started the server, I got errors about sqlite3 not existing. I was able
to fix that by doing "sudo gem install sqlite3-ruby". This didn't happen
on the Intel mac. Why did I have to do that?

On the Intel mac, when I try to start the server, I get this:
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/active_support/inflector.rb:3:in
`require': no such file to load -- iconv (LoadError)
  from
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/active_support/inflector.rb:3:in
`<top (required)>'
  from
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/active_support/core_ext/integer/inflections.rb:1:in
`require'
  from
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/active_support/core_ext/integer/inflections.rb:1:in
`<top (required)>'
  from
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/active_support/core_ext/integer.rb:2:in
`require'
  from
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/active_support/core_ext/integer.rb:2:in
`<top (required)>'
  from
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/active_support/core_ext.rb:3:in
`require'
  from
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/active_support/core_ext.rb:3:in
`block in <top (required)>'
  from
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/active_support/core_ext.rb:1:in
`each'
  from
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/active_support/core_ext.rb:1:in
`<top (required)>'
  from
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/active_support.rb:55:in
`require'
  from
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/active_support.rb:55:in
`<top (required)>'
  from
/usr/local/lib/ruby/gems/1.9.1/gems/rails-2.3.2/lib/commands/server.rb:1:in
`require'
  from
/usr/local/lib/ruby/gems/1.9.1/gems/rails-2.3.2/lib/commands/server.rb:1:in
`<top (required)>'
  from script/server:3:in `require'
  from script/server:3:in `<main>'

And this doesn't happen on the PPC mac. On PPC, when I run "gem which
iconv", I get
/usr/local/lib/ruby/1.9.1/powerpc-darwin9.6.0/iconv.bundle. When I run
that on the Intel mac, I get "Can't find ruby library file or shared
library iconv". (Using the old preinstalled 1.8 version of ruby, the
path to the iconv bundle that's in .../Ruby.framework/... shows up, on
both computers.) I checked the
/usr/local/lib/ruby/1.9.1/i386-darwin9.6.0/ folder on the Intel mac, and
iconv.bundle is not there. Why is this happening? How can I fix it —
where can I get iconv?

Thanks.
4299e35bacef054df40583da2d51edea?d=identicon&s=25 James Gray (bbazzarrakk)
on 2009-04-27 00:00
(Received via mailing list)
On Apr 26, 2009, at 4:34 PM, Jacob Bandes-storch wrote:

> I have both a PPC Mac and an Intel Mac, and I recently installed Ruby
> 1.9.1 from source on both the same way, and Rails 2.3.2. I'm trying to
> run a Rails app locally that's set to use sqlite3.
>
> This is a side question, not the main issue: on the PPC mac, when I
> started the server, I got errors about sqlite3 not existing. I was
> able
> to fix that by doing "sudo gem install sqlite3-ruby". This didn't
> happen
> on the Intel mac. Why did I have to do that?

My leading guess would be that your path is different on the two
machines.  On one, it found the Ruby interpreter you expected, but on
the other it found one without the gem installed because of the way
the path was set.  Another option is that both Ruby interpreters had
the gem installed on one box, but not the other.

> On the Intel mac, when I try to start the server, I get this:
> /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/
> active_support/inflector.rb:3:in
> `require': no such file to load -- iconv (LoadError)

> where can I get iconv?
The standard iconv library ships with Ruby, so you shouldn't need to
install it on either version.  It's part of Ruby's standard library.

I'm not sure why Rails fails to find it, that being the case.  You're
install obviously isn't what I expect it to be.

James Edward Gray II
7e9f543f0ffdb7c9a899e628fe76e7f3?d=identicon&s=25 Jacob Bandes-storch (jtbandes)
on 2009-04-27 00:16
> My leading guess would be that your path is different on the two
> machines.  On one, it found the Ruby interpreter you expected, but on
> the other it found one without the gem installed because of the way
> the path was set.  Another option is that both Ruby interpreters had
> the gem installed on one box, but not the other.
The paths are about the same, both having /usr/local/bin:/usr/bin:/bin
at the beginning, so I don't know how that would happen. The Ruby
interpreter on both is the same, 1.9.1p0.

> The standard iconv library ships with Ruby, so you shouldn't need to
> install it on either version.  It's part of Ruby's standard library.
>
> I'm not sure why Rails fails to find it, that being the case.  You're
> install obviously isn't what I expect it to be.
That's odd. Both were configured with --enable-shared --enable-pthread
CFLAGS=-D_XOPEN_SOURCE=1 (from
http://hivelogic.com/articles/view/ruby-rails-leopard). Is that helpful
at all? How would I go about figuring out why it didn't install iconv on
the one machine?

Another thing I just noticed is that when I run ruby script/console on
the Intel mac, I get:
Loading development environment (Rails 2.3.2)
/usr/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.2/lib/active_record/i18n_interpolation_deprecation.rb:23:in
`<class:Simple>': undefined method `alias_method_chain' for
I18n::Backend::Simple:Class (NoMethodError)
Whereas it works on the PPC mac. Is this related? Or is something really
broken?
This topic is locked and can not be replied to.