montera34 / pageonex

PageOneX. Analyzing front pages
http://pageonex.com
GNU Affero General Public License v3.0
54 stars 13 forks source link

Install on Heroku #186

Open alecsGarza opened 11 years ago

alecsGarza commented 11 years ago

Hello,

We tried to follow up the guide on

http://blog.pageonex.com/2012/11/28/installing-your-own-pageonex-deployment-in-heroku/

with no much luck. The master and heroku branch are not installable; having problems with the nokogiri file.

Any suggestions?

Thanks

numeroteca commented 11 years ago

I haven't found a solution yet. Here what I tried: http://blog.pageonex.com/2012/11/28/installing-your-own-pageonex-deployment-in-heroku/#comments

rahulbot commented 11 years ago

Sorry, but we don't have development time to support the Heroku install anymore. The application has progressed a long way since then, so even if it ran it doesn't have many of the features and bug fixes of the current version.

alecsGarza commented 11 years ago

Any guide or recommendation has to how to install the current version on another web server?

Thanks

numeroteca commented 11 years ago

I have included an installation guide in the wiki. I hope it helps.

nvjacobo commented 11 years ago

Which SO are you using?

numeroteca commented 11 years ago

We use Ubuntu. Others have installed it in OS X as well.

nvjacobo commented 11 years ago

You can install directly Heroku with apt-get.

numeroteca commented 11 years ago

@dcabo suggested to add these gems to the Gemfile:

gem 'rails_12factor'    # Heroku logging y servir assets (without this it doesn't serve images, css…)
gem 'thin'
gem 'nokogiri' 

Then you need to bundle install and push again to Heroku.

So I could deploy one instance of the last version of PageOneX in heroku http://pageonexnewtoheroku.herokuapp.com and it looks like it's working fine!

The option that didn't store the images locally, to avoid having to pay data storage at heroku, seems not be working any more to create the image composite of the display view, so I switched back to storing locally.

@alecsGarza and @nvjacobo how are your installations going, need help?

alecsGarza commented 10 years ago

Hi,

@dcabo, @numeroteca thanks for the update.

we managed to install it.

We included in the GemFile ruby '1.9.3'

To let heroku know which ruby to use.

We then tried to run

heroku run rake scraping:kiosko_names --app

and got he following messages

Running `rake scraping:kiosko_names` attached to terminal... 
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/Rakefile:7)
rake aborted!
Don't know how to build task 'scraping:kiosko_names'
/app/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/task_manager.rb:49:in `[]'
/app/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:142:in `invoke_task'
/app/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:101:in `block (2 levels) in top_level'
/app/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:101:in `each'
/app/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:101:in `block in top_level'
/app/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:110:in `run_with_threads'
/app/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:95:in `top_level'
/app/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:73:in `block in run'
/app/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:160:in `standard_exception_handling'
/app/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:70:in `run'
(See full trace by running task with --trace)
numeroteca commented 10 years ago

Try running scraping:update_media instead.

rake scraping:kiosko_names has been deprecated in favor of rake scraping:update_media You have to follow the updated instructions at https://github.com/numeroteca/pageonex/wiki#installation-guide, forget about the blog post you mentioned at the beginning of this thread.

You can see where the rakes are defined at /lib/tasks/scraping.rake

I didn't need to include ruby '1.9.3' to make PageOneX work in Heroku.

alecsGarza commented 10 years ago

@numeroteca Thanks, rake scraping:update_media worked great.

For production deployment should we run anything more than

rake db:migrate

after we the change the variable RACK_ENV and push again to heroku?

we added a ClearDB MySQL Database Ignite addon to the app

Best

numeroteca commented 10 years ago

You need to db:migate to create all the tables in the database (before scraping:update_media).

I am not sure now where is the production setting, I think you are right and it is the RACK_ENV variable.

Let us know how it works!

alecsGarza commented 10 years ago

We changed the variable in the file .env and pushed to heroku again.

However, we are not sure if by changing RACK_ENV=development to RACK_ENV=production is enough to work on the production mode as stated in the wiki

"Note: You will need to have postgresSQL installed for the development environment, and mySQL for production environment. "

We followed the instructions from https://devcenter.heroku.com/articles/cleardb to work with the mysql database (rake db:migrate and rake scraping:update_media worked on the mysql database)

numeroteca commented 10 years ago

In which point is the process failing? and how? Did you follow https://devcenter.heroku.com/articles/multiple-environments instructions?

alecsGarza commented 10 years ago

@numeroteca we will take a look into link

However we are having problems in seen the thread images and found the following

"It turn out that only images in the commit and pushed to heroku are kept, example logo or icon used in the apps. Uploaded images will be removed with each push to heroku, clearly images uploaded via paperclip fall into the latter category.

Solution is to use a 3rd party storage, like Amazon Simple Storage Service. "

Did you have any issues saving the images?

Thanks

alecsGarza commented 10 years ago

We found this

https://devcenter.heroku.com/articles/paperclip-s3

this would imply modifying

app/models/image.rb app/controllers/images_controller.rb lib/image_compositor.rb

correct?