![](/img/trans.png)
[英]“rails server” not seeing rails project locally which works fine on heroku
[英]Rails works fine locally but not in heroku
我已经为root创建了一个自定义页面,并在routes.rb中进行了相应的更改。我在使用git之前删除了public / index.html文件但该应用程序仍然在heroku中查找public / index.html文件。该应用程序在本地工作正常但是问题是在heroku中部署。请建议一些解决方案?我的Gemfile包含
source 'https://rubygems.org'
gem 'rails', '3.2.11'
group :development do
gem 'sqlite3', '1.3.5'
end
group :assets do
gem 'sass-rails','3.2.4'
gem 'coffee-rails', '3.2.2'
gem 'uglifier', '1.2.3'
end
gem 'jquery-rails'
gem 'thin'
我没有在我的应用程序中使用数据库。控制器只是对json字符串进行一些计算。
我相信你曾经用过:
git add .
git commit -m "blabla"
但是, git add .
不要查找已删除的文件,因此public/index.html
仍然存在。
您必须使用git add -u
来包含已删除的文件。
或者,你可以使用git add -A
,这相当于git add .
再加上git add -u
。
编辑 - 一步一步评论:
git add -A #add everything (including deleted files)
git commit -m "blabla" #commit it
git push #push from your pc to your git repository
git push heroku #push from your git repository to heroku
如果您删除了public/index.html
文件,则必须正常工作。
编辑将以下内容添加到您的gemfile:
group :production do
gem 'pg'
end
比:
RAILS_ENV=production bundle exec rake assets:precompile
git add -A
git commit -m "blabla"
git push
git push heroku
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.