简体   繁体   English

将 Rails 从 4 降级到 3.2 控制台不起作用

[英]Downgrading Rails from 4 to 3.2 Console doesn't work

So I coded this website for a client in Rails 4 but since it was my first deployed rails app, I thought every hosting provider with rails would support Ruby 2 and Rails 4 but much to my dismay I tried but Dreamhost and Site5 who both use Passenger which requires Rails 3 and ruby 1.8 so I have to downgrade the whole site.所以我为一个使用 Rails 4 的客户端编写了这个网站,但由于它是我第一个部署的 Rails 应用程序,我认为每个带有 rails 的托管服务提供商都会支持 Ruby 2 和 Rails 4 但令我沮丧的是我尝试过但 Dreamhost 和 Site5 都使用了 Passenger这需要 Rails 3 和 ruby​​ 1.8,所以我必须降级整个站点。

I was going along ok until I tried to check something using rails c, but it didnt work.在我尝试使用 rails c 检查某些内容之前,我一直在进行,但它没有用。 It just gave the usage as if I was executing it from outside my app folder.它只是给出了用法,就好像我是从我的应用程序文件夹之外执行它一样。

Any ideas how I make this work?任何想法我如何使这项工作?

UPDATE更新

I think the issue is that rails cannot figure out that my app is a rails app since it gives the same message as if it's not.我认为问题是 rails 无法确定我的应用程序是一个 rails 应用程序,因为它提供了与不是一样的消息。 How do I reformate my rails 4 app to look like a 3.2 app?如何重新设置我的 rails 4 应用程序以使其看起来像 3.2 应用程序?

Make sure you are using the right (the 3) version of Rails and if it is declared correctly in your Gemfile确保您使用的是正确的(第 3 个)版本的 Rails,并且它是否在您的 Gemfile 中正确声明

After that, try running之后,尝试运行

bundle exec rails c

The reason rails console wasn't working is because when Rails 4 creates a new project there is no script/rails but there is when you create a Rails 3.2 project. rails 控制台不工作的原因是因为当 Rails 4 创建一个新项目时,没有script/rails但是当你创建一个 Rails 3.2 项目时。 I just created a dummy rails 3 application and copied script/rails into my root directory and it works fine.我刚刚创建了一个虚拟的 rails 3 应用程序并将script/rails复制到我的根目录中,它工作正常。

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

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