【发布时间】:2021-01-20 20:29:20
【问题描述】:
我正在尝试设置一个单独的(并行)redmine 实例。 不幸的是,我对 rails 和 ruby 环境了解不多。
这可能吗?
假设它是... 我遇到了似乎是隐含的允许环境的问题--
production
development
test
这些是不是一成不变的? 我原本以为我会使用“测试”配置, 但因为在某些情况下会被擦除,所以不合适。 我想保留开发以供可能的其他用途。 所以我正在尝试添加一个新环境。 这可能吗? (我的意思是相当容易实现)
到目前为止完成:
set up new redmine directory hierarchy at /opt/xxx_test/redmine-4.1.1
set up new mysql database xxx_test with new user xxx_test for xxx_test
modified config/database.yml to contain only xxx_test (no production, development, or test)
generated new secret token
安装原始(主要)redmine 时,它是通过以下方式安装的:
bundle config set without 'development test'
bundle install
当我现在这样做时:
bundle config set without 'production development test'
我收到消息:
'Your application has set without to "development:test". This will override the global value you are currently setting'
这个集合在哪里,如何更改?
当我执行“数据库架构对象迁移”时(安装步骤 6) 我收到一个错误,似乎暗示它正在访问已安装的“生产”环境:
RAILS_ENV=xxx_test bundle exec rake db:migrate
config.eager_load is set to nil. Please update your config/environments/*.rb files accordingly:
* development - set it to false
* test - set it to false (unless you use a tool that preloads your test environment)
* production - set it to true
rake aborted!
Mysql2::Error::ConnectionError: Access denied for user 'xxx_test'@'localhost' to database 'redmine'
这些开发/测试/生产“事物”在哪里/如何设置为真/假? 我在 config/environment 或 config/environments/*.rb 中什么也没看到
【问题讨论】:
-
一开始为什么要在同一台服务器上运行同一个应用程序的两个实例? IMO 克隆第一个实例、更改配置并在另一台服务器上运行克隆要容易得多。除此之外,您可以根据需要添加任意数量的环境并可以根据需要命名它们(production_1,production_2)。您只需要添加一个额外的环境文件并相应地设置 RAILS_ENV。
-
我们只有一台服务器可用,并且有工作人员正在试验我们如何处理某些项目最有意义的方法。据我了解,在同一实例上运行会导致日志文件和上传文件等共享文件出现问题。
-
您可以使用 RVM 在不同的 linux 用户下运行尽可能多的 redmines,apache 虚拟主机可以运行代理到不同的端口或通过乘客模块运行。
-
@Aleksandar 我不明白。 /etc/apache2/mods-available.conf/passenger.conf 指定PassengerUser、PassengerGroup、PassengerUserSwitching,但没有指向它应该运行的redmine 的路径。它如何获得它应该运行的 redmine 的路径? /etc/apache2/rubies/xxx.include 指定 RailsBaseURI /redmine 和 /redmine-test 以及一个 PerlLoadModule Apache2::Redmine
-
@GaryAitken 它是基于每个虚拟主机配置的,请参阅我关于 Redmine 的书...
标签: ruby-on-rails ruby installation redmine