login community faq
0
1

Hi,

After deploying my Ruby on Rails web application (using Capistrano), I just get an error message ("We're sorry, but something went wrong.") when I visit the deployed site, even though it works locally on my machine. I was having some issues with sqlite3, but I managed to resolve that by following this installation guide.

I have been searching around, and found this question on StackOverflow, which seems to indicate that there is something wrong with sqlite3-ruby, but as far as I can tell I am now using the normal sqlite gem. I also noticed this question which seemed related, but I am not using RVM on the server (only locally, on my Mac). I am positive that the code on the client and server is the same and I have run bundle install etc.

I'm using Ruby 1.9.3p125, Rails 3.2.2 and Passenger version 3.0.11.

My production.log gives me these error messages, but I am unable to figure out what is broken/missing:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
Started GET "/" for 184.144.171.84 at 2012-03-02 22:17:34 -0600

ActiveRecord::ConnectionNotEstablished (ActiveRecord::ConnectionNotEstablished):
  activerecord (3.2.1) lib/active_record/connection_adapters/abstract/connection_pool.rb:374:in `retrieve_connection'
  activerecord (3.2.1) lib/active_record/connection_adapters/abstract/connection_specification.rb:168:in `retrieve_connection'
  activerecord (3.2.1) lib/active_record/connection_adapters/abstract/connection_specification.rb:142:in `connection'
  activerecord (3.2.1) lib/active_record/query_cache.rb:67:in `rescue in call'
  activerecord (3.2.1) lib/active_record/query_cache.rb:61:in `call'
  activerecord (3.2.1) lib/active_record/connection_adapters/abstract/connection_pool.rb:443:in `call'
  actionpack (3.2.1) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
  activesupport (3.2.1) lib/active_support/callbacks.rb:405:in `_run__564718838__call__747762965__callbacks'
  activesupport (3.2.1) lib/active_support/callbacks.rb:405:in `__run_callback'
  activesupport (3.2.1) lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
  activesupport (3.2.1) lib/active_support/callbacks.rb:81:in `run_callbacks'
  actionpack (3.2.1) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
  actionpack (3.2.1) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
  actionpack (3.2.1) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
  actionpack (3.2.1) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
  railties (3.2.1) lib/rails/rack/logger.rb:26:in `call_app'
  railties (3.2.1) lib/rails/rack/logger.rb:16:in `call'
  actionpack (3.2.1) lib/action_dispatch/middleware/request_id.rb:22:in `call'
  rack (1.4.1) lib/rack/methodoverride.rb:21:in `call'
  rack (1.4.1) lib/rack/runtime.rb:17:in `call'
  activesupport (3.2.1) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
  rack (1.4.1) lib/rack/lock.rb:15:in `call'
  rack-cache (1.1) lib/rack/cache/context.rb:132:in `forward'
  rack-cache (1.1) lib/rack/cache/context.rb:241:in `fetch'
  rack-cache (1.1) lib/rack/cache/context.rb:181:in `lookup'
  rack-cache (1.1) lib/rack/cache/context.rb:65:in `call!'
  rack-cache (1.1) lib/rack/cache/context.rb:50:in `call'
  railties (3.2.1) lib/rails/engine.rb:479:in `call'
  railties (3.2.1) lib/rails/application.rb:220:in `call'
  railties (3.2.1) lib/rails/railtie/configurable.rb:30:in `method_missing'
  passenger (3.0.11) lib/phusion_passenger/rack/request_handler.rb:96:in `process_request'
  passenger (3.0.11) lib/phusion_passenger/abstract_request_handler.rb:513:in `accept_and_process_next_request'
  passenger (3.0.11) lib/phusion_passenger/abstract_request_handler.rb:274:in `main_loop'
  passenger (3.0.11) lib/phusion_passenger/rack/application_spawner.rb:206:in `start_request_handler'
  passenger (3.0.11) lib/phusion_passenger/rack/application_spawner.rb:79:in `block in spawn_application'
  passenger (3.0.11) lib/phusion_passenger/utils.rb:479:in `safe_fork'
  passenger (3.0.11) lib/phusion_passenger/rack/application_spawner.rb:64:in `spawn_application'
  passenger (3.0.11) lib/phusion_passenger/spawn_manager.rb:264:in `spawn_rack_application'
  passenger (3.0.11) lib/phusion_passenger/spawn_manager.rb:137:in `spawn_application'
  passenger (3.0.11) lib/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application'
  passenger (3.0.11) lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
  passenger (3.0.11) lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
  passenger (3.0.11) helper-scripts/passenger-spawn-server:99:in `<main>'

Has anyone else encountered these issues and been able to resolve them somehow? I am not sure if I am providing enough information here or what other information would be useful (I am pretty new to RoR), so please let me know how I can provide more relevant information!

Thanks in advance for any help and advice.

Update

Here's the contents of my database.yml:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
development:
  adapter: sqlite3
  database: db/development.sqlite3
  pool: 5
  timeout: 5000

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

production:
  adapter: mysql
  database: lef_irleif_rails
  host: localhost
  username: lef_irleif_rails
  password: ******

I was under the impression/assumption that my app would automatically use development locally, and then switch to the production database (the MySQL database) once deployed to the server. I followed the instructions on Webfaction's RoR documentation page to set this up. I also tried changing the production database from localhost to webXXX.webfaction.com, but this didn't seem to make any difference.

asked Mar 02 '12 at 22:32

Leif's gravatar image

Leif
114

edited Mar 03 '12 at 10:03

This error seems to suggest that the application can't successfully connect to the sqlite database even though the gem is installed. Can you ensure that the paths in config/database.yml are correct (maybe try absolute paths?).

If that doesn't work, can you rule out the database connection issue by temporarily using a MySQL database in place of a sqlite database for the development application? If that works, it means that the problem is indeed related to the sqlite connection.

(Mar 02 '12 at 23:14) ryans ♦♦ ryans's gravatar image

Thanks for the help, @ryans! I think you're right, but I'm not sure how to correct it. I updated my question above with the contents of my database.yml (I was already trying to use MySQL for production database).

(Mar 03 '12 at 09:57) Leif Leif's gravatar image

Can you try providing the full system path to the SQLite database? If this doesn't help, please open a ticket, so we can take a look at it.

(Mar 03 '12 at 10:35) todork todork's gravatar image

You mean, instead of "database: db/development.sqlite3" I should try to use "database: /home/lef/webapps/irleif_rails/current/db/development.sqlite3" ? Edit: I just tried this, and it doesn't seem to work either. I'll try a few other things before I make a ticket; it's probably just me not understanding how this is supposed to work.

(Mar 03 '12 at 10:46) Leif Leif's gravatar image

Yes, that's what I meant (too bad it didn't work). Can you open a ticket so we can take a closer look?

(Mar 03 '12 at 10:58) todork todork's gravatar image

Will do! Thanks for the help :)

(Mar 03 '12 at 11:00) Leif Leif's gravatar image

I opened a ticket :)

(Mar 03 '12 at 11:40) Leif Leif's gravatar image

I'm currently experiencing the same issue. My app uses only sqlite. Any news on this?

(Jul 16 '12 at 14:34) Juan Hoyos Juan%20Hoyos's gravatar image

My fault... haven't pushed things to scm before deploying and it was using mysql. Things are now working.

(Jul 16 '12 at 15:01) Juan Hoyos Juan%20Hoyos's gravatar image
showing 5 of 9 show all
Be the first one to answer this question!
If you have an answer to the above question, then use the form below. Otherwise, use the appropriate 'add new comment' button above to post your feedback.
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Tags:

×56
×25
×9
×5

Asked: Mar 02 '12 at 22:32

Seen: 1,244 times

Last updated: Jul 16 '12 at 15:01

Plans & prices    Sign up    Why WebFaction?    Contact us    Affiliate program    Support    Legal    Jobs    Blog    Control panel login
Powered by OSQA
© Copyright 2003-2012 Swarma Limited - WebFaction is a service of Swarma Limited