最近在折腾这个开源项目canvas-lms
按照他wiki中的步骤配置完环境之后,跑起来,发现竟然是rails2.3.18我了个去
然后仔细看了他的Gemfile,发现了一个canvas_rails3的配置文件
# You can enable the not-yet-complete Rails3 support by either defining a
# CANVAS_RAILS3 env var, or create an empty RAILS3 file in the canvas config dir
if ENV['CANVAS_RAILS3']
CANVAS_RAILS3 = ENV['CANVAS_RAILS3'] != '0'
else
CANVAS_RAILS3 = File.exist?(File.expand_path("../RAILS3", __FILE__))
end
CANVAS_RAILS2 = !CANVAS_RAILS3
发现是通过ENV['CANVAS_RAILS3']来控制rails版本是2还是3的,想请问下这个ENV['CANVAS_RAILS3']这个环境变量值应该如何修改或者赋值呢,是从命令行传入么,看了rubydoc发现没怎么明白
There is a big gap between rails 3.2 and current rails 4. Upgrading rails may cause the website to not run. Therefore, it is recommended to specify the same version as the project in the gemfile, and then bundle install
If you follow section
Quick Start
, executeAlternative
If you follow
Production Start
小节来做的话,你是不是之前创建了一个canvasuser
用户?你可以在这个用户的~/.bashrc
, add this sentence:Then when you start canvas, you should be using Rails3