在騰訊雲Ubuntu20.04.4中安裝redmine-4.2.4 (Ruby-2.7.5)

RM411

o o o RM411 o o o

 

運維 #590

在騰訊雲Ubuntu20.04.4 中安裝redmine-4.2.4 (Ruby-2.7.5)

由 Sam XIAO 在 大約 10 小時 之前添加. 更新於 大約 1 小時 之前.

已解決
優先級:
普通
開始日期:
2022-02-26
計劃完成日期:
 
   

66%

預期時間:
(合計: 0.00 小時)
耗時:
標籤列表:

文件


子任務

運維 #591: ruby2.7.0升級到ruby2.7.5 已解決   2022-02-26  
 

 

刪除關聯行爲
運維 #594: ubuntu@VM-4-6-ubuntu:~/ruby-2.7.5$ make install >>> dbm: Could not be configured. It will not be installed. 新建   2022-02-26  
 

 

刪除關聯行爲
運維 #592: Permission denied @ rb_sysopen - /home/ubuntu/redmine-4.2.3/tmp/pids/server.pid (Errno::EACCES) 已關閉   2022-02-26  
 

 

刪除關聯行爲
運維 #593: Rails Error: Unable to access log file. Please ensure that /home/ubuntu/redmine-4.2.3/log/production.log exists and is writable 已關閉   2022-02-26  
 

 

刪除關聯行爲

相關的問題

由 Sam XIAO 更新於 大約 10 小時 之前

騰訊雲原始系統信息

ubuntu@VM-4-6-ubuntu:~$ df Filesystem 1K-blocks Used Available Use% Mounted on udev 1963992 0 1963992 0% /dev tmpfs 402556 700 401856 1% /run /dev/vda2 82512260 4030252 75031640 6% / tmpfs 2012764 24 2012740 1% /dev/shm tmpfs 5120 0 5120 0% /run/lock tmpfs 2012764 0 2012764 0% /sys/fs/cgroup tmpfs 402552 0 402552 0% /run/user/1000 ubuntu@VM-4-6-ubuntu:~$ df -h Filesystem Size Used Avail Use% Mounted on udev 1.9G 0 1.9G 0% /dev tmpfs 394M 700K 393M 1% /run /dev/vda2 79G 3.9G 72G 6% / tmpfs 2.0G 24K 2.0G 1% /dev/shm tmpfs 5.0M 0 5.0M 0% /run/lock tmpfs 2.0G 0 2.0G 0% /sys/fs/cgroup tmpfs 394M 0 394M 0% /run/user/1000 ubuntu@VM-4-6-ubuntu:~$ free -h total used free shared buff/cache available Mem: 3.8Gi 152Mi 3.3Gi 2.0Mi 402Mi 3.5Gi Swap: 0B 0B 0B ubuntu@VM-4-6-ubuntu:~$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 20.04 LTS Release: 20.04 Codename: focal ubuntu@VM-4-6-ubuntu:~$ cat /proc/version Linux version 5.4.0-96-generic (buildd@lgw01-amd64-051) (gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04)) #109-Ubuntu SMP Wed Jan 12 16:49:16 UTC 2022 ubuntu@VM-4-6-ubuntu:~$ 

升級Ubuntu

$sudo apt update $sudo apt upgrade ubuntu@VM-4-6-ubuntu:~$ cat /proc/version Linux version 5.4.0-96-generic (buildd@lgw01-amd64-051) (gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04)) #109-Ubuntu SMP Wed Jan 12 16:49:16 UTC 2022 ubuntu@VM-4-6-ubuntu:~$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 20.04.4 LTS Release: 20.04 Codename: focal ubuntu@VM-4-6-ubuntu:~$ df -h Filesystem Size Used Avail Use% Mounted on udev 1.9G 0 1.9G 0% /dev tmpfs 394M 720K 393M 1% /run /dev/vda2 79G 4.0G 72G 6% / tmpfs 2.0G 24K 2.0G 1% /dev/shm tmpfs 5.0M 0 5.0M 0% /run/lock tmpfs 2.0G 0 2.0G 0% /sys/fs/cgroup tmpfs 394M 0 394M 0% /run/user/1000 ubuntu@VM-4-6-ubuntu:~$ free -h total used free shared buff/cache available Mem: 3.8Gi 169Mi 2.1Gi 2.0Mi 1.6Gi 3.4Gi Swap: 0B 0B 0B ubuntu@VM-4-6-ubuntu:~$ ubuntu@VM-4-6-ubuntu:~$ ruby -v ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-linux-gnu] ubuntu@VM-4-6-ubuntu:~$ gem -v 3.1.2 

沒有rails , bundler, mysql

安裝開發工具

sudo apt install libtool automake build-essential

安裝依賴庫

sudo apt install mysql-server mysql-client libgmp3-dev libpcre3-dev libssl-dev zlib1g-dev libsqlite3-dev libgdbm-dev libncurses5-dev libreadline6-dev libgdbm-dev libcurl4-openssl-dev libmysqlclient-dev ubuntu@VM-4-6-ubuntu:~/ruby-2.7.5$ sudo apt install bundler ubuntu@VM-4-6-ubuntu:~/ruby-2.7.5$ bundle -v Bundler version 2.1.4 


ubuntu@VM-4-6-ubuntu:~/redmine-4.2.3$ mysql --version
mysql Ver 8.0.28-0ubuntu0.20.04.3 for Linux on x86_64 ((Ubuntu))
ubuntu@VM-4-6-ubuntu:~/redmine-4.2.3$

由 Sam XIAO 更新於 大約 9 小時 之前

ruby-2.7.0 升級到ruby-2.7.5

ubuntu@VM-4-6-ubuntu:~$ tar -zxvf ruby-2.7.5.tar.gz ubuntu@VM-4-6-ubuntu:~$ cd ruby-2.7.5 ubuntu@VM-4-6-ubuntu:~/ruby-2.7.5$ ./configure ubuntu@VM-4-6-ubuntu:~/ruby-2.7.5$ make ubuntu@VM-4-6-ubuntu:~/ruby-2.7.5$ sudo make install . . . installing binary commands: /usr/local/bin installing base libraries: /usr/local/lib installing arch files: /usr/local/lib/ruby/2.7.0/x86_64-linux installing pkgconfig data: /usr/local/lib/pkgconfig installing extension objects: /usr/local/lib/ruby/2.7.0/x86_64-linux installing extension objects: /usr/local/lib/ruby/site_ruby/2.7.0/x86_64-linux installing extension objects: /usr/local/lib/ruby/vendor_ruby/2.7.0/x86_64-linux installing extension headers: /usr/local/include/ruby-2.7.0/x86_64-linux installing extension scripts: /usr/local/lib/ruby/2.7.0 installing extension scripts: /usr/local/lib/ruby/site_ruby/2.7.0 installing extension scripts: /usr/local/lib/ruby/vendor_ruby/2.7.0 installing extension headers: /usr/local/include/ruby-2.7.0/ruby installing rdoc: /usr/local/share/ri/2.7.0/system installing html-docs: /usr/local/share/doc/ruby installing capi-docs: /usr/local/share/doc/ruby installing command scripts: /usr/local/bin installing library scripts: /usr/local/lib/ruby/2.7.0 installing common headers: /usr/local/include/ruby-2.7.0 installing manpages: /usr/local/share/man (man1, man5) . . . ubuntu@VM-4-6-ubuntu:~/ruby-2.7.5$ /usr/local/bin/ruby -v ruby 2.7.5p203 (2021-11-24 revision f69aeb8314) [x86_64-linux] ubuntu@VM-4-6-ubuntu:~/ruby-2.7.5$ ruby -v ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-linux-gnu] 

make時間較長,3分鐘左右

遺留問題:

reboot後ruby默認就2.7.5了。 或者 export PATH=/usr/local/ruby/bin:$PATH

配置 gem源

 gem sources -r https://rubygems.org/ -a https://gems.ruby-china.com/ gem sources $ bundle config mirror.https://rubygems.org https://gems.ruby-china.com #你可以用 Bundler 的 Gem 源代碼鏡像命令。 

由 Sam XIAO 更新於 大約 1 小時 之前

創建數據庫

CREATE DATABASE redmine423 CHARACTER SET utf8mb4;
CREATE USER 'Ux_220226'@'localhost' IDENTIFIED BY 'aBcd123';
GRANT ALL PRIVILEGES ON redmine423.* TO 'Ux_220226'@'localhost';

ubuntu@VM-4-6-ubuntu:~/redmine-4.2.3$ bundle install
Please configure your config/database.yml first
Please configure your config/database.yml first
Your Ruby version is 2.7.0, but your Gemfile specified >= 2.7.5, < 2.8.0
ubuntu@VM-4-6-ubuntu:~/redmine-4.2.3$

由 Sam XIAO 更新於 大約 1 小時 之前

安裝redmine

ubuntu@VM-4-6-ubuntu:~$ unzip redmine-4.2.4.zip 

更改Gemfile

 ubuntu@VM-4-6-ubuntu:~/redmine-4.2.4$ gem source *** CURRENT SOURCES *** https://gems.ruby-china.com/ ubuntu@VM-4-6-ubuntu:~/redmine-4.2.4$ gem source -l *** CURRENT SOURCES *** https://gems.ruby-china.com/ ubuntu@VM-4-6-ubuntu:~/redmine-4.2.4$ vi Gemfile ubuntu@VM-4-6-ubuntu:~/redmine-4.2.4$ head Gemfile #source 'https://rubygems.org' source 'https://gems.ruby-china.com' #ruby '>= 2.4.0', '< 2.8.0' ruby '>= 2.7.5', '< 2.8.0' gem 'bundler', '>= 1.12.0' gem 'rails', '5.2.6.2' gem 'sprockets', '~> 3.7.2' if RUBY_VERSION < '2.5' gem 'globalid', '~> 0.4.2' if Gem.ruby_version < Gem::Version.new('2.6.0') ubuntu@VM-4-6-ubuntu:~/redmine-4.2.4$ 

配置Mysql

 ubuntu@VM-4-6-ubuntu:~/redmine-4.2.4/config$ cp database.yml.example database.yml ubuntu@VM-4-6-ubuntu:~/redmine-4.2.4/config$ vi database.yml 

database.yml

# Default setup is given for MySQL 5.7.7 or later. # Examples for PostgreSQL, SQLite3 and SQL Server can be found at the end. # Line indentation must be 2 spaces (no tabs). production: adapter: mysql2 database: redmine423 host: localhost username: Ux_220226 password: "aBcd123" # Use "utf8" instead of "utfmb4" for MySQL prior to 5.7.7 encoding: utf8mb4 development: adapter: mysql2 database: redmine423 host: localhost username: Ux_220226 password: "aBcd123" # Use "utf8" instead of "utfmb4" for MySQL prior to 5.7.7 encoding: utf8mb4 # Warning: The database defined as "test" will be erased and # re-generated from your development database when you run "rake". # Do not set this db to the same as development or production. test: adapter: mysql2 database: redmine423 host: localhost username: Ux_220226 password: "aBcd123" # Use "utf8" instead of "utfmb4" for MySQL prior to 5.7.7 encoding: utf8mb4 # PostgreSQL configuration example #production: # adapter: postgresql # database: redmine # host: localhost # username: postgres # password: "postgres" # SQLite3 configuration example #production: # adapter: sqlite3 # database: db/redmine.sqlite3 # SQL Server configuration example #production: # adapter: sqlserver # database: redmine # host: localhost # username: jenkins # password: jenkins 

由 Sam XIAO 更新於 大約 1 小時 之前

ubuntu@VM-4-6-ubuntu:~/redmine-4.2.4$ sudo gem install bundler Fetching bundler-2.3.8.gem Successfully installed bundler-2.3.8 Parsing documentation for bundler-2.3.8 Installing ri documentation for bundler-2.3.8 Done installing documentation for bundler after 0 seconds 1 gem installed ubuntu@VM-4-6-ubuntu:~/redmine-4.2.4$ ubuntu@VM-4-6-ubuntu:~/redmine-4.2.4$ bundle config set --local without 'development test' You are replacing the current local value of without, which is currently "development:test" ubuntu@VM-4-6-ubuntu:~/redmine-4.2.4$ sudo apt install imagemagick ubuntu@VM-4-6-ubuntu:~/redmine-4.2.4$ bundle install $ bundle exec rake generate_secret_token $ RAILS_ENV=production bundle exec rake db:migrate $ RAILS_ENV=production bundle exec rake redmine:load_default_data $ RAILS_ENV=production REDMINE_LANG=fr bundle exec rake redmine:load_default_data ubuntu@VM-4-6-ubuntu:~/redmine-4.2.4$ rails s -e production => Booting WEBrick => Rails 5.2.6.2 application starting in production on http://0.0.0.0:3000 => Run `rails server -h` for more startup options [2022-02-26 19:31:37] INFO WEBrick 1.6.1 [2022-02-26 19:31:37] INFO ruby 2.7.5 (2021-11-24) [x86_64-linux] [2022-02-26 19:31:37] INFO WEBrick::HTTPServer#start: pid=9036 port=3000 
 
 

導出 Atom PDF

 
 
回到頂部
 
Let's gooooooo...... @SamXIAO
 
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章