使用Ruby实现在自托管标准文件服务器上运行标准Notes

时间:2018-01-28 20:15:16

标签: ruby-on-rails ruby

我试图让Standard Notes在我自己托管的Ubuntu 16.04服务器上运行。我已按照Github中给出的基本说明进行操作,也就是说,安装Ruby 2.2 +,Rails 5,MySQL 5.6+数据库。全部完成并运行。

之后,在子目录中,我提取Standard File Server git clone,使用此内容设置.env文件:

RAILS_ENV=production
SECRET_KEY_BASE=use "bundle exec rake secret"
RAILS_SERVE_STATIC_FILES=true

DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=db_name
DB_USERNAME=db_user
DB_PASSWORD="db_password"

SALT_PSEUDO_NONCE=use "bundle exec rake secret"

使用以下内容初始化项目:

bundle install
bower install
rails db:create db:migrate

再次,一切都很好。当我使用rails s启动服务器时,这是输出:

/usr/local/rvm/gems/ruby-2.4.1/gems/activesupport-5.0.1/lib/active_support/xml_mini.rb:51: warning: constant ::Fixnum is deprecated
/usr/local/rvm/gems/ruby-2.4.1/gems/activesupport-5.0.1/lib/active_support/xml_mini.rb:52: warning: constant ::Bignum is deprecated
=> Booting Puma
=> Rails 5.0.1 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
/usr/local/rvm/gems/ruby-2.4.1/gems/activesupport-5.0.1/lib/active_support/core_ext/numeric/conversions.rb:138: warning: constant ::Fixnum is deprecated
Puma starting in single mode...
* Version 3.10.0 (ruby 2.4.1-p111), codename: Russell's Teapot
* Min threads: 5, max threads: 5
* Environment: development
* Listening on tcp://localhost:3000
Use Ctrl-C to stop

我认为可以安全地忽略这两个警告。没有意义的是.env文件没有被读取,因为它在dev而不是prod中运行,而在端口3000而不是3306上运行。任何想法为什么?

1 个答案:

答案 0 :(得分:2)

错字:

AILS_ENV=production

应该是:

RAILS_ENV=production