Defect #6081
closed
Get error when trying to set environment to something other then development, test or production
Added by Roy Nielsen over 14 years ago.
Updated almost 8 years ago.
Description
Error:
undefined method `[]' for nil:NilClass
Exception class:
NoMethodError
OS Ubuntu 10.4
redmine 0.9.3-1 (came with the distro)
Yes, I've set the /etc/redmine/default/database.yml to add:
to_migrate:
adapter: mysql
database: to_migrate
host: localhost
port:
username: redmine
password: <mypass>
encoding: utf8
environment.rb to have the following RAILS_ENV:
ENV['RAILS_ENV'] ||= 'to_migrate'
and made a to_migrate.rb (a copy of the development.rb file)
When I do all those things for development or production, it works... Trying to do something other gives the error above.
- Category deleted (
Website (redmine.org))
- Assignee deleted (
Jean-Philippe Lang)
Ubuntu ships with a patched version if Redmine, so it is very likely that this issues is caused by the patches.
Please at least provide a full trace of the error so we can check.
Hello,
The page I get yields:
These are the possible causes:
*
There may be a syntax error in the application's code. Please check for such errors and fix them.
*
A required library may not installed. Please install all libraries that this application requires.
*
The application may not be properly configured. Please check whether all configuration files are written correctly, fix any incorrect configurations, and restart this application.
*
A service that the application relies on (such as the database server or the Ferret search engine server) may not have been started. Please start that service.
Further information about the error may have been written to the application's log file. Please check it in order to analyse the problem.
Error message:
undefined method `[]' for nil:NilClass
Exception class:
NoMethodError
Application root:
/usr/share/r2/redmine
Backtrace:
# File Line Location
0 /usr/share/r2/redmine/config/environment.rb 31
1 /usr/lib/ruby/1.8/rubygems/custom_require.rb 31 in `gem_original_require'
2 /usr/lib/ruby/1.8/rubygems/custom_require.rb 31 in `require'
3 /usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb 299 in `preload_application'
4 /usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb 248 in `initialize_server'
5 /usr/lib/ruby/1.8/phusion_passenger/utils.rb 255 in `report_app_init_status'
6 /usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb 233 in `initialize_server'
7 /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb 194 in `start_synchronously'
8 /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb 163 in `start'
9 /usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb 209 in `start'
10 /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb 262 in `spawn_rails_application'
11 /usr/lib/ruby/1.8/phusion_passenger/abstract_server_collection.rb 126 in `lookup_or_add'
12 /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb 256 in `spawn_rails_application'
13 /usr/lib/ruby/1.8/phusion_passenger/abstract_server_collection.rb 80 in `synchronize'
14 /usr/lib/ruby/1.8/phusion_passenger/abstract_server_collection.rb 79 in `synchronize'
15 /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb 255 in `spawn_rails_application'
16 /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb 154 in `spawn_application'
17 /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb 287 in `handle_spawn_application'
18 /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb 352 in `__send__'
19 /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb 352 in `main_loop'
20 /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb 196 in `start_synchronously'
21 /usr/lib/phusion_passenger/passenger-spawn-server 61
(I'm using passenger if that helps)
Thanks,
-Roy
Each environment needs a file in config/environments/NAME.rb
. Development, test, and production are already included. Try copying production (or development) to create your to_migrate.rb
environment.
Hello,
I tried copying the development.rb to a to_migrate.rb file, as well as changing the database.yml & environment.rb file.
I don't see where you say to do something different.
Unfortunately I've had to go to separate bitnami installations to solve my issue.
It would be nice if what you and I describe actually works.
Maybe it works on a newer version of redmine than ships with ubuntu 10.4?
Regards,
-Roy
- Status changed from New to Closed
- Resolution set to Invalid
Redmine 0.9.3 is too old and not maintained any longer.
Closing this issue.
- Description updated (diff)
Also available in: Atom
PDF