-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set value of local variable "adapter" in recipes/source.rb to "mysql" if it equals "mysql2" #11
base: master
Are you sure you want to change the base?
Conversation
… if global is adapter variable is "mysql2"
Hi @pbchase, Actually, the only adapter supported (for Mysql) is Maybe it should be more clear at the documentation that the supported adapter are just I don't know if this resolve your issue of you still see something that need to be done about this PR. Thanks for the feedback 😄 |
So when is the mysql gem installed? I tried it your way, had some errors I had to stumble through, but ultimately received a complaint from passenger the mysql2 gem could not be found. This is, by the way, with Redmine 2.3.1. Ruby (Rack) application could not be started 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: Could not find gem 'mysql2 (~> 0.3.11) ruby' in the gems available on this machine. (Bundler::GemNotFound) Exception class: PhusionPassenger::UnknownError Application root: /var/www/redmine Backtrace: # File Line Location 0 /usr/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/resolver.rb 296 in `resolve' 1 /usr/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/resolver.rb 168 in `start' 2 /usr/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/resolver.rb 129 in `block in resolve' 3 /usr/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/resolver.rb 128 in `catch' 4 /usr/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/resolver.rb 128 in `resolve' 5 /usr/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/definition.rb 179 in `resolve' 6 /usr/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/definition.rb 114 in `specs' 7 /usr/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/definition.rb 159 in `specs_for' 8 /usr/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/definition.rb 148 in `requested_specs' 9 /usr/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/environment.rb 18 in `requested_specs' 10 /usr/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb 13 in `setup' 11 /usr/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler.rb 120 in `setup' 12 /usr/lib/ruby/gems/1.9.1/gems/passenger-3.0.19/lib/phusion_passenger/utils.rb 326 in `prepare_app_process' 13 /usr/lib/ruby/gems/1.9.1/gems/passenger-3.0.19/lib/phusion_passenger/rack/application_spawner.rb 156 in `block in initialize_server' 14 /usr/lib/ruby/gems/1.9.1/gems/passenger-3.0.19/lib/phusion_passenger/utils.rb 563 in `report_app_init_status' 15 /usr/lib/ruby/gems/1.9.1/gems/passenger-3.0.19/lib/phusion_passenger/rack/application_spawner.rb 154 in `initialize_server' 16 /usr/lib/ruby/gems/1.9.1/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server.rb 204 in `start_synchronously' 17 /usr/lib/ruby/gems/1.9.1/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server.rb 180 in `start' 18 /usr/lib/ruby/gems/1.9.1/gems/passenger-3.0.19/lib/phusion_passenger/rack/application_spawner.rb 129 in `start' 19 /usr/lib/ruby/gems/1.9.1/gems/passenger-3.0.19/lib/phusion_passenger/spawn_manager.rb 253 in `block (2 levels) in spawn_rack_application' 20 /usr/lib/ruby/gems/1.9.1/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server_collection.rb 132 in `lookup_or_add' 21 /usr/lib/ruby/gems/1.9.1/gems/passenger-3.0.19/lib/phusion_passenger/spawn_manager.rb 246 in `block in spawn_rack_application' 22 /usr/lib/ruby/gems/1.9.1/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server_collection.rb 82 in `block in synchronize' 23 prelude> 10:in `synchronize' 24 /usr/lib/ruby/gems/1.9.1/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server_collection.rb 79 in `synchronize' 25 /usr/lib/ruby/gems/1.9.1/gems/passenger-3.0.19/lib/phusion_passenger/spawn_manager.rb 244 in `spawn_rack_application' 26 /usr/lib/ruby/gems/1.9.1/gems/passenger-3.0.19/lib/phusion_passenger/spawn_manager.rb 137 in `spawn_application' 27 /usr/lib/ruby/gems/1.9.1/gems/passenger-3.0.19/lib/phusion_passenger/spawn_manager.rb 275 in `handle_spawn_application' 28 /usr/lib/ruby/gems/1.9.1/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server.rb 357 in `server_main_loop' 29 /usr/lib/ruby/gems/1.9.1/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server.rb 206 in `start_synchronously' 30 /usr/lib/ruby/gems/1.9.1/gems/passenger-3.0.19/helper-scripts/passenger-spawn-server 99 in ` ' |
Hi, @pbchase, sorry for the delay. I've to check this properly, because I have the minimal tests passed on CentOS and Ubuntu, but I didn't try in Debian nor I did dig too much into the passender part. One question. Did you run by hand the Redmine application or was was Chef? I've checked a bit the logs and a vagrant box with the recipe installed and the problem could come from the Ruby paths. Chef uses a different path (I believe) than the system and I think the gem may be installed in the Chef's path. Any feedback will be much appreciated. Thanks for the help 😄 |
In some contexts the attribute node["redmine"]["databases"][environment]["adapter"] refers to a gem name. As such it can assume value of "mysql" or "mysql2" among others. However, in recipes/sources.rb the adapter variable is used repeatedly in case statements that do not support the value "mysql2".
This is the error log received when node["redmine"]["databases"][environment]["adapter"] == "mysql2"
Rewriting the value of adapter from "mysql2" to "mysql" within recipes/sources.rb allows the existing case statements to select mysql components.
Platform tested: Debian 7 RC1 64-bit
Version tested: Chef: 11.4.0
Cookbook versions: