I added gem 'redis' to my Gemfile. Ran bundle install. Restarted the local server, then ran the hello world example in my console only to get an error. Any idea what's wrong?
[kudo (develop)]$ rails console
Loading development environment (Rails 3.2.3)
1.9.3p125 :001 > redis = Redis.new
=> #<Redis client v3.0.2 for redis://127.0.0.1:6379/0>
1.9.3p125 :002 > redis.set("mykey", "hello world")
Redis::CannotConnectError: Error connecting to Redis on 127.0.0.1:6379 (ECONNREFUSED)
from /Users/pejman/.rvm/gems/ruby-1.9.3-p125#rails3tutorial2ndEd/gems/redis-3.0.2/lib/redis/client.rb:268:in `rescue in establish_connection'
from /Users/pejman/.rvm/gems/ruby-1.9.3-p125#rails3tutorial2ndEd/gems/redis-3.0.2/lib/redis/client.rb:263:in `establish_connection'
from /Users/pejman/.rvm/gems/ruby-1.9.3-p125#rails3tutorial2ndEd/gems/redis-3.0.2/lib/redis/client.rb:69:in `connect'
from /Users/pejman/.rvm/gems/ruby-1.9.3-p125#rails3tutorial2ndEd/gems/redis-3.0.2/lib/redis/client.rb:282:in `ensure_connected'
from /Users/pejman/.rvm/gems/ruby-1.9.3-p125#rails3tutorial2ndEd/gems/redis-3.0.2/lib/redis/client.rb:173:in `block in process'
from /Users/pejman/.rvm/gems/ruby-1.9.3-p125#rails3tutorial2ndEd/gems/redis-3.0.2/lib/redis/client.rb:248:in `logging'
from /Users/pejman/.rvm/gems/ruby-1.9.3-p125#rails3tutorial2ndEd/gems/redis-3.0.2/lib/redis/client.rb:172:in `process'
from /Users/pejman/.rvm/gems/ruby-1.9.3-p125#rails3tutorial2ndEd/gems/redis-3.0.2/lib/redis/client.rb:84:in `call'
from /Users/pejman/.rvm/gems/ruby-1.9.3-p125#rails3tutorial2ndEd/gems/redis-3.0.2/lib/redis.rb:608:in `block in set'
from /Users/pejman/.rvm/gems/ruby-1.9.3-p125#rails3tutorial2ndEd/gems/redis-3.0.2/lib/redis.rb:36:in `block in synchronize'
from /Users/pejman/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
from /Users/pejman/.rvm/gems/ruby-1.9.3-p125#rails3tutorial2ndEd/gems/redis-3.0.2/lib/redis.rb:36:in `synchronize'
from /Users/pejman/.rvm/gems/ruby-1.9.3-p125#rails3tutorial2ndEd/gems/redis-3.0.2/lib/redis.rb:607:in `set'
from (irb):2
from /Users/pejman/.rvm/gems/ruby-1.9.3-p125#rails3tutorial2ndEd/gems/railties-3.2.3/lib/rails/commands/console.rb:47:in `start'
from /Users/pejman/.rvm/gems/ruby-1.9.3-p125#rails3tutorial2ndEd/gems/railties-3.2.3/lib/rails/commands/console.rb:8:in `start'
from /Users/pejman/.rvm/gems/ruby-1.9.3-p125#rails3tutorial2ndEd/gems/railties-3.2.3/lib/rails/commands.rb:41:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'1.9.3p125 :003 >
Ended up being pretty simple.
To install redis (server) I ran (in the terminal):
brew install redis
Then in a separate terminal window, I started the server with:
redis-server
Now I'm all setup. My redis.set command works fine now in the rails console.
Here's a good resource I found that walks through it more in depth: http://jimneath.org/2011/03/24/using-redis-with-ruby-on-rails.html
Related
I tried to use falcon within a container built from this Dockerfile:
FROM docker.io/library/ruby:3.1.2 AS build-stage
COPY Gemfile .
COPY Gemfile.lock .
RUN bundle install
WORKDIR /app
COPY . .
CMD falcon host
My falcon.rb looks as follows
#!/usr/bin/env -S falcon host
# frozen_string_literal: true
load :rack, :supervisor
rack 'localhost' do
endpoint Async::HTTP::Endpoint
.parse('http://0.0.0.0:3001')
end
supervisor
But when I try to launch this container I get the following error message:
{"time":"2022-12-02T14:29:44+00:00","severity":"info","class":"Falcon::Command::Host","oid":2680,"pid":2,"subject":"Falcon::Command::Host","message":"Falcon Host v0.42.3 taking flight!\n- Configuration: falcon.rb\n- To terminate: Ctrl-C or kill 2\n- To reload: kill -HUP 2\n"}
/usr/local/bundle/gems/falcon-0.42.3/lib/falcon/service/supervisor.rb:23:in `require': cannot load such file -- process/metrics (LoadError)
from /usr/local/bundle/gems/falcon-0.42.3/lib/falcon/service/supervisor.rb:23:in `<top (required)>'
from /usr/local/bundle/gems/falcon-0.42.3/lib/falcon/environments/supervisor.rb:23:in `require_relative'
from /usr/local/bundle/gems/falcon-0.42.3/lib/falcon/environments/supervisor.rb:23:in `block in load'
from /usr/local/bundle/gems/falcon-0.42.3/lib/falcon/configuration.rb:134:in `instance_eval'
from /usr/local/bundle/gems/falcon-0.42.3/lib/falcon/configuration.rb:134:in `block in load'
from /usr/local/bundle/gems/falcon-0.42.3/lib/falcon/configuration.rb:127:in `each'
from /usr/local/bundle/gems/falcon-0.42.3/lib/falcon/configuration.rb:127:in `load'
from /app/falcon.rb:4:in `load_file'
from /usr/local/bundle/gems/falcon-0.42.3/lib/falcon/configuration.rb:118:in `instance_eval'
from /usr/local/bundle/gems/falcon-0.42.3/lib/falcon/configuration.rb:118:in `load_file'
from /usr/local/bundle/gems/falcon-0.42.3/lib/falcon/configuration.rb:85:in `load_file'
from /usr/local/bundle/gems/falcon-0.42.3/lib/falcon/command/host.rb:54:in `block in configuration'
from /usr/local/bundle/gems/falcon-0.42.3/lib/falcon/command/host.rb:52:in `each'
from /usr/local/bundle/gems/falcon-0.42.3/lib/falcon/command/host.rb:52:in `configuration'
from /usr/local/bundle/gems/falcon-0.42.3/lib/falcon/controller/host.rb:39:in `initialize'
from /usr/local/bundle/gems/falcon-0.42.3/lib/falcon/command/host.rb:62:in `new'
from /usr/local/bundle/gems/falcon-0.42.3/lib/falcon/command/host.rb:62:in `controller'
from /usr/local/bundle/gems/falcon-0.42.3/lib/falcon/command/host.rb:84:in `call'
from /usr/local/bundle/gems/falcon-0.42.3/lib/falcon/command/top.rb:105:in `call'
from /usr/local/bundle/gems/samovar-2.1.4/lib/samovar/command.rb:36:in `call'
from /usr/local/bundle/gems/falcon-0.42.3/lib/falcon/command.rb:30:in `call'
from /usr/local/bundle/gems/falcon-0.42.3/bin/falcon:26:in `<top (required)>'
from /usr/local/bundle/bin/falcon:25:in `load'
from /usr/local/bundle/bin/falcon:25:in `<main>'
Interestingly everything works fine when running natively, but it seems when run inside a container there is an issue with the process/metrics dependency but I'm not sure how to resolve it.
As pointed out by #anothermh in the comments the solution was to use the bundler for running falcon in the Dockerfile:
CMD bundle exec falcon host
I am developing Telegram bot using Ruby Telegram Bot boilerplate.
It is implemented on Ruby (without Rails) using Active Record and works fine locally on development.
I decided to deploy it on Heroku. I ran
$ heroku buildpacks:set heroku/ruby
After pushing to Heroku I need ran db:migrate, which gave the following output:
$ heroku run rake db:migrate --trace
Running rake db:migrate --trace on telegram-bot-app... up, run.2290 (Free)
** Invoke db:migrate (first_time)
** Execute db:migrate
rake aborted!
PG::ConnectionBad: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
/app/vendor/bundle/ruby/2.5.0/gems/pg-0.18.4/lib/pg.rb:45:in `initialize'
/app/vendor/bundle/ruby/2.5.0/gems/pg-0.18.4/lib/pg.rb:45:in `new'
/app/vendor/bundle/ruby/2.5.0/gems/pg-0.18.4/lib/pg.rb:45:in `connect'
/app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.1.6.2/lib/active_record/connection_adapters/postgresql_adapter.rb:697:in `connect'
/app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.1.6.2/lib/active_record/connection_adapters/postgresql_adapter.rb:221:in `initialize'
/app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.1.6.2/lib/active_record/connection_adapters/postgresql_adapter.rb:38:in `new'
/app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.1.6.2/lib/active_record/connection_adapters/postgresql_adapter.rb:38:in `postgresql_connection'
/app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.1.6.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:759:in `new_connection'
/app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.1.6.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:803:in `checkout_new_connection'
/app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.1.6.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:782:in `try_to_checkout_new_connection'
/app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.1.6.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:743:in `acquire_connection'
/app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.1.6.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:500:in `checkout'
/app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.1.6.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:374:in `connection'
/app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.1.6.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:931:in `retrieve_connection'
/app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.1.6.2/lib/active_record/connection_handling.rb:116:in `retrieve_connection'
/app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.1.6.2/lib/active_record/connection_handling.rb:88:in `connection'
/app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.1.6.2/lib/active_record/schema_migration.rb:20:in `table_exists?'
/app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.1.6.2/lib/active_record/schema_migration.rb:24:in `create_table'
/app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.1.6.2/lib/active_record/migration.rb:1125:in `initialize'
/app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.1.6.2/lib/active_record/migration.rb:1007:in `new'
/app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.1.6.2/lib/active_record/migration.rb:1007:in `up'
/app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.1.6.2/lib/active_record/migration.rb:985:in `migrate'
/app/Rakefile:14:in `block (2 levels) in <top (required)>'
/app/vendor/bundle/ruby/2.5.0/gems/rake-12.3.1/lib/rake/task.rb:271:in `block in execute'
/app/vendor/bundle/ruby/2.5.0/gems/rake-12.3.1/lib/rake/task.rb:271:in `each'
/app/vendor/bundle/ruby/2.5.0/gems/rake-12.3.1/lib/rake/task.rb:271:in `execute'
/app/vendor/bundle/ruby/2.5.0/gems/rake-12.3.1/lib/rake/task.rb:213:in `block in invoke_with_call_chain'
/app/vendor/ruby-2.5.1/lib/ruby/2.5.0/monitor.rb:226:in `mon_synchronize'
/app/vendor/bundle/ruby/2.5.0/gems/rake-12.3.1/lib/rake/task.rb:193:in `invoke_with_call_chain'
/app/vendor/bundle/ruby/2.5.0/gems/rake-12.3.1/lib/rake/task.rb:182:in `invoke'
/app/vendor/bundle/ruby/2.5.0/gems/rake-12.3.1/lib/rake/application.rb:160:in `invoke_task'
/app/vendor/bundle/ruby/2.5.0/gems/rake-12.3.1/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/app/vendor/bundle/ruby/2.5.0/gems/rake-12.3.1/lib/rake/application.rb:116:in `each'
/app/vendor/bundle/ruby/2.5.0/gems/rake-12.3.1/lib/rake/application.rb:116:in `block in top_level'
/app/vendor/bundle/ruby/2.5.0/gems/rake-12.3.1/lib/rake/application.rb:125:in `run_with_threads'
/app/vendor/bundle/ruby/2.5.0/gems/rake-12.3.1/lib/rake/application.rb:110:in `top_level'
/app/vendor/bundle/ruby/2.5.0/gems/rake-12.3.1/lib/rake/application.rb:83:in `block in run'
/app/vendor/bundle/ruby/2.5.0/gems/rake-12.3.1/lib/rake/application.rb:186:in `standard_exception_handling'
/app/vendor/bundle/ruby/2.5.0/gems/rake-12.3.1/lib/rake/application.rb:80:in `run'
/app/vendor/bundle/ruby/2.5.0/gems/rake-12.3.1/exe/rake:27:in `<top (required)>'
/app/vendor/bundle/ruby/2.5.0/bin/rake:23:in `load'
/app/vendor/bundle/ruby/2.5.0/bin/rake:23:in `<top (required)>'
/app/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/lib/bundler/cli/exec.rb:74:in `load'
/app/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/lib/bundler/cli/exec.rb:74:in `kernel_load'
/app/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/lib/bundler/cli/exec.rb:27:in `run'
/app/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/lib/bundler/cli.rb:360:in `exec'
/app/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/app/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/app/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/lib/bundler/vendor/thor/lib/thor.rb:369:in `dispatch'
/app/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/lib/bundler/cli.rb:20:in `dispatch'
/app/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/lib/bundler/vendor/thor/lib/thor/base.rb:444:in `start'
/app/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/lib/bundler/cli.rb:10:in `start'
/app/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/exe/bundle:30:in `block in <top (required)>'
/app/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/lib/bundler/friendly_errors.rb:121:in `with_friendly_errors'
/app/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/exe/bundle:22:in `<top (required)>'
/app/vendor/bundle/ruby/2.5.0/bin/bundle:23:in `load'
/app/vendor/bundle/ruby/2.5.0/bin/bundle:23:in `<main>'
Tasks: TOP => db:migrate
The same problem happens when I run db:create.
This is what Rakefile and config/database.yml look like on Heroku:
$ heroku run bash
Running bash on telegram-bot-app... up, run.3429 (Free)
~ $ cat Rakefile
require 'rubygems'
require 'bundler/setup'
require 'pg'
require 'active_record'
require 'yaml'
namespace :db do
desc 'Migrate the database'
task :migrate do
connection_details = YAML::load(File.open('config/database.yml'))
ActiveRecord::Base.establish_connection(connection_details)
ActiveRecord::Migrator.migrate('db/migrate/')
end
desc 'Create the database'
task :create do
connection_details = YAML::load(File.open('config/database.yml'))
admin_connection = connection_details.merge({'database'=> 'postgres',
'schema_search_path'=> 'public'})
ActiveRecord::Base.establish_connection(admin_connection)
ActiveRecord::Base.connection.create_database(connection_details.fetch('database'))
end
desc 'Drop the database'
task :drop do
connection_details = YAML::load(File.open('config/database.yml'))
admin_connection = connection_details.merge({'database'=> 'postgres',
'schema_search_path'=> 'public'})
ActiveRecord::Base.establish_connection(admin_connection)
ActiveRecord::Base.connection.drop_database(connection_details.fetch('database'))
end
end
~ $ cat config/database.yml
adapter: postgresql
database: bot
encoding: unicode
pool: 5
timeout: 5000
Here are my configured buildpacks:
$ heroku buildpacks
=== telegram-bot-app Buildpack URL
heroku/ruby
Here are my addons:
$ heroku addons
Add-on Plan Price State
────────────────────────────────────────────── ───────── ───── ───────
heroku-postgresql (postgresql-contoured-96514) hobby-dev free created
└─ as DATABASE
The table above shows add-ons and the attachments to the current app (telegram-bot-app) or other apps.
That's my Gemfile:
source 'https://rubygems.org'
ruby '2.5.1'
gem 'telegram-bot-ruby'
gem 'activerecord', '5.1.6.2'
gem 'i18n'
gem 'pg', '~> 0.18'
gem 'rake', '12.3.1'
gem 'dotenv'
What could be the problem and how to get Heroku to migrate the database?
Your database won't be on the same server as your code, and you can't create it yourself. Instead, Heroku tells you how to connect via the DATABASE_URL environment variable.
The code you reference appears to load its database information from a file without looking at the environment. You'll have to modify it to use ENV['DATABASE_URL'] when that variable is set.
Christophers-MacBook-Pro:spec chrisvh$ bundle exec rspec
Could not find i18n-0.6.9 in any of the sources
Run `bundle install` to install missing gems.
Christophers-MacBook-Pro:spec chrisvh$ bundle install
--- ERROR REPORT TEMPLATE -------------------------------------------------------
- What did you do?
I ran the command `/Users/chrisvh/.rbenv/versions/2.1.2/bin/bundle install`
- What did you expect to happen?
I expected Bundler to...
- What happened instead?
Instead, what actually happened was...
Error details
Errno::EACCES: Permission denied # rb_sysopen - /Users/chrisvh/.bundle/cache/compact_index/rubygems.org.443.29b0360b937aa4d161703e6160654e47/versions
/Users/chrisvh/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.12.0.pre.1/lib/bundler/vendor/compact_index_client/lib/compact_index_client/updater.rb:32:in `initialize'
/Users/chrisvh/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.12.0.pre.1/lib/bundler/vendor/compact_index_client/lib/compact_index_client/updater.rb:32:in `open'
/Users/chrisvh/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.12.0.pre.1/lib/bundler/vendor/compact_index_client/lib/compact_index_client/updater.rb:32:in `open'
/Users/chrisvh/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.12.0.pre.1/lib/bundler/vendor/compact_index_client/lib/compact_index_client/updater.rb:32:in `update'
/Users/chrisvh/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.12.0.pre.1/lib/bundler/vendor/compact_index_client/lib/compact_index_client.rb:63:in `update'
/Users/chrisvh/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.12.0.pre.1/lib/bundler/vendor/compact_index_client/lib/compact_index_client.rb:54:in `update_and_parse_checksums!'
/Users/chrisvh/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.12.0.pre.1/lib/bundler/fetcher/compact_index.rb:63:in `available?'
/Users/chrisvh/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.12.0.pre.1/lib/bundler/fetcher/compact_index.rb:15:in `call'
/Users/chrisvh/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.12.0.pre.1/lib/bundler/fetcher/compact_index.rb:15:in `block in compact_index_request'
/Users/chrisvh/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.12.0.pre.1/lib/bundler/fetcher.rb:154:in `use_api'
/Users/chrisvh/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.12.0.pre.1/lib/bundler/source/rubygems.rb:331:in `block in api_fetchers'
/Users/chrisvh/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.12.0.pre.1/lib/bundler/source/rubygems.rb:331:in `select'
/Users/chrisvh/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.12.0.pre.1/lib/bundler/source/rubygems.rb:331:in `api_fetchers'
/Users/chrisvh/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.12.0.pre.1/lib/bundler/source/rubygems.rb:336:in `block in remote_specs'
/Users/chrisvh/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.12.0.pre.1/lib/bundler/index.rb:10:in `build'
/Users/chrisvh/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.12.0.pre.1/lib/bundler/source/rubygems.rb:335:in `remote_specs'
/Users/chrisvh/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.12.0.pre.1/lib/bundler/source/rubygems.rb:82:in `specs'
/Users/chrisvh/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.12.0.pre.1/lib/bundler/lazy_specification.rb:56:in `__materialize__'
/Users/chrisvh/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.12.0.pre.1/lib/bundler/spec_set.rb:91:in `block in materialize'
/Users/chrisvh/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.12.0.pre.1/lib/bundler/spec_set.rb:88:in `map!'
/Users/chrisvh/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.12.0.pre.1/lib/bundler/spec_set.rb:88:in `materialize'
/Users/chrisvh/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.12.0.pre.1/lib/bundler/definition.rb:140:in `specs'
/Users/chrisvh/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.12.0.pre.1/lib/bundler/definition.rb:129:in `resolve_remotely!'
/Users/chrisvh/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.12.0.pre.1/lib/bundler/installer.rb:195:in `resolve_if_need'
/Users/chrisvh/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.12.0.pre.1/lib/bundler/installer.rb:70:in `run'
/Users/chrisvh/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.12.0.pre.1/lib/bundler/installer.rb:22:in `install'
/usr/local/Cellar/rbenv/1.0.0/rbenv.d/exec/gem-rehash/rubygems_plugin.rb:27:in `install'
/Users/chrisvh/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.12.0.pre.1/lib/bundler/cli/install.rb:106:in `run'
/Users/chrisvh/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.12.0.pre.1/lib/bundler/cli.rb:173:in `install'
/Users/chrisvh/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.12.0.pre.1/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/Users/chrisvh/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.12.0.pre.1/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/Users/chrisvh/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.12.0.pre.1/lib/bundler/vendor/thor/lib/thor.rb:359:in `dispatch'
/Users/chrisvh/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.12.0.pre.1/lib/bundler/vendor/thor/lib/thor/base.rb:440:in `start'
/Users/chrisvh/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.12.0.pre.1/lib/bundler/cli.rb:11:in `start'
/Users/chrisvh/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.12.0.pre.1/exe/bundle:27:in `block in <top (required)>'
/Users/chrisvh/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.12.0.pre.1/lib/bundler/friendly_errors.rb:98:in `with_friendly_errors'
/Users/chrisvh/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.12.0.pre.1/exe/bundle:19:in `<top (required)>'
/Users/chrisvh/.rbenv/versions/2.1.2/bin/bundle:23:in `load'
/Users/chrisvh/.rbenv/versions/2.1.2/bin/bundle:23:in `<main>'
Environment
Bundler 1.12.0.pre.1
Rubygems 2.2.2
Ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-darwin15.0]
GEM_HOME /Users/chrisvh/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0
GEM_PATH /Users/chrisvh/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0:/Users/chrisvh/.gem/ruby/2.1.0
Git 2.7.1
--- TEMPLATE END ----------------------------------------------------------------
Unfortunately, an unexpected error occurred, and Bundler cannot continue.
First, try this link to see if there are any existing issue reports for this error:
https://github.com/bundler/bundler/search?q=Permission+denied+%40+rb_sysopen+-+%2FUsers%2Fchrisvh%2F.bundle%2Fcache%2Fcompact_index%2Frubygems.org.443.29b0360b937aa4d161703e6160654e47%2Fversions&type=Issues
If there aren't any reports for this error yet, please create copy and paste the report template above into a new issue. Don't forget to anonymize any private data! The new issue form is located at:
https://github.com/bundler/bundler/issues/new
Apparently there is something very wrong with my bundler because I always get this error and in rails apps I'm forced to run sudo bundle install or something similar to get it working any information on this topic would be greatly appreciated.
I'm trying to connect my sidekiq to a twemproxy instead of a direct Redis connection, but I'm getting the following error:
2013-09-30T17:16:53Z 23329 TID-3q3o4 INFO: Booting Sidekiq 2.12.1 using redis://localhost:22121 with options {}
2013-09-30T17:16:53Z 23329 TID-3q3o4 INFO: Running in ruby 1.9.3p448 (2013-06-27 revision 41675) [x86_64-linux]
2013-09-30T17:16:53Z 23329 TID-3q3o4 INFO: See LICENSE and the LGPL-3.0 for licensing details.
Connection lost (ECONNRESET)
/mnt/-production/shared/bundle/ruby/1.9.1/gems/redis-3.0.4/lib/redis/client.rb:210:in `rescue in io'
/mnt/-production/shared/bundle/ruby/1.9.1/gems/redis-3.0.4/lib/redis/client.rb:206:in `io'
/mnt/-production/shared/bundle/ruby/1.9.1/gems/redis-3.0.4/lib/redis/client.rb:214:in `read'
/mnt/-production/shared/bundle/ruby/1.9.1/gems/redis-3.0.4/lib/redis/client.rb:84:in `block in call'
/mnt/-production/shared/bundle/ruby/1.9.1/gems/redis-3.0.4/lib/redis/client.rb:187:in `block (2 levels) in process'
/mnt/-production/shared/bundle/ruby/1.9.1/gems/redis-3.0.4/lib/redis/client.rb:295:in `ensure_connected'
/mnt/-production/shared/bundle/ruby/1.9.1/gems/redis-3.0.4/lib/redis/client.rb:177:in `block in process'
/mnt/-production/shared/bundle/ruby/1.9.1/gems/redis-3.0.4/lib/redis/client.rb:256:in `logging'
/mnt/-production/shared/bundle/ruby/1.9.1/gems/redis-3.0.4/lib/redis/client.rb:176:in `process'
/mnt/-production/shared/bundle/ruby/1.9.1/gems/redis-3.0.4/lib/redis/client.rb:84:in `call'
/mnt/-production/shared/bundle/ruby/1.9.1/gems/redis-3.0.4/lib/redis.rb:410:in `block in keys'
/mnt/-production/shared/bundle/ruby/1.9.1/gems/redis-3.0.4/lib/redis.rb:36:in `block in synchronize'
/usr/local/rubies/1.9.3-p448/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/mnt/-production/shared/bundle/ruby/1.9.1/gems/redis-3.0.4/lib/redis.rb:36:in `synchronize'
/mnt/-production/shared/bundle/ruby/1.9.1/gems/redis-3.0.4/lib/redis.rb:409:in `keys'
/mnt/-production/shared/bundle/ruby/1.9.1/gems/sidekiq-2.12.1/lib/sidekiq/api.rb:71:in `block in cleanup'
/mnt/-production/shared/bundle/ruby/1.9.1/gems/connection_pool-1.1.0/lib/connection_pool.rb:49:in `with'
/mnt/-production/shared/bundle/ruby/1.9.1/gems/sidekiq-2.12.1/lib/sidekiq.rb:67:in `redis'
/mnt/-production/shared/bundle/ruby/1.9.1/gems/sidekiq-2.12.1/lib/sidekiq/api.rb:70:in `cleanup'
/mnt/-production/shared/bundle/ruby/1.9.1/gems/sidekiq-2.12.1/lib/sidekiq/cli.rb:55:in `run'
/mnt/-production/shared/bundle/ruby/1.9.1/gems/sidekiq-2.12.1/bin/sidekiq:8:in `<top (required)>'
/mnt/-production/shared/bundle/ruby/1.9.1/bin/sidekiq:23:in `load'
/mnt/-production/shared/bundle/ruby/1.9.1/bin/sidekiq:23:in `<main>'
It seems that I'm loosing the connection, but I could not identify what is the root cause. Do you know if it is compatible to try this kind of connection?
The latest version of sidekiq (by the time 2.14.1) is able to connect to twemproxy instead of a redis server.
But due to the use of brpop command, it is not compatible.
colleagues.
Here is what I have:
Windows XP
Ruby 1.9.2p180 (2011-02-18) [i386-mingw32]
Rails 3.1.0
Also I have installed mongrel server gem install mongrel -v 1.2.0.pre2 --pre
When I do rails s, mongrel starts (everything is ok)
But I want to use my RoR application via Apache 2.2, that is installed as service.
I decided that best way is to use Apache & Mongrel. Then I have installed mongrel_service gem install mongrel_service, and run mongrel as service mongrel_rails service::install -N efiling_mongrel -c c:\sites\uplodify -p 3000 -e development -a 127.0.0.1. Then I also setuped Apache...
When I started Apache as service and Mongrel as service, I see such picture:
1) my ruby proccess uses more than 50% of CPU resource
2) permanent growth log/mongrel.log file size
3) there are such errors in log/mongrel.log:
** Starting Mongrel listening at 127.0.0.1:3000
** Starting Rails with development environment...
C:/Ruby/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-.1.0/lib/active_support/dependencies.rb:240:in `require': no such file to load -- dispatcher (LoadError)
from C:/Ruby/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-.1.0/lib/active_support/dependencies.rb:240:in `block in require'
from C:/Ruby/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-.1.0/lib/active_support/dependencies.rb:223:in `block in load_dependency'
from C:/Ruby/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-.1.0/lib/active_support/dependencies.rb:640:in `new_constants_in'
from C:/Ruby/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-.1.0/lib/active_support/dependencies.rb:223:in `load_dependency'
from C:/Ruby/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-.1.0/lib/active_support/dependencies.rb:240:in `require'
from C:/Ruby/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-ingw32/lib/mongrel/rails.rb:148:in `rails'
from C:/Ruby/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-ingw32/bin/mongrel_rails:116:in `block (2 levels) in run'
from C:/Ruby/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-ingw32/lib/mongrel/configurator.rb:149:in `call'
from C:/Ruby/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-ingw32/lib/mongrel/configurator.rb:149:in `listener'
from C:/Ruby/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-ingw32/bin/mongrel_rails:102:in `block in run'
from C:/Ruby/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-ingw32/lib/mongrel/configurator.rb:50:in `call'
from C:/Ruby/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-ingw32/lib/mongrel/configurator.rb:50:in `initialize'
from C:/Ruby/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-ingw32/bin/mongrel_rails:86:in `new'
from C:/Ruby/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-ingw32/bin/mongrel_rails:86:in `run'
from C:/Ruby/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-ingw32/lib/mongrel/command.rb:210:in `run'
from C:/Ruby/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-ingw32/bin/mongrel_rails:282:in `<top (required)>'
from C:/Ruby/Ruby192/bin/mongrel_rails:19:in `load'
from C:/Ruby/Ruby192/bin/mongrel_rails:19:in `<main>'
Someone have any ideas?