Reputation: 141
Trying to create an image within my homepage banner for my rails app
I have setup and connected the Dropbox API to my rails app & it works when I run this on Localhost. The image shows correctly. But when i run this it complies correctly but when i open i get application error
heroku logs
2014-04-05T10:07:27.320325+00:00 app[web.1]: => Ctrl-C to shutdown server
2014-04-05T10:07:27.320325+00:00 app[web.1]: Exiting
2014-04-05T10:07:27.321149+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.4/lib/active_support/dependencies.rb:229:in `require': /app/app/models/post.rb:8: syntax error, unexpected =>, expecting keyword_end (SyntaxError)
2014-04-05T10:07:27.321149+00:00 app[web.1]: :storage => :dropbox,
2014-04-05T10:07:27.321149+00:00 app[web.1]: ^
2014-04-05T10:07:27.321149+00:00 app[web.1]: /app/app/models/post.rb:9: syntax error, unexpected ',', expecting keyword_end
2014-04-05T10:07:27.321149+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.4/lib/active_support/dependencies.rb:229:in `block in require'
2014-04-05T10:07:27.321149+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.4/lib/active_support/dependencies.rb:214:in `load_dependency'
2014-04-05T10:07:27.321149+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.4/lib/active_support/dependencies.rb:229:in `require'
2014-04-05T10:07:27.321149+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.4/lib/active_support/dependencies.rb:330:in `require_or_load'
2014-04-05T10:07:27.321149+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.4/lib/active_support/dependencies.rb:289:in `depend_on'
2014-04-05T10:07:27.321149+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.4/lib/active_support/dependencies.rb:207:in `require_dependency'
2014-04-05T10:07:27.321363+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.4/lib/rails/engine.rb:465:in `block (2 levels) in eager_load!'
2014-04-05T10:07:27.321363+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.4/lib/rails/engine.rb:464:in `each'
2014-04-05T10:07:27.321363+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.4/lib/rails/engine.rb:464:in `block in eager_load!'
2014-04-05T10:07:27.321363+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.4/lib/rails/engine.rb:462:in `each'
2014-04-05T10:07:27.321363+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.4/lib/rails/engine.rb:462:in `eager_load!'
2014-04-05T10:07:27.321363+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.4/lib/rails/engine.rb:347:in `eager_load!'
2014-04-05T10:07:27.321363+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.4/lib/rails/application/finisher.rb:56:in `each'
2014-04-05T10:07:27.321363+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.4/lib/rails/application/finisher.rb:56:in `block in <module:Finisher>'
2014-04-05T10:07:27.321363+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.4/lib/rails/initializable.rb:30:in `instance_exec'
2014-04-05T10:07:27.321363+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.4/lib/rails/initializable.rb:30:in `run'
2014-04-05T10:07:27.321544+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.4/lib/rails/initializable.rb:55:in `block in run_initializers'
2014-04-05T10:07:27.321544+00:00 app[web.1]: from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:150:in `block in tsort_each'
2014-04-05T10:07:27.321544+00:00 app[web.1]: from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:183:in `block (2 levels) in each_strongly_connected_component'
2014-04-05T10:07:27.321544+00:00 app[web.1]: from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:219:in `each_strongly_connected_component_from'
2014-04-05T10:07:27.321544+00:00 app[web.1]: from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:182:in `block in each_strongly_connected_component'
2014-04-05T10:07:27.321544+00:00 app[web.1]: from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:180:in `each'
2014-04-05T10:07:27.321544+00:00 app[web.1]: from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:180:in `each_strongly_connected_component'
2014-04-05T10:07:27.321544+00:00 app[web.1]: from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:148:in `tsort_each'
2014-04-05T10:07:27.321544+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.4/lib/rails/initializable.rb:54:in `run_initializers'
2014-04-05T10:07:27.321544+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.4/lib/rails/application.rb:215:in `initialize!'
2014-04-05T10:07:27.322203+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.4/lib/rails/railtie/configurable.rb:30:in `method_missing'
2014-04-05T10:07:27.322203+00:00 app[web.1]: from /app/config/environment.rb:5:in `<top (required)>'
2014-04-05T10:07:27.322203+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.4/lib/active_support/dependencies.rb:229:in `require'
2014-04-05T10:07:27.322203+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.4/lib/active_support/dependencies.rb:229:in `block in require'
2014-04-05T10:07:27.322203+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.4/lib/active_support/dependencies.rb:214:in `load_dependency'
2014-04-05T10:07:27.322203+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.4/lib/active_support/dependencies.rb:229:in `require'
2014-04-05T10:07:27.322203+00:00 app[web.1]: from /app/config.ru:3:in `block in <main>'
2014-04-05T10:07:27.322203+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'
2014-04-05T10:07:27.322203+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'
2014-04-05T10:07:27.322203+00:00 app[web.1]: from /app/config.ru:in `new'
2014-04-05T10:07:27.322418+00:00 app[web.1]: from /app/config.ru:in `<main>'
2014-04-05T10:07:27.322418+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:49:in `eval'
2014-04-05T10:07:27.322418+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:49:in `new_from_string'
2014-04-05T10:07:27.322418+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:40:in `parse_file'
2014-04-05T10:07:27.322418+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:277:in `build_app_and_options_from_config'
2014-04-05T10:07:27.322418+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:199:in `app'
2014-04-05T10:07:27.322418+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.4/lib/rails/commands/server.rb:48:in `app'
2014-04-05T10:07:27.322418+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:314:in `wrapped_app'
2014-04-05T10:07:27.322418+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.4/lib/rails/commands/server.rb:75:in `start'
2014-04-05T10:07:27.322418+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.4/lib/rails/commands.rb:76:in `block in <top (required)>'
2014-04-05T10:07:27.322824+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.4/lib/rails/commands.rb:71:in `tap'
2014-04-05T10:07:27.322824+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.4/lib/rails/commands.rb:71:in `<top (required)>'
2014-04-05T10:07:27.322824+00:00 app[web.1]: from bin/rails:4:in `require'
2014-04-05T10:07:27.322824+00:00 app[web.1]: from bin/rails:4:in `<main>'
2014-04-05T10:07:28.741283+00:00 heroku[web.1]: Process exited with status 1
2014-04-05T10:07:28.751166+00:00 heroku[web.1]: State changed from starting to crashed
post.rb
class Post < ActiveRecord::Base
validates :company, :contact, :email, :telephone, :website, presence: true
belongs_to :posts
:storage => :dropbox,
:dropbox_credentials => Rails.root.join("config/dropbox.yml"),
end
getting syntax errors in this file so have removed commas but still get same errors
Upvotes: 0
Views: 369
Reputation: 76784
Have you tried using the has_attached_file
attribute of Paperclip
(as described in the paperclip-dropbox
gem docs):
#app/models/post.rb
Class Post < ActiveRecord::Base
has_attached_file :avatar,
:storage => :dropbox,
:dropbox_credentials => Rails.root.join("config/dropbox.yml")
end
Upvotes: 1