...
Just my blog

Blog about everything, mostly about tech stuff I made. Here is the list of stuff I'm using at my blog. Feel free to ask me about implementations.

Soft I recommend
Py lib I recommend

I'm using these libraries so you can ask me about them.

LoadError: cannot load such file -- /var/www/config/environment

Итак, снова бок: LoadError: cannot load such file -- /var/www/config/environment Неразрешенная, эта проблема может привести к тому, что некоторые страницы редмайна отвалятся: "Internal error" - Лог - ActionView::Template::Error (undefined method `inherit_members' for #<Project:0x0000000735a0f0>):

[su_spoiler title="Вывод"]

root@tet-redmine www/redmine# rake db:migrate RAILS_ENV="production" --trace
rake aborted!
LoadError: cannot load such file -- /var/www/config/environment
/var/lib/gems/1.9.1/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:251:in `require'
/var/lib/gems/1.9.1/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:251:in `block in require'
/var/lib/gems/1.9.1/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:236:in `load_dependency'
/var/lib/gems/1.9.1/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:251:in `require'
/var/www/redmine/plugins/redmine_reminder/lib/tasks/reminder_all.rake:29:in `<top (required)>'
/var/lib/gems/1.9.1/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:245:in `load'
/var/lib/gems/1.9.1/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:245:in `block in load'
/var/lib/gems/1.9.1/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:236:in `load_dependency'
/var/lib/gems/1.9.1/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:245:in `load'
/var/www/redmine/lib/tasks/redmine.rake:178:in `block in <top (required)>'
/var/www/redmine/lib/tasks/redmine.rake:178:in `each'
/var/www/redmine/lib/tasks/redmine.rake:178:in `<top (required)>'
/var/lib/gems/1.9.1/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:245:in `load'
/var/lib/gems/1.9.1/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:245:in `block in load'
/var/lib/gems/1.9.1/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:236:in `load_dependency'
/var/lib/gems/1.9.1/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:245:in `load'
/var/lib/gems/1.9.1/gems/railties-3.2.17/lib/rails/engine.rb:425:in `block in load_tasks'
/var/lib/gems/1.9.1/gems/railties-3.2.17/lib/rails/engine.rb:425:in `each'
/var/lib/gems/1.9.1/gems/railties-3.2.17/lib/rails/engine.rb:425:in `load_tasks'
/var/lib/gems/1.9.1/gems/railties-3.2.17/lib/rails/application.rb:145:in `load_tasks'
/var/lib/gems/1.9.1/gems/railties-3.2.17/lib/rails/railtie/configurable.rb:30:in `method_missing'
/var/www/redmine/Rakefile:8:in `<top (required)>'
/var/lib/gems/1.9.1/gems/rake-10.3.2/lib/rake/rake_module.rb:28:in `load'
/var/lib/gems/1.9.1/gems/rake-10.3.2/lib/rake/rake_module.rb:28:in `load_rakefile'
/var/lib/gems/1.9.1/gems/rake-10.3.2/lib/rake/application.rb:687:in `raw_load_rakefile'
/var/lib/gems/1.9.1/gems/rake-10.3.2/lib/rake/application.rb:94:in `block in load_rakefile'
/var/lib/gems/1.9.1/gems/rake-10.3.2/lib/rake/application.rb:176:in `standard_exception_handling'
/var/lib/gems/1.9.1/gems/rake-10.3.2/lib/rake/application.rb:93:in `load_rakefile'
/var/lib/gems/1.9.1/gems/rake-10.3.2/lib/rake/application.rb:77:in `block in run'
/var/lib/gems/1.9.1/gems/rake-10.3.2/lib/rake/application.rb:176:in `standard_exception_handling'
/var/lib/gems/1.9.1/gems/rake-10.3.2/lib/rake/application.rb:75:in `run'
/var/lib/gems/1.9.1/gems/rake-10.3.2/bin/rake:33:in `<top (required)>'
/usr/local/bin/rake:23:in `load'
/usr/local/bin/rake:23:in `<main>'

[/su_spoiler] Для начала сразу разберемся с типичными:

root@tet-redmine www/redmine# cd /var/www/config/environment
root@tet-redmine config/environment# ls -l
total 4
-rwxrwxrwx 1 www-data www-data 606 Jun 20 10:09 environment.rb

Вроде норм. Наверняка заданные 777 права и группа. Хотя, возможно я не тому юзеру дал файл, но делал по примеру старой копии. Если я не прав, потом вернусь к этому пункту. Хер его знает что я сделал, но теперь эта ошибка полечилась, но вылезла еще:

root@tet-redmine www/config# rake redmine:plugins:migrate RAILS_ENV=production
/var/lib/gems/1.9.1/gems/rake-10.3.2/lib/rake/application.rb:55:in `pwd': No such file or directory - getcwd (Errno::ENOENT)
 from /var/lib/gems/1.9.1/gems/rake-10.3.2/lib/rake/application.rb:55:in `initialize'
 from /var/lib/gems/1.9.1/gems/rake-10.3.2/lib/rake/rake_module.rb:8:in `new'
 from /var/lib/gems/1.9.1/gems/rake-10.3.2/lib/rake/rake_module.rb:8:in `application'
 from /var/lib/gems/1.9.1/gems/rake-10.3.2/bin/rake:33:in `<top (required)>'
 from /usr/local/bin/rake:23:in `load'
 from /usr/local/bin/rake:23:in `<main>'

Заметка:

root@tet-redmine www/config# gem update --system
ERROR: While executing gem ... (RuntimeError)
 gem update --system is disabled on Debian, because it will overwrite the content of the rubygems Debian package, and might break your Debian system in subtle ways. The Debian-supported way to update rubygems is through apt-get, using Debian official repositories.
If you really know what you are doing, you can still update rubygems by setting the REALLY_GEM_UPDATE_SYSTEM environment variable, but please remember that this is completely unsupported by Debian.

Заметка для идиота: No such file or directory - getcwd (Errno::ENOENT) -> Some people received this error after trying to run from an already deleted directory. А если удалить все плагины и запустить, то все получится:

root@tet-redmine www/redmine# rake redmine:plugins:migrate RAILS_ENV=production --trace
** Invoke redmine:plugins:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute redmine:plugins:migrate
** Invoke db:schema:dump (first_time)
** Invoke environment
** Invoke db:load_config (first_time)
** Execute db:load_config
** Execute db:schema:dump

Пояснение к процессу обновления RedMine! Прежде следовало бы удалить все плагины, потом пройти по степу 4 и далее уже что-то добавлять поочередно.

Step 4 - Update the database

This step is the one that could change the contents of your database. Go to your new redmine directory, then migrate your database:

rake db:migrate RAILS_ENV=production 

If you have installed any plugins, you should also run their database migrations:

rake redmine:plugins:migrate RAILS_ENV=production