简体   繁体   English

将Ruby on Rails部署到Heroku

[英]Deploying Ruby on Rails to Heroku

I am trying to upload RoR application to Heroku. 我正在尝试将RoR应用程序上传到Heroku。

OS - Ubuntu, ruby version - 2.2.2p95, rails version - 4.2.1, database - PostgreSQL, installed RoR via BrightBox (Tutorial from treehouse), using git push heroku master to upload. 操作系统-Ubuntu,ruby版本-2.2.2p95,rails版本-4.2.1,数据库-PostgreSQL,通过BrightBox(树屋教程)安装了RoR,使用git push heroku master上传。

On the local server app works fine. 在本地服务器上,应用程序运行正常。 When I push it to heroku, it gives out an error: 当我将其推送到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.

Log files say: 日志文件说:

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

I've tried all the possible variants, I could find on the Internet: 我已经尝试了所有可能的变体,可以在Internet上找到:

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

To upload to heroku, I've configured git, after that logged in heroku, after that "heroku create", after that "git push heroku master", then "heroku open" 为了上传到heroku,我已经配置了git,在登录到heroku之后,在“ heroku创建”之后,在“ git push heroku master”之后,再配置“ heroku打开”

And many others... Any ideas how to solve that problem? 还有许多其他...关于解决该问题的任何想法?

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

Not sure you mistyped or something else. 不知道您输错了什么或其他东西。 but heroku run rails db:migrate will not work it should be heroku run rake db:migrate . 但是heroku run rails db:migrate将不起作用,应该是heroku run rake db:migrate It might be because you don't have root page. 可能是因为您没有根页。 Precompile issue etc. 预编译问题等

Run heroku logs -a app_name to see actual logs. 运行heroku logs -a app_name查看实际日志。

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

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