2015-05-27 136 views
0

我正尝试将RoR应用程序上传到Heroku。在Heroku上部署Ruby on Rails

操作系统 - Ubuntu,ruby版本 - 2.2.2p95,rails版本 - 4.2.1,数据库 - PostgreSQL,通过BrightBox(教程从treehouse)安装RoR,使用git push heroku master进行上传。

在本地服务器应用程序工作正常。当我把它推到Heroku的,它给出了一个错误:

The page you were looking for doesn't exist. 
You may have mistyped the address or the page may have moved. 
If you are the application owner check the logs for more information. 

日志文件说:

/usr/bin/env: ruby2.2: No such file or directory 

我已经尝试了所有可能的方案,我可以在互联网上找到:

rake rails:update:bin 

Remove bin from ~/.gitignore (But there is no such file) 

heroku config:set PATH=bin:vendor/bundle/ruby/2.2.2/bin:/usr/local/bin:/usr/bin:/bin 

Adding this to the GemFile: ruby '2.2.2' 

Changed #!/usr/bin/env ruby2.2(.2 (not sure about ".2")) to #!/usr/bin/env ruby (in bin/rake, bin/bundle and bin/rails) 

heroku run rails db:migrate 
rake rails:update:bin 

ln -s /usr/bin/nodejs /usr/bin/node 

要上传到Heroku的,我已经配置了git的,在Heroku的后登录,在那之后“的Heroku创建”,即“混帐推Heroku的主”后,然后在“打开的Heroku”

等等......任何想法如何解决这个问题?

回答

0

您是否安装了gem rails12_factor和config.assets.compile = true

+0

我已经安装了它,但它没有改变任何东西。我不确定你写的第二行。我在哪里可以找到它?感谢您的答复。 –

+0

而实际上它是rails_12factor –

+0

是的,抱歉的错字。第二行应该在你的config/environments/production.rb文件中。 –

0

不知道你错打了什么或别的东西。但heroku run rails db:migrate将无法​​正常工作,应该是heroku run rake db:migrate。这可能是因为你没有root页面。预编译问题等

运行heroku logs -a app_name查看实际日志。

+0

其实,它们都不起作用。日志文件告诉我,上面写过。感谢您的答复。 –