我似乎已经达到了一个颠簸,在这里和其他foruns搜索,但没有。我正在运行rails 3.2.3和ruby 1.9.3,并且希望在heroku上部署我的应用程序。Ruby on Rails - Heroku部署问题
我创建了雪松,虽然我可以git push heroku master
我得到一个完整的500服务器错误。 我怀疑是因为我的数据库不存在。但是,我似乎无法在那里得到它。 我已经运行:
heroku run rake db:create
- >这给出了约不赞成一些警告,然后dkhgclqccm already exists
所以它已经存在?所以让我们进行迁移:
heroku run rake db:migrate
但是这个输出:
<deprecation errors>
rake aborted!
An error has occurred, this and all later migrations canceled:
PG::Error: ERROR: relation "hphotos" does not exist
: ALTER TABLE "hphotos" ADD COLUMN "description" character varying(255)
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
这个特定的迁移:
class AddDescriptionToHphotos < ActiveRecord::Migration
def change
add_column :hphotos, :description, :string
end
end
这似乎对我很好,不知道为什么它给我这个错误:/
最后一两件事,即使这个工作移民,我的数据库是空的,我seeds.rb不具有所有为数据库的必要数据即所以我想要推开洞DB。
heroku db:push
! Taps Load Error: cannot load such file -- sqlite3
! You may need to install or update the taps gem to use db commands.
! On most systems this will be:
!
! sudo gem install taps
这是为什么显示? 我安装了“Heroku的”创业板和“水龙头”的宝石和我在宝石文件中得到这个:
group :development, :test do
gem 'mysql2'
end
group :production do
gem 'pg'
end
而且,当我运行heroku run rake db:version
,它表明:当前版本:20120508130957 这实际上是5个迁移总之我currrent版本,但我不能为我展示谈到上述错误进行迁移...
在此先感谢
难道我修复不适合你? – Abram
显然,在创建表的迁移之前调用了此迁移。不知道那是怎么发生的。解决方案是手动删除迁移,然后创建一个新的堆栈雪松应用程序。然后移民,种子,一切都很好。 – Silver
这几乎就是我指出的那样“看起来表格并没有被远程创建,而是在尝试修改它。”请欣赏请打勾。 – Abram