Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

builds with ruby 2.1.1... Heroku requires ruby 2.5.8 #2

Open
infominer33 opened this issue May 18, 2020 · 7 comments
Open

builds with ruby 2.1.1... Heroku requires ruby 2.5.8 #2

infominer33 opened this issue May 18, 2020 · 7 comments

Comments

@infominer33
Copy link
Contributor

infominer33 commented May 18, 2020

trying to get this running on heroku (and configure a "deploy to heroku" button), but running into some versioning issues

Not sure how much trouble you're inclined to go through for this...

another thing, heroku doesn't allow sqlite3, only postgress, nor does it allow sqlite even for development (only wants pg so dev and production are the same).

Right now I'm just trying to run it locally so I did bundle install, even not including "--without production", it still seems to be looking for sqlite3.

now I'm off to google postgress and see what I can gather.
(update, did get it to build and deploy locally with sqlite.. still digging around on postgress.. assuming I need to set up a db first and use that in my environment)

@geraldb
Copy link
Member

geraldb commented May 19, 2020

Thanks for your initiative. Shouldn't be too hard because it's already running on heroku with postgres, see http://plutopluto.herokuapp.com, for example. Sorry, the starter code is a little outdated (but the good news not much changed as far as I can tell / remember). About sqlite3 - the fix is changing the entry in Gemfile from pluto to pluto-models. About ruby 2.1.1 - I deleted the Gemfile.lock with the outdated versions - what else - not sure - sorry - I try to help out. Keep going. Cheers. Prost.

@infominer33
Copy link
Contributor Author

ok progress :) I made a fresh clone and tried again with current releases of ruby (2.6.5 + 2.7.0)

The build was successful (I wonder how many times I needed but just didn't realize rm Gemfile.lock)

now, when running % rake setup PLANET=ruby I get:

NoMethodError: undefined method `env_name' for "pluto":String

@geraldb
Copy link
Member

geraldb commented May 19, 2020

Hard to tell - sorry I have no clue - can you post the error stack trace (backtrace)? Not sure if it's included in the rake error otherwise try with verbose e.g. $ rake --verbose setup PLANET=ruby. If I get around I will try a setup over here (it might take a day or two sorry).

@infominer33
Copy link
Contributor Author

verbose didn't do much so I tried trace:

% rake setup PLANET=ruby --trace  
RACK_ENV=development
$LOAD_PATH:
["/usr/local/Cellar/rbenv/1.1.2/rbenv.d/exec/gem-rehash",
 "/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/thin-1.7.2/lib",
 "/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/extensions/x86_64-darwin-19/2.7.0/thin-1.7.2",
 "/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/sqlite3-1.4.2/lib",
 "/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/extensions/x86_64-darwin-19/2.7.0/sqlite3-1.4.2",
 "/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/pluto-tasks-1.5.3/lib",
 "/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/pluto-update-1.6.4/lib",
 "/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/pluto-feedfetcher-0.1.6/lib",
 "/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/pluto-admin-1.0.0/lib",
 "/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/sinatra-2.0.8.1/lib",
 "/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/tilt-2.0.10/lib",
 "/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rack-protection-2.0.8.1/lib",
 "/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rack-2.2.2/lib",
 "/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/pluto-models-1.6.2/lib",
 "/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/props-activerecord-0.2.0/lib",
 "/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/opmlparser-1.0.1/lib",
 "/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/mustermann-1.1.1/lib",
 "/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/ruby2_keywords-0.0.2/lib",
 "/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/logutils-activerecord-0.2.1/lib",
 "/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/fetcher-0.4.5/lib",
 "/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/feedparser-2.1.2/lib",
 "/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/feedfilter-1.1.1/lib",
 "/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/textutils-1.4.0/lib",
 "/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rubyzip-2.3.0/lib",
 "/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/props-1.2.0/lib",
 "/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/iniparser-1.0.1/lib",
 "/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/eventmachine-1.2.7/lib",
 "/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/extensions/x86_64-darwin-19/2.7.0/eventmachine-1.2.7",
 "/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/date-formatter-0.1.1/lib",
 "/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/daemons-1.3.1/lib",
 "/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.2/lib",
 "/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/activityutils-0.1.2/lib",
 "/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/activerecord-utils-0.4.1/lib",
 "/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/logutils-0.6.1/lib",
 "/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/activerecord-6.0.3.1/lib",
 "/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/activemodel-6.0.3.1/lib",
 "/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/activesupport-6.0.3.1/lib",
 "/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/zeitwerk-2.3.0/lib",
 "/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/tzinfo-1.2.7/lib",
 "/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/thread_safe-0.3.6/lib",
 "/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/minitest-5.14.1/lib",
 "/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/i18n-1.8.2/lib",
 "/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/concurrent-ruby-1.1.6/lib/concurrent-ruby",
 "/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/site_ruby/2.7.0",
 "/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/site_ruby/2.7.0/x86_64-darwin19",
 "/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/site_ruby",
 "/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/vendor_ruby/2.7.0",
 "/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/vendor_ruby/2.7.0/x86_64-darwin19",
 "/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/vendor_ruby",
 "/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/2.7.0",
 "/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/2.7.0/x86_64-darwin19"]
[boot] pluto-admin - setting public folder to: /Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/pluto-admin-1.0.0/lib/pluto/admin/public
[boot] pluto-admin - setting views folder to: /Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/pluto-admin-1.0.0/lib/pluto/admin/views
pluto-admin 1.0.0 on Ruby 2.7.0 (2019-12-25) [x86_64-darwin19] on Sinatra/2.0.8.1 (development)
pluto-admin/1.0.0 on Ruby 2.7.0 (2019-12-25) [x86_64-darwin19]
[boot] pluto-admin root: /Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/pluto-admin-1.0.0
[debug] ENV['DATBASE_URL'] - ><
[info] db settings:
[info] {:adapter=>"sqlite3", :database=>"pluto.db"}
** Invoke setup (first_time)
** Invoke environment (first_time)
** Execute environment
[debug] ENV['DATBASE_URL'] - ><
[info] db settings:
[info] {:adapter=>"sqlite3", :database=>"pluto.db"}
rake aborted!
NoMethodError: undefined method `env_name' for "pluto":String
/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/pluto-models-1.6.2/lib/pluto/connecter.rb:67:in `block in connect'
/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/pluto-models-1.6.2/lib/pluto/connecter.rb:67:in `reject'
/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/pluto-models-1.6.2/lib/pluto/connecter.rb:67:in `connect'
/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/pluto-models-1.6.2/lib/pluto/models.rb:90:in `connect'
/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/pluto-models-1.6.2/lib/pluto/models.rb:94:in `connect!'
/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/pluto-tasks-1.5.3/lib/pluto/tasks/environment.rake:17:in `block in <top (required)>'
/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/task.rb:281:in `block in execute'
/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/task.rb:281:in `each'
/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/task.rb:281:in `execute'
/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/task.rb:199:in `synchronize'
/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/task.rb:199:in `invoke_with_call_chain'
/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/task.rb:243:in `block in invoke_prerequisites'
/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/task.rb:241:in `each'
/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/task.rb:241:in `invoke_prerequisites'
/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/task.rb:218:in `block in invoke_with_call_chain'
/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/task.rb:199:in `synchronize'
/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/task.rb:199:in `invoke_with_call_chain'
/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/task.rb:188:in `invoke'
/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/application.rb:160:in `invoke_task'
/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/application.rb:116:in `each'
/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/application.rb:116:in `block in top_level'
/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/application.rb:125:in `run_with_threads'
/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/application.rb:110:in `top_level'
/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/application.rb:83:in `block in run'
/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/application.rb:186:in `standard_exception_handling'
/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/application.rb:80:in `run'
/Users/infominer/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'
/Users/infominer/.rbenv/versions/2.7.0/bin/rake:23:in `load'
/Users/infominer/.rbenv/versions/2.7.0/bin/rake:23:in `<main>'
Tasks: TOP => setup => environment

@geraldb
Copy link
Member

geraldb commented May 19, 2020

Thanks for the backtrace - that helps - the error is in line https://github.com/feedreader/pluto/blob/master/pluto-models/lib/pluto/connecter.rb#L67 db_config should be a structure and NOT a string - not sure why - I will have to try to do a setup over here (sorry that might take some time).

Notes: It's caused by Rails 6 change in ActiveRecord::Base.configuration, see https://blog.bigbinary.com/2019/03/19/rails-6-changed-activerecord-base-configurations-result-to-an-object.html

@geraldb
Copy link
Member

geraldb commented May 19, 2020

A quick hack that may work (sorry I cannot test / try now) - add in config/boot.rb the line before Pluto.connect!

 ActiveRecord::Base.configurations = {}

and than retry (that should clean out/clear all db configs on startup).

@infominer33
Copy link
Contributor Author

sorry, no luck there. All good. I've got still got some tinkering to do with my first Pluto project :) no need to get too lost into setting up another, just yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants