Project

General

Profile

Where is the Redmine plugin generator? How to create a new plugin?

Added by xiao zhi over 8 years ago

I want to create a new plugin. In the http://www.redmine.org/projects/redmine/wiki/Plugin_Tutorial,
I can't find "script/rails",
And after run the command "ruby bin/rails generate redmine_plugin <plugin_name>",
the cmd returns "in 'require': cannot load such file -- bundler/setup";
I work in the Windows. THX.


Replies (5)

RE: Where is the Redmine plugin generator? How to create a new plugin? - Added by Filip Matiovsky over 8 years ago

The same for Linux as it looks like there are no scripts in Redmine v3.x.
I would be very helpful to have Plugin guide updated to Redmine v3.x. :)

Duplicated posts:
http://www.redmine.org/boards/4/topics/46352

RE: Where is the Redmine plugin generator? How to create a new plugin? - Added by Olivier Houdas over 8 years ago

The plugin guide was updated last Friday (Oct 16th 2015), but this just doesn't work better...
I'm using Redmine 3.1.1 (Rails 4.2.4) and when I run

bundle exec rails generate redmine_plugin myplugin

I get

Usage:
rails new APP_PATH [options]

etc. (help of the command)

Was anyone successful in creating a new plugin with Redmine 3.1?

RE: Where is the Redmine plugin generator? How to create a new plugin? - Added by Keith McGrellis about 8 years ago

I got that as well but I noticed this at the start of the output:

Looks like your app's ./bin/rails is a stub that was generated by Bundler.

In Rails 4, your app's bin/ directory contains executables that are versioned
like any other source code, rather than stubs that are generated on demand.

Here's how to upgrade:

  bundle config --delete bin    # Turn off Bundler's stub generator
  rake rails:update:bin         # Use the new Rails 4 executables

I followed those instructions and was prompted to overwrite files when running the second command.
I can now generate plugins without any warnings or errors.

Not sure if doing this affects anything else.

RE: Where is the Redmine plugin generator? How to create a new plugin? - Added by Olivier Houdas about 8 years ago

Thank you very much! This indeed fixed the issue for me as well!

    (1-5/5)