0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Preparing VSCode environment for Bitnami Redmine

Last updated at Posted at 2020-08-28

##Introduction
This article is for a beginner developer of redmine plugin who is going to ...

  • build environement with Bitnami redmine on Windows
  • use VScode
  • wants to know the easiest way and capable for buy another PC

condition :

  • Windows10 64bit
  • bitnami-redmine-4.1.1-0-windows-x64-installer.exe
    bitnami redmine 3.x will be also fine

##Procedure

1. Install redmine

1.1. Package installation

Basic installation will be completed with bitnami redmine package installer.
https://bitnami.com/stack/redmine/installer

1.2. Configure DB setting

Change "development" databese configuration to use "production" database table. This is quite easy way and easy to understand. open config file in C:¥Bitnami¥redmine-4.1.1-0¥apps¥redmine¥htdocs¥config¥database.yml

database.yml
production:
  adapter: mysql2
  database: bitnami_redmine
  host: 127.0.0.1
  username: bitnami
  password: 5a6e5788be
  encoding: utf8
  port: 3306
development:
  adapter: mysql2
  database: bitnami_redmine
  host: localhost
  username: bitnami
  password: 5a6e5788be
  encoding: utf8

DB password is hashed password specified in bitnami installer.

1.3. Disable relative_url_root

Edit config file as follow.
C:¥Bitnami¥redmine-4.1.1-0¥apps¥redmine¥htdocs¥config¥additional_environment.rb を開きます。

additional_environment.rb
#config.action_controller.relative_url_root = '/redmine'

Note:
Please enable this option when runs as production environment.
This is example for this congfig.
relative_url_root.png

1.4. Restart

Restart all services with using bitnami console.
server_restart all.png

2. VSCode

2.1. VSCode extensions

Find and install Rails and Ruby extensions.
VSCode extensions.png

Ruby Solargraph will be installed. If not, please install it.

2.2. Set home directory

Open application menu "File > Open Folder" and set redmine home directory "htdocs" (C:\Bitnami\redmine-4.1.1-0\apps\redmine\htdocs).
VSCode.png

2.3. Set launch.json configuration

Write launch.json config as follows. Launch.json can be initialized with some config file such as node.js.

launch.json
{
    "version": "0.2.0",
    "configurations": [

        {
            "name": "launch rails server",
            "type": "Ruby",
            "request": "launch",
            "cwd": "${workspaceRoot}",
            "program": "bin/rails",
            "args": ["server"],
            "useBundler": false
        }
    ]
}

VSCode launch.jsonlaunch_json.png

3. Configuration

This is the most difficult part. When you face another error message, please read error message in debug console and debug it.

3.1. Add PATH to system variables

Please set bitnami_redmine path "C:\Bitnami\redmine-4.1.1-0\ruby\bin" to windows system variables.
image.png

Restart windows and run VSCode.
Check some ruby command with VSCode Terminal window. You will get ruby version with ruby -v command.

ruby -v

image.png

3.2. [redmine3.x only] Install bundler

old redmine version does not include "bundler" gem. Please install specific version manually. Bundler 2.x.x is not for redmine 3.x.

gem install bundler -v 1.17.3

3.3. Install gems

Install following gems. When old

gem install solargraph
gem install ruby-debug-ide
gem install debase

You can check install gems.

gem list --local

3.7. Bundle install

Before bundle install, add "railties" to your Gemfile in redmine home directory.

image.png

Bundle install Gemfile. Type "bundle install --no-deployment" in VSCode terminal.

> bundle install --no-deployment

VSCode bundle install.png

4. Start debug!

4.1. Run as development environment

Start debugging with ">" button. This is successful capture.
Successful.png

Open browser and access http://localhost:3000. You can see live logs in debug console.
VSCode_redmine_development.png

4.2. Debug

Enjoy your development job with VSCode!
Debug_mode.png

4.3. Stop debug

Stop server with stop button.
Stop.png

Let's try

I'm looking forward to seeing new plugin or up-to-date existing.

reference

This is my old article, when you have trouble "rmagik" or "ImageMagick" please check it.
【旧】Bitnami Redmineをdevelopmentで起動する(VSCode編)

I released sample plugin that has "project setting tab" and empty view.
https://github.com/aki360P/redmine_empty_plugin

0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?