Content
Generating a plugin leads to crash
Added by Markus Pitha over 9 years ago
I followed these instructions: https://www.openproject.org/open-source/development/create-openproject-plugin/
Not even the the first command “bundle exec rails generate open_project:plugin a_good_name ../plugins/” works. I get the following error:
$ bundle exec rails generate open_project:plugin time_sheet_extended ownplugins require 'rails/all'... 0.430s Bundler.require... /opt/openproject-ce/vendor/bundle/ruby/2.2.0/gems/fog-core-1.25.0/lib/fog/core/collection.rb:144: warning: circular argument reference - filters /opt/openproject-ce/vendor/bundle/ruby/2.2.0/gems/fog-1.23.0/lib/fog/rackspace/mock_data.rb:42: warning: duplicated key at line 80 ignored: "name" 2.460s Application.initialize!... DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from block in <top (required)> at /opt/openproject-ce/config/environment.rb:35) DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from block in <top (required)> at /opt/openproject-ce/config/environment.rb:35) (erb):9:in `rescue in <main>': Invalid DATABASE_URL (RuntimeError) from (erb):6:in `<main>' from /usr/lib/ruby/2.2.0/erb.rb:863:in `eval' from /usr/lib/ruby/2.2.0/erb.rb:863:in `result' from /opt/openproject-ce/vendor/bundle/ruby/2.2.0/gems/railties-3.2.22/lib/rails/application/configuration.rb:115:in `database_configuration' from /opt/openproject-ce/vendor/bundle/ruby/2.2.0/gems/activerecord-3.2.22/lib/active_record/railtie.rb:84:in `block (2 levels) in <class:Railtie>' from /opt/openproject-ce/vendor/bundle/ruby/2.2.0/gems/activesupport-3.2.22/lib/active_support/lazy_load_hooks.rb:36:in `instance_eval' from /opt/openproject-ce/vendor/bundle/ruby/2.2.0/gems/activesupport-3.2.22/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook' from /opt/openproject-ce/vendor/bundle/ruby/2.2.0/gems/activesupport-3.2.22/lib/active_support/lazy_load_hooks.rb:26:in `block in on_load' from /opt/openproject-ce/vendor/bundle/ruby/2.2.0/gems/activesupport-3.2.22/lib/active_support/lazy_load_hooks.rb:25:in `each' from /opt/openproject-ce/vendor/bundle/ruby/2.2.0/gems/activesupport-3.2.22/lib/active_support/lazy_load_hooks.rb:25:in `on_load' from /opt/openproject-ce/vendor/bundle/ruby/2.2.0/gems/activerecord-3.2.22/lib/active_record/railtie.rb:80:in `block in <class:Railtie>' from /opt/openproject-ce/vendor/bundle/ruby/2.2.0/gems/railties-3.2.22/lib/rails/initializable.rb:30:in `instance_exec' from /opt/openproject-ce/vendor/bundle/ruby/2.2.0/gems/railties-3.2.22/lib/rails/initializable.rb:30:in `run' from /opt/openproject-ce/vendor/bundle/ruby/2.2.0/gems/railties-3.2.22/lib/rails/initializable.rb:55:in `block in run_initializers' from /opt/openproject-ce/vendor/bundle/ruby/2.2.0/gems/railties-3.2.22/lib/rails/initializable.rb:54:in `each' from /opt/openproject-ce/vendor/bundle/ruby/2.2.0/gems/railties-3.2.22/lib/rails/initializable.rb:54:in `run_initializers' from /opt/openproject-ce/vendor/bundle/ruby/2.2.0/gems/railties-3.2.22/lib/rails/application.rb:136:in `initialize!' from /opt/openproject-ce/vendor/bundle/ruby/2.2.0/gems/railties-3.2.22/lib/rails/railtie/configurable.rb:30:in `method_missing' from /opt/openproject-ce/config/environment.rb:35:in `block in <top (required)>' from /opt/openproject-ce/config/application.rb:43:in `block in bench' from /usr/lib/ruby/2.2.0/benchmark.rb:288:in `measure' from /opt/openproject-ce/config/application.rb:42:in `bench' from /opt/openproject-ce/config/environment.rb:33:in `<top (required)>' from /opt/openproject-ce/vendor/bundle/ruby/2.2.0/gems/activesupport-3.2.22/lib/active_support/dependencies.rb:251:in `require' from /opt/openproject-ce/vendor/bundle/ruby/2.2.0/gems/activesupport-3.2.22/lib/active_support/dependencies.rb:251:in `block in require' from /opt/openproject-ce/vendor/bundle/ruby/2.2.0/gems/activesupport-3.2.22/lib/active_support/dependencies.rb:236:in `load_dependency' from /opt/openproject-ce/vendor/bundle/ruby/2.2.0/gems/activesupport-3.2.22/lib/active_support/dependencies.rb:251:in `require' from /opt/openproject-ce/vendor/bundle/ruby/2.2.0/gems/railties-3.2.22/lib/rails/application.rb:103:in `require_environment!' from /opt/openproject-ce/vendor/bundle/ruby/2.2.0/gems/railties-3.2.22/lib/rails/commands.rb:25:in `<top (required)>' from script/rails:6:in `require' from script/rails:6:in `<main>'
Any ideas?
Replies (1)
Hi Markus,
you have both a warning from using 2.2.0 gems (the recommended ruby version for our dependencies is still 2.1.7 as of my writing), but that is not the actual error you’re seeing.
(erb):9:in `rescue in <main>': Invalid DATABASE_URL (RuntimeError)
.I can only assume that using the rake task does not properly set the database connection from URL as it should, given that you’re using the packaged community edition (openproject-ce).
If you’re interested in contributing a plugin or some other piece of code to OpenProject, I will gladly help you set up your machine.
I would suggest you instead set up a local development server using the following guide: https://github.com/opf/openproject/blob/dev/doc/QUICK_START.md
If you have questions or problems setting up your development environment, let me know by either replying here or sending me a mail.
Best regards,
Oliver from OpenProject