1

I`m sad, because I get an error 500 when try to start my rails app in production environment (in development - works fine)

logs

...

E, [2013-11-23T13:06:45.285466 #5951] ERROR -- : SQLite3::SQLException: 
   no such table: posts: SELECT "posts".* FROM "posts"

F, [2013-11-23T13:06:45.299620 #5951] FATAL -- : 
ActionView::Template::Error (SQLite3::SQLException: no such table: posts: 
SELECT "posts".* FROM "posts"):

...

RAILS 4.0.0
ruby 1.9.3p194

I hope this information will be enough. I`m ready to write more...


I will be waiting for your help, Friends)

The part of my database.yml

development:
  adapter: sqlite3
  database: db/development.sqlite3
  pool: 5
  timeout: 5000

test:
  adapter: sqlite3
  database: db/test.sqlite3
  pool: 5
  timeout: 5000

production:
  adapter: sqlite3
  database: db/production.sqlite3
  pool: 5 
  timeout: 5000

I`m running this locally


I ran *rake db:create RAILS_ENV=production* and it wrote
/usr/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler.rb:284: 
warning: Insecure world writable dir /home/vitalina/.rvm/bin in PATH, 
mode 040777
db/production.sqlite3 already exists


I ran
  1. sudo chmod go-w /usr/local/bin
  2. rake db:migrate RAILS_ENV="production"
  3. RAILS_ENV=production bundle exec rake assets:precompile

then start server. There isnt error500 more, but it doesnt print the information from database (I see an empty page)

and it wrote in logs:

...
F, [2013-11-23T14:53:11.909041 #6273] FATAL -- : 
ActionController::RoutingError (No route matches [GET] "/assets/application-
8395b8cd00dfdd4bd6e91eade784fa41.css")
...

1 Answers1

4

To resolve the 500 error, make sure you followed the next steps :

1) rake db:create RAILS_ENV=production

2) rake db:migrate RAILS_ENV=production

You have now an other problem concerning asset pipeline. You may find some help here : No route matches [GET] /assets

Community
  • 1
  • 1
Jérôme Boé
  • 2,752
  • 4
  • 21
  • 32