These forums are read-only!
We're sorry, but something went wrong.
  • So I followed all the setup tutorials on for Apache, Git, Ruby on Rails, and Passenger. I created a rails app via my slice "rails myapp" and I got the usual opening rails app page showing the server and gems installed. So all looked good so far.

    So then I ftp'd up my real "myapp" from my local machine and now I get "We're sorry, but something went wrong." If I put an index.html file back into the public folder of my recently uploaded rails "myapp", the real one, the index.html page loads correctly. But I don't want the index.html page to load.

    Any suggestions?
  • Check your logs; if you're using passenger, your application is running in "production" mode, so you should have a "myapp/log/production.log" that will give you more information.

    Did you run your migrations when you ftp'ed up your app? Sometimes I forget to do this, or I don't set up the database correctly, and my application won't start. I would check to make sure your database exists, and it's the one you expect it to be, permissions on the database are set correctly, etc. If these hints don't help, try posting your log file here if you get totally stumped.

    Also remember that since it's in "production" mode, you'll need to restart Apache (or "touch myapp/tmp/restart.txt") to reload any changes you make...
  • Here is the error I am getting in my production.log file. I migrated down and back up and did not get any migration errors, so I don't know what is going on? Do i need to generate the database before migrating?

    ActiveRecord::StatementInvalid (SQLite3::SQLException: no such table: notices: SELECT * FROM "notices" ):
    app/controllers/notices_controller.rb:5:in `index'
    passenger (2.2.9) lib/phusion_passenger/rack/request_handler.rb:92:in `process_request'
    passenger (2.2.9) lib/phusion_passenger/abstract_request_handler.rb:207:in `main_loop'
    passenger (2.2.9) lib/phusion_passenger/railz/application_spawner.rb:400:in `start_request_handler'
    passenger (2.2.9) lib/phusion_passenger/railz/application_spawner.rb:351:in `handle_spawn_application'
    passenger (2.2.9) lib/phusion_passenger/utils.rb:184:in `safe_fork'
    passenger (2.2.9) lib/phusion_passenger/railz/application_spawner.rb:349:in `handle_spawn_application'
    passenger (2.2.9) lib/phusion_passenger/abstract_server.rb:352:in `__send__'
    passenger (2.2.9) lib/phusion_passenger/abstract_server.rb:352:in `main_loop'
    passenger (2.2.9) lib/phusion_passenger/abstract_server.rb:196:in `start_synchronously'
    passenger (2.2.9) lib/phusion_passenger/abstract_server.rb:163:in `start'
    passenger (2.2.9) lib/phusion_passenger/railz/application_spawner.rb:209:in `start'
    passenger (2.2.9) lib/phusion_passenger/spawn_manager.rb:262:in `spawn_rails_application'
    passenger (2.2.9) lib/phusion_passenger/abstract_server_collection.rb:126:in `lookup_or_add'
    passenger (2.2.9) lib/phusion_passenger/spawn_manager.rb:256:in `spawn_rails_application'
    passenger (2.2.9) lib/phusion_passenger/abstract_server_collection.rb:80:in `synchronize'
    passenger (2.2.9) lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
  • Have you tried "rake db:create"? Usually you run that first to create your database, and then "rake db:migrate" to create all of the tables and run your migrations. I would think your database exists though, since you're getting a "no such table" instead of "database not found". You can connect with the sqlite3 client on your machine and see if the tables are there too, just to make sure they actually exist (I haven't used sqlite3 much myself so I don't know the exact commands).
  • yeah getting db/development.sqlite3 already exists

    I am trying to use STI:

    Here is what I have for that:
    MIGRATION:

    class CreateNotices < ActiveRecord::Migration
    def self.up
    create_table :notices do |t|
    t.string :author
    t.string :title
    t.text :description
    t.string :image_url
    t.string :type
    t.string :email

    t.timestamps
    end
    end

    def self.down
    drop_table :notices
    end
    end

    class Notice < ActiveRecord::Base
    validates_presence_of :title, :author, :description, :deadline
    end


    class AutoNotice < Notice
    validates_presence_of :title, :author, :description, :deadline
    end

    This is the table that is giving the issues according to my log file posted above.

    TIA
  • Alright, so I would try using the sqlite3 command line client to connect to your database and check it out. On Ubuntu I had to install it with "sudo apt-get install sqlite3". Then, to access a database, it's just "sqlite3 .db" (no brackets for the actual database name...), so if your database was called "myapp.db" you'd use "sqlite3 myapp.db" (note that the extension might be .sqlite3). You should be able to find your databases in the "myapp/db" folder; they'll have the names you set up in your myapp/config/database.yml file.This will present you with the sqlite3 prompt. From here, you can do ".tables" to get a listing of all tables in the database. Try that and see if "notices" shows up there.
  • You need to create the production database. I believe you use this:

    rake db:create RAILS_ENV=production