Forum: Ruby on Rails Rails issue when using Rails 2.3.2 and Ruby 1.9.1

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.
542cd9370accf3d6228fcac29e09c5d6?d=identicon&s=25 Doug Lilla (dunebaba)
on 2009-06-04 07:06
Hello,


I'm having a problem with Rails since updating to Rails 2.3.2 and Ruby
1.9.1 on PPC MAC 10.5.6.
I installed twice,but still get the same error when trying to create a
new Rails app:

/Users/douglilla/.gem/ruby/1.9.1/gems/rails-2.3.2/lib/rails_generator/options.rb:32:in
`default_options': undefined method `write_inheritable_attribute' for
Rails::Generator::Base:Class (NoMethodError)
  from
/Users/douglilla/.gem/ruby/1.9.1/gems/rails-2.3.2/lib/rails_generator/base.rb:90:in
`<class:Base>'
  from
/Users/douglilla/.gem/ruby/1.9.1/gems/rails-2.3.2/lib/rails_generator/base.rb:85:in
`<module:Generator>'
  from
/Users/douglilla/.gem/ruby/1.9.1/gems/rails-2.3.2/lib/rails_generator/base.rb:48:in
`<module:Rails>'
  from
/Users/douglilla/.gem/ruby/1.9.1/gems/rails-2.3.2/lib/rails_generator/base.rb:6:in
`<top (required)>'
  from
/Users/douglilla/.gem/ruby/1.9.1/gems/rails-2.3.2/lib/rails_generator.rb:34:in
`require'
  from
/Users/douglilla/.gem/ruby/1.9.1/gems/rails-2.3.2/lib/rails_generator.rb:34:in
`<top (required)>'
  from /Users/douglilla/.gem/ruby/1.9.1/gems/rails-2.3.2/bin/rails:14:in
`require'
  from /Users/douglilla/.gem/ruby/1.9.1/gems/rails-2.3.2/bin/rails:14:in
`<top (required)>'
  from /usr/local/bin/rails:19:in `load'
  from /usr/local/bin/rails:19:in `<main>'


Any suggestions would be greatly appreciated.

Thanks,

DL
40db9e75b3f5899258e3bdc0c9210154?d=identicon&s=25 Conrad Taylor (conradwt)
on 2009-06-04 07:18
(Received via mailing list)
On Wed, Jun 3, 2009 at 10:06 PM, Doug Lilla <
rails-mailing-list@andreas-s.net> wrote:

> /Users/douglilla/.gem/ruby/1.9.1/gems/rails-2.3.2/lib/rails_generator/options.rb:32:in
>  from
> `require'
>
>
> Any suggestions would be greatly appreciated.
>
> Thanks,
>
> DL


a)  What's does the following commands generate?

    ruby -v
    gem -v

b)  Did you try to install Rails using the following?

     sudo gem install rails

-Conrad
542cd9370accf3d6228fcac29e09c5d6?d=identicon&s=25 Doug Lilla (dunebaba)
on 2009-06-04 16:08
Conrad Taylor wrote:
> On Wed, Jun 3, 2009 at 10:06 PM, Doug Lilla <
> rails-mailing-list@andreas-s.net> wrote:
>
>> /Users/douglilla/.gem/ruby/1.9.1/gems/rails-2.3.2/lib/rails_generator/options.rb:32:in
>>  from
>> `require'
>>
>>
>> Any suggestions would be greatly appreciated.
>>
>> Thanks,
>>
>> DL
>
>
> a)  What's does the following commands generate?
>
>     ruby -v
>     gem -v
>
> b)  Did you try to install Rails using the following?
>
>      sudo gem install rails
>
> -Conrad

Conrad,

a)

Doug-Lillas-Computer:~ douglilla$ ruby -v
ruby 1.9.1p129 (2009-05-12 revision 23412) [powerpc-darwin9.6.0]
Doug-Lillas-Computer:~ douglilla$ gem -v
1.3.4
Doug-Lillas-Computer:~ douglilla$

b)

Yes I installed with sudo gem rails


DL
40db9e75b3f5899258e3bdc0c9210154?d=identicon&s=25 Conrad Taylor (conradwt)
on 2009-06-04 22:54
(Received via mailing list)
On Thu, Jun 4, 2009 at 7:08 AM, Doug Lilla
<rails-mailing-list@andreas-s.net
> wrote:

> >>
> >     gem -v
>
>
If that's the case, why are your error messages referencing files in

/Users/douglilla/.gem

instead

<parent_directory_of_gem_repository>/gem

Usually, this happens when you do not perform the installation of gems
as root and the gem executable will use ${HOME}/.gem as the fallback.
OK, what's does the following produce?

gem environment

-Conrad
542cd9370accf3d6228fcac29e09c5d6?d=identicon&s=25 Doug Lilla (dunebaba)
on 2009-06-04 23:24
Conrad Taylor wrote:
> On Thu, Jun 4, 2009 at 7:08 AM, Doug Lilla
> <rails-mailing-list@andreas-s.net
>> wrote:
>
>> >>
>> >     gem -v
>>
>>
> If that's the case, why are your error messages referencing files in
>
> /Users/douglilla/.gem
>
> instead
>
> <parent_directory_of_gem_repository>/gem
>
> Usually, this happens when you do not perform the installation of gems
> as root and the gem executable will use ${HOME}/.gem as the fallback.
> OK, what's does the following produce?
>
> gem environment
>
> -Conrad


Here's what the command gem environment lists:

Doug-Lillas-Computer:~ douglilla$ gem environment
RubyGems Environment:
  - RUBYGEMS VERSION: 1.3.4
  - RUBY VERSION: 1.9.1 (2009-05-12 patchlevel 129)
[powerpc-darwin9.6.0]
  - INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/1.9.1
  - RUBYGEMS PREFIX:
/usr/local/lib/ruby/gems/1.9.1/gems/rubygems-update-1.3.4
  - RUBY EXECUTABLE: /usr/local/bin/ruby
  - EXECUTABLE DIRECTORY: /usr/local/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - powerpc-darwin-9
  - GEM PATHS:
     - /usr/local/lib/ruby/gems/1.9.1
     - /Users/douglilla/.gem/ruby/1.9.1
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
     - :sources => ["http://gems.rubyforge.org/",
"http://gems.github.com/"]
  - REMOTE SOURCES:
     - http://gems.rubyforge.org/
     - http://gems.github.com/

I guess I will need to reinstall? My set-up was working fine until I
upgraded. Thanks for your help!

DL
40db9e75b3f5899258e3bdc0c9210154?d=identicon&s=25 Conrad Taylor (conradwt)
on 2009-06-04 23:44
(Received via mailing list)
On Thu, Jun 4, 2009 at 2:24 PM, Doug Lilla
<rails-mailing-list@andreas-s.net
> wrote:

> > If that's the case, why are your error messages referencing files in
> >
>  - RUBY VERSION: 1.9.1 (2009-05-12 patchlevel 129)
>     - /usr/local/lib/ruby/gems/1.9.1
>     - http://gems.rubyforge.org/
>     - http://gems.github.com/
>
> I guess I will need to reinstall? My set-up was working fine until I
> upgraded. Thanks for your help!
>
> DL
>

DL, please try doing the following:

rm -rfi ${HOME}/.gem

-Conrad
542cd9370accf3d6228fcac29e09c5d6?d=identicon&s=25 Doug Lilla (dunebaba)
on 2009-06-05 00:02
Conrad Taylor wrote:
> On Thu, Jun 4, 2009 at 2:24 PM, Doug Lilla
> <rails-mailing-list@andreas-s.net
>> wrote:
>
>> > If that's the case, why are your error messages referencing files in
>> >
>>  - RUBY VERSION: 1.9.1 (2009-05-12 patchlevel 129)
>>     - /usr/local/lib/ruby/gems/1.9.1
>>     - http://gems.rubyforge.org/
>>     - http://gems.github.com/
>>
>> I guess I will need to reinstall? My set-up was working fine until I
>> upgraded. Thanks for your help!
>>
>> DL
>>
>
> DL, please try doing the following:
>
> rm -rfi ${HOME}/.gem
>
> -Conrad

Conrad,

I used the command you suggested, ended up deleting some 1.8 files and
then came up with this:


Doug-Lillas-Computer:~ douglilla$ rm -rfi ${HOME}/.gem
examine files in directory /Users/douglilla/.gem? yes
examine files in directory /Users/douglilla/.gem/ruby? yes
examine files in directory /Users/douglilla/.gem/ruby/1.8? yes
examine files in directory /Users/douglilla/.gem/ruby/1.8/cache? yes
remove /Users/douglilla/.gem/ruby/1.8/cache/actionmailer-2.3.2.gem? no
remove /Users/douglilla/.gem/ruby/1.8/cache/actionpack-2.3.2.gem? no
remove /Users/douglilla/.gem/ruby/1.8/cache/activerecord-2.3.2.gem? no
remove /Users/douglilla/.gem/ruby/1.8/cache/activeresource-2.3.2.gem? no
remove /Users/douglilla/.gem/ruby/1.8/cache/activesupport-2.3.2.gem? no
remove /Users/douglilla/.gem/ruby/1.8/cache/builder-2.1.2.gem? no


Apparently a lot of gems got installed in the wrong directory??

Thanks,

DL
40db9e75b3f5899258e3bdc0c9210154?d=identicon&s=25 Conrad Taylor (conradwt)
on 2009-06-05 00:29
(Received via mailing list)
On Thu, Jun 4, 2009 at 3:02 PM, Doug Lilla
<rails-mailing-list@andreas-s.net
> wrote:

> >>     - http://gems.rubyforge.org/
> > rm -rfi ${HOME}/.gem
> examine files in directory /Users/douglilla/.gem? yes
>
> Apparently a lot of gems got installed in the wrong directory??
>
> Thanks,
>
> DL


DL, all you gems should be installed in the following:

For Ruby 1.9.1 gems:   /usr/local/lib/ruby/gems/1.9.1

For Ruby 1.8    gems:   /usr/local/lib/ruby/gems/1.8

Thus, you shouldn't be installing your gems ${HOME}/.gems because this
isn't
the
correct place for them if you're using sudo.

Good luck,

-Conrad
This topic is locked and can not be replied to.