padrino / padrino-framework

Padrino is a full-stack ruby framework built upon Sinatra.
http://www.padrinorb.com
MIT License
3.37k stars 508 forks source link

SQLite3::ReadOnlyException: attempt to write a readonly database: #420

Closed cocodrino closed 13 years ago

cocodrino commented 13 years ago

Hi..when I run a POST request to my sqlite db I get:

ActiveRecord::StatementInvalid at /posts/create SQLite3::ReadOnlyException: attempt to write a readonly database: INSERT INTO "posts" ("title", "body") VALUES ('hi', 'hi what''s up') file: abstract_adapter.rb location: log line: 207

/home/yo/na2/padint3/tham/tham/app/controllers/posts.rb in POST /posts/create if @post.save /home/yo/.gem/ruby/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb in run_machine run_machine /home/yo/.gem/ruby/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb in run run_machine

my gem list:

* LOCAL GEMS *

abstract (1.0.0) actionmailer (3.0.3) actionpack (3.0.3) activemodel (3.0.4, 3.0.3) activerecord (3.0.4, 3.0.3) activeresource (3.0.3) activesupport (3.0.4, 3.0.3) acts_as_list (0.1.2) acts_as_tree (0.1.1) addressable (2.2.4, 2.2.2) arel (2.0.8, 2.0.6) atom (0.3) awesome_print (0.3.1) bcrypt-ruby (2.1.2) bson (1.1.4) bson_ext (1.1.4) builder (3.0.0, 2.1.2) bundler (1.0.10, 1.0.7) capybara (0.4.0) celerity (0.8.5) childprocess (0.1.5) chronic (0.3.0) coderay (0.9.7) columnize (0.3.2) commonwatir (1.6.7) configuration (1.2.0) crack (0.1.8) cucumber (0.10.0) cucumber-rails (0.3.2) culerity (0.2.12) daemons (1.1.0) data_mapper (1.0.2) data_objects (0.10.3, 0.10.2) database_cleaner (0.6.0) devise (1.1.5) diff-lcs (1.1.2) dm-aggregates (1.0.2) dm-constraints (1.0.2) dm-core (1.0.2) dm-do-adapter (1.0.2) dm-migrations (1.0.2) dm-serializer (1.0.2) dm-sqlite-adapter (1.0.2) dm-timestamps (1.0.2) dm-transactions (1.0.2) dm-types (1.0.2) dm-validations (1.0.2) do_sqlite3 (0.10.3, 0.10.2) dropbox (1.2.2) dropboxuploader (0.0.1) dummy_dropbox (0.0.1) erubis (2.6.6) escape_utils (0.1.9) espeak-ruby (0.3.0) eventmachine (0.12.10) extensions (0.6.0) extlib (0.9.15) faraday (0.5.3) fastercsv (1.5.4, 1.5.3) fastri (0.3.1.1) ffi (0.6.3) ffi-rzmq (0.6.0) firewatir (1.6.7) fxri (0.3.7) fxruby (1.6.20 x86-linux) gdata (1.1.1) gemwhois (0.2.1) gherkin (2.3.2) git (1.2.5) gmail (0.3.4) google-translate (0.7.2) googlebase (0.2.1) googlecalendar (1.1.0) googlereader (0.0.4) GoogleReaderApi (0.3.5) googletranslate (0.2) haml (3.0.25, 3.0.24) haml-rails (0.3.4) hoe (2.8.0) hpricot (0.8.3) http_router (0.5.3, 0.5.0, 0.4.0) i18n (0.5.0) jazz_model (0.1.0) jnunemaker-validatable (1.8.4) json (1.4.6) json_pure (1.5.1, 1.4.6) launchy (0.3.7) linecache (0.43) mail (2.2.15, 2.2.12) mechanize (1.0.0) method_source (0.2.0) mime (0.1) mime-types (1.16) mongo (1.1.4) mongo_mapper (0.8.6) multi_json (0.0.5) multipart-post (1.0.1) net-ldap (0.1.1) net-ssh (2.1.0) nokogiri (1.4.4) oa-basic (0.1.6) oa-core (0.1.6) oa-enterprise (0.1.6) oa-oauth (0.1.6) oa-openid (0.1.6) oauth (0.4.4) oauth2 (0.1.0) omniauth (0.1.6) padrino (0.9.20, 0.9.19) padrino-admin (0.9.20, 0.9.19) padrino-core (0.9.20, 0.9.19) padrino-gen (0.9.20, 0.9.19) padrino-helpers (0.9.20, 0.9.19) padrino-mailer (0.9.20, 0.9.19) padrino-warden (0.1.0) ParseTree (3.0.6) plucky (0.3.6) polyglot (0.3.1) pry (0.4.8) pyu-ruby-sasl (0.0.3.2) rack (1.2.1) rack-flash (0.1.1) rack-google-analytics (0.9.2) rack-mount (0.6.13) rack-openid (1.2.0) rack-test (0.5.6) rails (3.0.3) railties (3.0.3) rake (0.8.7) rbus (0.2.0) rcodetools (0.8.5.0) rdiscount (1.6.5) redcar (0.9.1) rest-client (1.6.1) rio (0.4.2) rspec (2.2.0) rspec-core (2.2.1) rspec-expectations (2.2.0) rspec-mocks (2.2.0) rspec-rails (2.2.1) ruby-debug (0.10.4) ruby-debug-base (0.10.4) ruby-debug-ide (0.4.16) ruby-openid (2.1.8) ruby-openid-apps-discovery (1.2.0) ruby-processing (1.0.9) ruby2ruby (1.2.5) ruby_parser (2.0.5) rubyforge (2.0.4) rubygems-update (1.5.0) rubylexer (0.7.7) rubyntlm (0.1.1) rubyzip (0.9.4) s4t-utils (1.0.4) scrubyt (0.4.06) selenium-webdriver (0.1.1) sequence (0.2.3) sexp_processor (3.0.5) shoesgem (0.1514.0) sinatra (1.1.2, 1.1.0) slim (0.9.0, 0.8.0) spork (0.8.4) sqlite3 (1.3.3) sqlite3-ruby (1.3.3, 1.3.2) stringex (1.2.0, 1.1.0) temple (0.1.7, 0.1.6) term-ansicolor (1.0.5) thin (1.2.7) thor (0.14.6) thrift (0.5.0) thrift_client (0.6.0) tickle (0.1.7) tilt (1.2.2, 1.1) tkri (0.9.5) treetop (1.4.9) tzinfo (0.3.24, 0.3.23) unindent (0.9) url_mount (0.2.1) user-choices (1.1.6.1) uuidtools (2.1.2, 2.1.1) warden (1.0.3) xml-simple (1.0.12) xpath (0.1.2) yaparc (0.2.3) ZenTest (4.4.2)

nesquena commented 13 years ago

This is usually a permissions isse. i.e the sqlite database file cannot be written to properly by your user.

http://stackoverflow.com/questions/1518729/how-to-change-sqlite-database-mode

Try doing ls -l to see your permissions level to the sqlite file.