include Async::Methods
async def count_chickens(area_name)
10.times do |i|
sleep rand
puts "Found a chicken in #{area_name}!"
end
end
async def count_all_chickens
go {count_chickens("garden")}
go {count_chickens("roof")}
go {count_chickens("tree")}
end
count_all_chickens
If I try to create a project with:rails new spina_example --database=postgresql
Then cd to spina_example
And then bin/rails db:create
I get this error:
https://gist.github.com/da-edra/0b68baf9d3dfdc53c4050fa5a5b4a2ee
pg
as a dependency. I am trying to build it in my MacOS environment and I am hitting the No pg_config...
error during bundle install
. I read the guidelines for solving the issue, but I am curious on why do I need to install Postgres
to be able to build this gem
. This could be a problem when I try to build a docker image of this rails app without Postgress
installed in the same image (think microservices). Any thoughts on how I could circumvent this? Thanks!
../../../../ext/pg_connection.c:2666:47: warning: comparison between pointer and
integer ('int' and 'VALUE' (aka 'void *'))
if(rb_respond_to(stream,rb_intern("fileno")) == Qfalse)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~
is indeed not ideal, rb_respond_to
returns int
and so it should be == 0
to avoid the warning. Behavior-wise it should still work though because Qfalse == (int)0
Hey, getting this error
'An error occurred while installing pg (1.2.2), and Bundler cannot continue.
Make sure that gem install pg -v '1.2.2' --source 'https://rubygems.org/'
succeeds before bundling.'
Sanity check. the pg gem up and running right now?