This project is archived and is in readonly mode.

#3726 ✓resolved
andrehjr (at gmail)

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

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

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

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

Comments and changes to this ticket

  • andrehjr (at gmail)

    andrehjr (at gmail) January 17th, 2010 @ 09:50 PM

    • Tag changed from plugin to bugmash, plugin
  • Ryan Bigg

    Ryan Bigg January 18th, 2010 @ 05:37 AM

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

  • andrehjr (at gmail)

    andrehjr (at gmail) January 18th, 2010 @ 09:23 AM

    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.

  • Thomas R. Koll

    Thomas R. Koll January 22nd, 2010 @ 09:50 PM

    • 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.

  • Prem Sichanugrist (sikachu)

    Prem Sichanugrist (sikachu) January 25th, 2010 @ 03:40 PM

    • 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
    

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Pages