The program was originally used by the Sqlite3 database.
Modify the Gemfile file to add PG support for Heroku deployment
Group:p Roduction Do
# Gems specifically for Heroku go
Gem "PG"
End
Bundle Install
Precompile some files, otherwise there will be an error on the Heroku
Bundle EXEC Rake Assets:precompile
Publish application to GitHub top
$ git Add.
$ git commit-a-M "Done with the demo app"
Done with the Demo app, add Heroku PG database support
$ git push
Publish application to Heroku server
$ Heroku Create
$ git push Heroku Master
$ Heroku Rake db:migrate
$ heroku Rename Berryreloaddemoapp
I can now test my database application on the Heroku cloud server.
Http://BerryreloadDemoApp.heroku.com/users
Reference:
Use the Heroku cloud service on Ubuntu to publish rails applications
=====================================================
If you execute a command
$ bundle EXEC Rake Assets:precompile
The error is as follows:
Rake aborted!
Undefined method ' Prerequisites ' for Nil:nilclass
(For the full trace by running task with--trace)
Execute command again
$ bundle EXEC Rake Assets:precompile--trace
The error is as follows:
Rake aborted!
Undefined method ' Prerequisites ' for Nil:nilclass
/usr/local/ruby/lib/ruby/gems/1.9.1/gems/rspec-rails-2.0.1/lib/rspec/rails/tasks/rspec.rake:3:in ' <top ( Required) > '
Conclusion is rspec-rails-2.0.1 and rake, rails 3.1.3 incompatible, need to be upgraded
Upgrade Method:
Modify the gemfile of the project to remove the Rspec-rails version number if you set the Rspec-rails version number according to the textbook Ruby on Rails 3 tutorial.
Group:d Evelopment Do
Gem ' Rspec-rails '
End
Group:test do
Gem ' RSpec '
Gem ' Webrat '
End
Final Execution command
$ bundle Update Rspec-rails
The results show an upgrade to Rspec-rails 2.8.1
Execution of command again succeeded.
$ bundle EXEC Rake Assets:precompile
And then
$ git Add.
$ git commit-am "done with static pages and precompile for Heroku"
$ git push
$ git push Heroku
$ Heroku Rake db:migrate