WebFaction
Community site: login faq

I am extremely new to both Rails and WebFaction and unfortunately am unable to get my Rails application (version 3.2.3) to run in Production mode.

I followed your guide as best I could to get it running in production mode with the only result being the unhelpful “We're sorry, but something went wrong.” message when I try to access the page in a browser.

The log in /home/username/webapps/app_name/rails_app_name/log is empty, and the one in /home/username/webapps/app_name/nginx/logs only shows undecipherable information like this:

cache: [GET /] miss
2012/08/19 05:43:01 [emerg] 27972#0: bind() to 0.0.0.0:42806 failed (98: Address already in use)
2012/08/19 05:43:01 [emerg] 27972#0: bind() to 0.0.0.0:42806 failed (98: Address already in use)
2012/08/19 05:43:01 [emerg] 27972#0: bind() to 0.0.0.0:42806 failed (98: Address already in use)
2012/08/19 05:43:01 [emerg] 27972#0: bind() to 0.0.0.0:42806 failed (98: Address already in use)
2012/08/19 05:43:01 [emerg] 27972#0: bind() to 0.0.0.0:42806 failed (98: Address already in use)
2012/08/19 05:43:01 [emerg] 27972#0: still could not bind()

If I reconfigure the nginx.conf for the app to run development mode, it works perfectly.

Update:

Ok, so after more experimenting I think that the root of my problem is that I am unable to get rails to properly setup the WebFaction database (the reason it was running fine in development mode was that I had accidentally uploaded the development.sqlite3 file from my local machine).

If I try to run rake db:migrate on the development account it gives the following message:

(it gives a similar error if I try to run any rake db command)

[username@web349 rails_app_name]$ rake --trace db:create
/usr/local/lib/ruby19/ruby/1.9.1/rake/version.rb:2: warning: already initialized constant VERSION
/usr/local/lib/ruby19/ruby/1.9.1/rake/version.rb:5: warning: already initialized constant MAJOR
/usr/local/lib/ruby19/ruby/1.9.1/rake/version.rb:5: warning: already initialized constant MINOR
/usr/local/lib/ruby19/ruby/1.9.1/rake/version.rb:5: warning: already initialized constant BUILD
/usr/local/lib/ruby19/ruby/1.9.1/rake/version.rb:6: warning: already initialized constant NUMBERS
/usr/local/lib/ruby19/ruby/1.9.1/rake.rb:27: warning: already initialized constant RAKEVERSION
/usr/local/lib/ruby19/ruby/1.9.1/rake/early_time.rb:17: warning: already initialized constant EARLY
/usr/local/lib/ruby19/ruby/1.9.1/rake/alt_system.rb:32: warning: already initialized constant WINDOWS
/usr/local/lib/ruby19/ruby/1.9.1/rake/application.rb:31: warning: already initialized constant DEFAULT_RAKEFILES
WARNING: Possible conflict with Rake extension: String#ext already exists
WARNING: Possible conflict with Rake extension: String#pathmap already exists
/usr/local/lib/ruby19/ruby/1.9.1/rake/task_arguments.rb:77: warning: already initialized constant EMPTY_TASK_ARGS
/usr/local/lib/ruby19/ruby/1.9.1/rake/invocation_chain.rb:49: warning: already initialized constant EMPTY
/usr/local/lib/ruby19/ruby/1.9.1/rake/file_utils.rb:9: warning: already initialized constant RUBY
/usr/local/lib/ruby19/ruby/1.9.1/rake/file_utils.rb:86: warning: already initialized constant LN_SUPPORTED
/usr/local/lib/ruby19/ruby/1.9.1/rake/file_utils_ext.rb:16: warning: already initialized constant DEFAULT
/usr/local/lib/ruby19/ruby/1.9.1/rake/dsl_definition.rb:150: warning: already initialized constant DeprecatedCommands
/usr/local/lib/ruby19/ruby/1.9.1/rake/file_list.rb:44: warning: already initialized constant ARRAY_METHODS
/usr/local/lib/ruby19/ruby/1.9.1/rake/file_list.rb:47: warning: already initialized constant MUST_DEFINE
/usr/local/lib/ruby19/ruby/1.9.1/rake/file_list.rb:51: warning: already initialized constant MUST_NOT_DEFINE
/usr/local/lib/ruby19/ruby/1.9.1/rake/file_list.rb:55: warning: already initialized constant SPECIAL_RETURN
/usr/local/lib/ruby19/ruby/1.9.1/rake/file_list.rb:61: warning: already initialized constant DELEGATING_METHODS
/usr/local/lib/ruby19/ruby/1.9.1/rake/file_list.rb:364: warning: already initialized constant DEFAULT_IGNORE_PATTERNS
/usr/local/lib/ruby19/ruby/1.9.1/rake/file_list.rb:370: warning: already initialized constant DEFAULT_IGNORE_PROCS
/usr/local/lib/ruby19/ruby/1.9.1/rake.rb:68: warning: already initialized constant FileList
/usr/local/lib/ruby19/ruby/1.9.1/rake.rb:69: warning: already initialized constant RakeFileUtils
rake aborted!
stack level too deep
/home/username/webapps/app_name/gems/gems/rake-0.9.2.2/lib/rake/rake_module.rb:25

asked 19 Aug '12, 02:21

Cyreb
325
accept rate: 100%

edited 19 Aug '12, 18:37

I've enabled development mode in your application and it was throwing an error that it Could not find table 'categories', which might be the cause of this issue.

Can you update your question with the exact steps you took to enable development mode, where your app was working perfectly?

(19 Aug '12, 03:14) iliasr ♦♦

@iliasr ?? I updated the question with my new findings. The reason you got an error is that, in the course of my testing I inadvertently removed the development.sqlite3 file from the server. The server is now running in development mode with my local development.sqlite3 file back on the server.

I used the method described in the documentation to switch to development mode.

(19 Aug '12, 16:59) Cyreb

The issue appears to be a version conflict. Verify every package you are using locally is the same version as on the server.

permanent link

answered 19 Aug '12, 19:25

johns
5.4k312
accept rate: 23%

Thank you. Updating the gems fixed the problem right away.

(19 Aug '12, 23:42) Cyreb

You're welcome, glad to hear you found the issue.

(19 Aug '12, 23:49) johns
Your answer
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

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×186
×108
×28

question asked: 19 Aug '12, 02:21

question was seen: 3,466 times

last updated: 19 Aug '12, 23:49

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM