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.

Rails.root doesn't seem avaliable from install.rb when installing a plugin

#3726

Trying to use 'Rails.root' on a install.rb returns nil when installing a plugin.

The same doesn't not happen with init.rb.

Reported by andrehjr (at gmail) · January 17th, 2010 @ 07:51 PM

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

Activity

  1. andrehjr (at gmail)
    andrehjr (at gmail)
    • Tag changed from plugin to bugmash, plugin

    January 17th, 2010 @ 09:50 PM

  2. Ryan Bigg
    Ryan Bigg

    Is this in 3.0 or 2.3? Could you give us a repo to try this on?

    January 18th, 2010 @ 05:37 AM

  3. andrehjr (at gmail)
    andrehjr (at gmail)

    Of course!

    try (i created this when I was testing)

    script/plugin install git://github.com/andrehjr/more_or_less.git

    sorry I forgor to mention, it is Rails 3. I tried against 2.3 and it worked.

    January 18th, 2010 @ 09:23 AM

  4. Thomas R. Koll
    Thomas R. Koll
    • Tag changed from bugmash, plugin to bugmash, plugin, rails.root

    I've experienced the same bug when uncommenting the line about 'config.i18n.load_path' in rails3 config/application.rb

    Rails 2.x defined the RAILS_ROOT in config/boot.rb before anything else and I think setting Rails.root at the same place might make sense.

    January 22nd, 2010 @ 09:50 PM

  5. Prem Sichanugrist (sikachu)
    Prem Sichanugrist (sikachu)
    • State changed from new to resolved

    I've tried it on current master (3b6f6), I think this is fixed.

    $ script/plugin install git://github.com/andrehjr/more_or_less.git
    Initialized empty Git repository in /Users/sikachu/rails_apps/test_edge/vendor/plugins/more_or_less/.git/
    remote: Counting objects: 16, done.
    remote: Compressing objects: 100% (13/13), done.
    remote: Total 16 (delta 1), reused 0 (delta 0)
    Unpacking objects: 100% (16/16), done.
    From git://github.com/andrehjr/more_or_less
     * branch            HEAD       -> FETCH_HEAD
    Rails.root.nil? => false
    Rails.env development
    

    January 25th, 2010 @ 03:40 PM