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
3●2●6
accept rate:
100%
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?
@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.