# Rake db:migrate\_plugins RAILS\_ENV=production fails with "no such file to load -- initializer"

**URL:** <https://www.ruby-forum.com/t/rake-db-migrate-plugins-rails-env-production-fails-with-no-such-file-to-load-initializer/229408>\
**Category:** Rails\
**Created:** [February 6, 2013, 6:04pm UTC](https://www.ruby-forum.com/t/rake-db-migrate-plugins-rails-env-production-fails-with-no-such-file-to-load-initializer/229408 "2013-02-06T18:04:04Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![stephan\_d26](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f07891/32.png) [@stephan\_d26](https://www.ruby-forum.com/u/stephan_d26)\
**Post date:** [February 6, 2013, 6:04pm UTC](https://www.ruby-forum.com/t/rake-db-migrate-plugins-rails-env-production-fails-with-no-such-file-to-load-initializer/229408/1 "2013-02-06T18:04:04Z")

</div>

I’m running Redmine on Ruby, and attempting to load a new plugin. When I  
attempt to run the command:

rake db:migrate\_plugins RAILS\_ENV=production

It fails with this error:

rake aborted!  
no such file to load – initializer  
/var/www/redmine/config/boot.rb:65:in `require' /var/www/redmine/config/boot.rb:65:in`load\_initializer’  
/var/www/redmine/config/boot.rb:43:in `run' /var/www/redmine/config/boot.rb:16:in`boot!’  
/var/www/redmine/config/boot.rb:124  
/var/www/redmine/Rakefile:4  
(See full trace by running task with --trace)

I am a sysadmin and not overly familiar with Ruby or Rails, and  
attempting to get this up for our developers. I’ve been googling all  
morning and had no success.

I can provide gem list output if required.

Ruby version:  
ruby 1.8.7 (2012-02-08 MBARI 8/0x8770 on patchlevel 358) [i686-linux],  
MBARI 0x8770, Ruby Enterprise Edition 2012.02

Rails version:  
3.2.11

Redmine version:  
1.4.4

thank-you

---

<div class="post-metadata">

**Author:** ![stephan\_d26](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f07891/32.png) [@stephan\_d26](https://www.ruby-forum.com/u/stephan_d26)\
**Post date:** [February 6, 2013, 6:13pm UTC](https://www.ruby-forum.com/t/rake-db-migrate-plugins-rails-env-production-fails-with-no-such-file-to-load-initializer/229408/2 "2013-02-06T18:13:45Z")

</div>

On Wed, Feb 6, 2013 at 11:04 AM, habur gate [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> I’m running Redmine on Ruby, and attempting to load a new plugin. When I  
> attempt to run the command:

It’s diagnostically irrelevant to mention that you “installed a new  
plugin” and not provide that plugin name and how you went about doing  
it.

> rake db:migrate\_plugins RAILS\_ENV=production

You should really set that inside of the env permanently rather than  
raking with it in the line, you are asking for mistakes to be made if  
you don’t enforce it on the server.

> (See full trace by running task with --trace)  
> Are you sure Rails is installed? Also, the backtrace leads you right  
> to the file.

> I am a sysadmin and not overly familiar with Ruby or Rails, and  
> attempting to get this up for our developers. I’ve been googling all  
> morning and had no success.

Why are you doing your developers debugging?

---

<div class="post-metadata">

**Author:** ![stephan\_d26](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f07891/32.png) [@stephan\_d26](https://www.ruby-forum.com/u/stephan_d26)\
**Post date:** [February 6, 2013, 6:24pm UTC](https://www.ruby-forum.com/t/rake-db-migrate-plugins-rails-env-production-fails-with-no-such-file-to-load-initializer/229408/3 "2013-02-06T18:24:49Z")

</div>

Hi Jordan, thanks for the reply. I’ll attempt to provide the information  
you asked for.

> It’s diagnostically irrelevant to mention that you “installed a new  
> plugin” and not provide that plugin name and how you went about doing  
> it.

1. The plugin is called “code review”  
([http://www.redmine.org/plugins/codereview](http://www.redmine.org/plugins/codereview)) and I installed it in  
/vendor/plugins where all other plugins are installed, as per plugin  
installation instructions.

> > rake db:migrate\_plugins RAILS\_ENV=production
> 
> You should really set that inside of the env permanently rather than  
> raking with it in the line, you are asking for mistakes to be made if  
> you don’t enforce it on the server.

1. When I say I’m not familiar with Ruby, I mean 0%. How can I enforce  
production on the server?

> The backtrace leads you right to the file.

1. Output of rake with --trace:  
(in /var/www/redmine)  
rake aborted!  
no such file to load – initializer  
/var/www/redmine/config/boot.rb:65:in `require' /var/www/redmine/config/boot.rb:65:in `load\_initializer’  
/var/www/redmine/config/boot.rb:43:in `run' /var/www/redmine/config/boot.rb:16:in `boot!’  
/var/www/redmine/config/boot.rb:124  
/usr/local/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:36:in  
`gem_original_require' /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require’  
/var/www/redmine/Rakefile:4  
/usr/local/lib/ruby/gems/1.8/gems/rake-10.0.3/lib/rake/rake\_module.rb:25:in  
`load' /usr/local/lib/ruby/gems/1.8/gems/rake-10.0.3/lib/rake/rake_module.rb:25:in `load\_rakefile’  
/usr/local/lib/ruby/gems/1.8/gems/rake-10.0.3/lib/rake/application.rb:583:in  
`raw_load_rakefile' /usr/local/lib/ruby/gems/1.8/gems/rake-10.0.3/lib/rake/application.rb:89:in `load\_rakefile’  
/usr/local/lib/ruby/gems/1.8/gems/rake-10.0.3/lib/rake/application.rb:160:in  
`standard_exception_handling' /usr/local/lib/ruby/gems/1.8/gems/rake-10.0.3/lib/rake/application.rb:88:in `load\_rakefile’  
/usr/local/lib/ruby/gems/1.8/gems/rake-10.0.3/lib/rake/application.rb:72:in  
`run' /usr/local/lib/ruby/gems/1.8/gems/rake-10.0.3/lib/rake/application.rb:160:in `standard\_exception\_handling’  
/usr/local/lib/ruby/gems/1.8/gems/rake-10.0.3/lib/rake/application.rb:70:in  
`run' /usr/local/lib/ruby/gems/1.8/gems/rake-10.0.3/bin/rake:33 /usr/local/bin/rake:19:in `load’  
/usr/local/bin/rake:19

> Why are you doing your developers debugging?

1. Company politics.

> Are you sure rails is installed?

1. Yes, version 3.2.11, as stated in the initial post.

---

<div class="post-metadata">

**Author:** ![stephan\_d26](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f07891/32.png) [@stephan\_d26](https://www.ruby-forum.com/u/stephan_d26)\
**Post date:** [February 6, 2013, 6:38pm UTC](https://www.ruby-forum.com/t/rake-db-migrate-plugins-rails-env-production-fails-with-no-such-file-to-load-initializer/229408/4 "2013-02-06T18:38:18Z")

</div>

On Wed, Feb 6, 2013 at 11:24 AM, habur gate [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Jordon B. wrote in post #1095584:
> 
> 1. The plugin is called “code review” (  
> [http://www.redmine.org/plugins/codereview](http://www.redmine.org/plugins/codereview) ) and I installed it to the  
> /vendor/plugins directory along with the other plugins, as per the  
> instructions.

It only works with Redmine 2 you’ll either need to install an older  
version of the plugin (and hope it has no security issues or read the  
changelogs) or upgrade your Redmine.

> 1. When I say I’m not familiar with Ruby, I mean 0%. How can I enforce  
> production on the server?

Put it in both your ~/.bashrc|~/.zshrc and the user that Redmin runs as  
file.

RACK\_ENV=“production”  
RAILS\_ENV=$RACK\_ENV

> 1. Company politics.

Tell them Devops 🙂

> 1. Finally, yes, rails is installed, please read my initial post.  
> Version 3.2.11

Rails 3.2.11 does not work with Redmine 1.4, that is a Rails 2.3  
application. Your post also indicates you are 1.4.4 you need to be on  
1.4.7 considering there was a CVE that was recently fixed. That said,  
my suggestion is if this is a new install move to 2.x branch with  
Rails 3 instead of using the older branch on an unsupported version of  
Rails.

---

<div class="post-metadata">

**Author:** ![stephan\_d26](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f07891/32.png) [@stephan\_d26](https://www.ruby-forum.com/u/stephan_d26)\
**Post date:** [February 6, 2013, 9:05pm UTC](https://www.ruby-forum.com/t/rake-db-migrate-plugins-rails-env-production-fails-with-no-such-file-to-load-initializer/229408/5 "2013-02-06T21:05:27Z")

</div>

Just an update to this for future reference, option #1 (installing an  
older version of the plugin) worked for me. Hopefully this helps someone  
in the future.

---

<div class="post-metadata">

**Author:** ![stephan\_d26](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f07891/32.png) [@stephan\_d26](https://www.ruby-forum.com/u/stephan_d26)\
**Post date:** [February 6, 2013, 7:10pm UTC](https://www.ruby-forum.com/t/rake-db-migrate-plugins-rails-env-production-fails-with-no-such-file-to-load-initializer/229408/6 "2013-02-06T19:10:06Z")

</div>

Jordon B. wrote in post #1095589:

> It only works with Redmine 2 you’ll either need to install an older  
> version of the plugin (and hope it has no security issues or read the  
> changelogs) or upgrade your Redmine.

I guess I assumed the plugin would be backwards compatible with  
older versions of Redmine, but I guess not.

> Put it in both your ~/.bashrc|~/.zshrc and the user that Redmin runs as  
> file.
> 
> RACK\_ENV=“production”  
> RAILS\_ENV=$RACK\_ENV

Will do.

> Tell them Devops 🙂

Will try.

> Rails 3.2.11 does not work with Redmine 1.4, that is a Rails 2.3  
> application. Your post also indicates you are on Redmine 1.4.4 you need \> to be  
> on 1.4.7 considering there was a CVE that was recently fixed. That  
> said,  
> my suggestion is if this is a new install move to 2.x branch (of Redmine) with  
> Rails 3 instead of using the older branch on an unsupported version of  
> Rails.

The Ruby/Rails/Redmine stack is running on a pre-built TurnKey Linux VM  
appliance. I did upgrade Rails to 3.2.11, but it was originally 2.3.14.  
Since the entire VM stack (Debian 6, Ruby 1.8.7, Rails 2.3.14, Redmine  
1.4.4) came out of the box ready to go, I will first try an older plugin  
version, before doing an entire stack upgrade just for the sake of a  
single plugin.

For future Googlers, these are the solutions I’ll attempt, in this  
order:

1. Try an older version of the “code review” plugin, one that is  
compatible with Redmine v1.4.x. If that fails, then:

2a. Upgrade Rails from 2.3.14 → 3.2.11  
2b. Upgrade Redmine from 1.4.4 → 2.2.2  
2c. Install the latest version of the “code review plugin”

1. If both of the above steps fail, I’ll build a new VM from scratch,  
and key the cars of our devs 😉

Thanks for your help Jordan. I’ll post back the results for future  
reference.
