我正在尝试构建一个插件,允许通过用户界面创建徽章,这与此帖子中的要求类似:
我已经在我认为必要的逻辑和结构中构建了插件,但由于某种原因,routes.rb 和重复路由一直存在问题。
git 在这里:
https://github.com/ordokr/badge_maker/
这是我遇到的错误,其中包含一个端口错误,这可能是另一个独立的问题:
> 1861:M 02 Oct 2024 15:32:58.659 # Warning: Could not create server TCP listening socket *:6379: bind: Address already in use
> 1861:M 02 Oct 2024 15:32:58.660 # Failed listening on port 6379 (TCP), aborting.
> I, [2024-10-02T15:33:08.619145 #1] INFO -- :
> I, [2024-10-02T15:33:08.622660 #1] INFO -- :
> cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate'
> Plugin name is 'badge maker', but plugin directory is named 'badgemaker'
> rake aborted!
> ArgumentError: Invalid route name, already in use: 'unique_badge_maker_plugin' (ArgumentError)
> You may have defined two routes with the same name using the `:as` option, or you may be overriding a route already defined by a resource with the same naming. For the latter, you can restrict the routes created with `resources` as explained here:
> https://guides.rubyonrails.org/routing.html#restricting-the-routes-created
>
> raise ArgumentError, "Invalid route name, already in use: '#{name}' \n" \
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^