1

I run Redmine 3.4 with Rails (5.2.0) and Docker 18.03.1-ce on Ubuntu 16.04 Xenial (which is new for me), following this GitHub repository: https://github.com/sameersbn/docker-redmine

I create my Rails app in the same folder where the docker-compose.yml has been created, and cd to it.

Then I have the exact same problem than described in this Redmine post (http://www.redmine.org/boards/3/topics/48309?r=48507#message-48507): when I try the command rails generate redmine_plugin Plug_test, this two error messages appear:

  • Running via Spring preloader in process 32109
  • Could not find generator 'redmine_plugin'

So I try the commands that Keith suggested, and running the generate command again, the Spring error message disappear, but the generate command still doesn't work (Could not find generator 'redmine_plugin').

Any idea what to do? I don't know if I'm going in the right direction.

Thanks a lot for your help.

mfedossa
  • 21
  • 5
  • Ok so for people that would find this post, the solution was simple. gem install and bundle all the correct versions in your Gemfile, rails s your app, check your environment (rails r "puts Rails.env"), change it to prod (export RAILS_ENV="production"), and then you can "rails generate redmine_plugin " – mfedossa Jun 14 '18 at 10:09

2 Answers2

0

well simple problem, you're running command from outside of your redmine app directory, you need to go into your redmine app directory, after that you can run rails generate redmine_plugin Plugin_test from there

Ravi Mariya
  • 1,210
  • 15
  • 19
  • Thank you for the answer, but being in my rails app and doing the command it tells me: $ rails generate redmine_plugin Plugin_test Running via Spring preloader in process 11306 Could not find generator 'redmine_plugin'. Maybe you meant 'test_unit:plugin', 'resource_route' or 'channel' Run `rails generate --help` for more options. So if I'm in the rails app, why it stills doesn't work? – mfedossa Jun 06 '18 at 02:20
  • well i never created redmine plugin, but did you setup the redmine in your local machine and able to run it? – Ravi Mariya Jun 06 '18 at 04:50
  • I use docker to have a Redmine image (i don't know if what i say is understanble), but i tried to run Redmine and it works locally. Somebody told me that maybe the basic configuration of docker unables to run correctly some redmine commands such as the redmine_plugin generator. but as i'm totally new to docker and redmine, it will be difficult for me to set it correctly. i will try to install a virtual machine to run redmine, hopping the commands needed respond. Thank you anyway Ravi – mfedossa Jun 06 '18 at 06:14
0

As Ravi mentioned above, you need to go into your redmine app directory instead of your rails app directory.

Or, maybe you can exec plugin generate command via docker run command.

# e.g. In case plugin name is “myplugin"
docker run --name=redmine -it --rm \
  --volume=/srv/docker/redmine/redmine:/home/redmine/data \
  sameersbn/redmine:3.4.4-2 \
  app:rails generate redmine_plugin myplugin

If this works fine, plugin directory named “myplugin” will be generated under /srv/docker/redmine/redmine/plugins/ directory.

Personally, I think, you had batter not use docker to create and development Redmine’s plugin, especially if you are not familiar with Redmine and Docker so much.

I hope this would be any help.

  • Thanks Akiko, yes I will let Docker aside for the moment (even if it's a useful tool), and stay on the "normal way". – mfedossa Jun 15 '18 at 02:32
  • Maybe you can also run rails generate redmine_plugin command in a Redmine’s container, with using docker exec command. In case using docker, it is easy to use docker-compose.yml included in a same repository. – Akiko Takano Jun 15 '18 at 09:58