0

Do I need to install/config Node.js to get Javascript running? Is this the simplest solution, seeing that my site has really low traffic?

Javascript doesn't seem to work for me but only in production for a site I am running. The site is setup on the latest version of Ubuntu Server, with Nginx and Passenger (it's a Ruby on Rails app). The site runs great and fast for the past few months, but Javascripts (in particular, things like Twitter Bootstrap's tooltip, etc.) don't run on this production server although they work in my testing/dev environments.

My thoughts are that Javascript is broken b/c I need to install/configure Node.js? I've seen Node.js mentioned in some deployment setup guides but can't find detailed info into if this is necessary.

My site is very low traffic (maybe 3-5 users at any time) for a small company website. The only reason I needed to setup my own web server is that I needed to run the app on the private company network to access certain resources.

4

1 回答 1

1

默认情况下,您的 js/css 不会编译。你应该预编译它们。

您可以在您的计算机上运行“bundle exec rake assets:precompile”并将编译后的代码部署到服务器。相反 node.js 你可以使用 therubyracer gem。

有关更多信息,请阅读导轨指南

于 2013-03-27T19:39:10.673 回答