简体   繁体   English

“ Rails服务器”创建一个名为“ server”的新应用程序,不启动Rails服务器

[英]“Rails server” creates a new app called “server” not start the rails server

I've transferred an older RoR app onto a new workstation and now having issues starting it. 我已经将较旧的RoR应用程序转移到了新的工作站上,但是现在启动时遇到了问题。

For instance when I attempt to use the "rails server" command it generates a new rails application rather than starting the server. 例如,当我尝试使用“ rails服务器”命令时,它将生成一个新的Rails应用程序,而不是启动服务器。

I did have it running last night but after attempting to use the 'Production' database, apparently the 'rails server -e "production" ' command is obsolete. 我确实在昨晚运行过它,但是在尝试使用“生产”数据库后,显然“ rails server -e“ production”'命令已过时。 I therefore tried: 因此,我尝试:

RAILS_ENV=production

And it seems the application was not longer working. 而且似乎该应用程序不再起作用。

There was also lots of documentation and suggestions to use RVM....which I installed....could that be the cause the 'rails server' command is not starting the server but rather creating a new app? 还有很多使用RVM的文档和建议....我安装了....是否可能是因为“ rails server”命令不是启动服务器而是创建新应用?

You should do 你应该做

RAILS_ENV=production rails s

on rails app dir. 在轨道应用程序目录上。

I think your app is on rails 3, with rails 4 installed. 我认为您的应用安装在导轨3上,并安装了导轨4。

To start the server I had to use: bundle exec rails server what's going on? 要启动服务器,我必须使用:bundle exec rails server这是怎么回事? – paulywill yesterday –昨天paulywill

Using bundle exec will ensure it uses the version of rails from your Gemfile. 使用bundle exec将确保它使用了Gemfile中的rails版本。 This is default behaviour after Rails 3.1 but your app is older than that. 这是Rails 3.1之后的默认行为,但是您的应用程序比该版本早。 – Graeme McLean yesterday –昨天,格雷姆·麦克莱恩(Graeme McLean)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM