Could not find rake-12.3.0 in any of the sources (Bundler::GemNotFound) - Bitnami Redmine Stack 3.3.1-0 on Ubuntu 16.04.2 LTS - rake

I am using the Bitnami Redmine Stack 3.3.1-0 on Ubuntu 16.04.2 LTS.
I recently installed a plugin (Issue Templates - http://www.redmine.org/plugins/redmine_issue_templates).
In the process, I updated the gems using bundle install and bundle update.
After performing this update, the Redmine website no longer works. I get the error:
"We're sorry, but something went wrong. We've been notified about this issue and we'll take a look at it shortly."
Upon analyzing the apache error log, I find the error:
"Could not find rake-12.3.0 in any of the sources (Bundler::GemNotFound)"
However, I have checked /opt/bitnami/apps/redmine/htdocs/vendor/ and /opt/bitnami/ruby/lib/ruby/gems/2.1.0/gems and rake-12.3.0 is included in both locations. I am not sure why this issue is occuring.
I uninstalled the plugin and removed the files, but I still have the issue. I tried bundle install, bundle update, gem install rake -v '12.3.0', bundle exec rake rails:update:bin in the /opt/bitnami/apps/redmine/htdocs/ folder, and I also tried ./gem update in the /opt/bitnami/ruby/bin folder, but I still have the issue.
Please advise me what to do.
[ 2018-03-15 15:35:23.8349 28957/7f4ce96ec700 age/Hel/Req/CheckoutSession.cpp:252 ]: [Client 4-1] Cannot checkout session because a spawning error occurred. The identifier of the error is 35671c4a. Please see earlier logs for details about the error.
App 4445 stdout:
App 4445 stderr: /opt/bitnami/ruby/lib/ruby/gems/2.1.0/gems/passenger-5.0.6/lib/phusion_passenger/config/system_metrics_command.rb:34: warning: Insecure world writable dir /opt/bitnami/ruby/bin in PATH, mode 040757
App 4445 stdout:
[ 2018-03-15 15:35:29.9175 28957/7f4ce86a9700 App/Implementation.cpp:287 ]: Could not spawn process for application /opt/bitnami/apps/redmine/htdocs/: An error occured while starting up the preloader.
Error ID: 16a39427
Error details saved to: /tmp/passenger-error.3ZEVOb
Message from application: <p>It looks like Bundler could not find a gem. Maybe you didn't install all the gems that this application needs. To install your gems, please run:</p>
<pre class="commands">bundle install</pre>
<p>If that didn't work, then the problem is probably caused by your application being run under a different environment than it's supposed to. Please check the following:</p>
<ol>
<li>Is this app supposed to be run as the <code>daemon</code> user?</li>
<li>Is this app being run on the correct Ruby interpreter? Below you will
see which Ruby interpreter Phusion Passenger attempted to use.</li>
</ol>
<p>-------- The exception is as follows: -------</p>
Could not find rake-12.3.0 in any of the sources (Bundler::GemNotFound)
<pre> /opt/bitnami/ruby/lib/ruby/gems/2.1.0/gems/bundler-1.16.1/lib/bundler/spec_set.rb:88:in `block in materialize'
/opt/bitnami/ruby/lib/ruby/gems/2.1.0/gems/bundler-1.16.1/lib/bundler/spec_set.rb:82:in `map!'
/opt/bitnami/ruby/lib/ruby/gems/2.1.0/gems/bundler-1.16.1/lib/bundler/spec_set.rb:82:in `materialize'
/opt/bitnami/ruby/lib/ruby/gems/2.1.0/gems/bundler-1.16.1/lib/bundler/definition.rb:170:in `specs'
/opt/bitnami/ruby/lib/ruby/gems/2.1.0/gems/bundler-1.16.1/lib/bundler/definition.rb:237:in `specs_for'
/opt/bitnami/ruby/lib/ruby/gems/2.1.0/gems/bundler-1.16.1/lib/bundler/definition.rb:226:in `requested_specs'
/opt/bitnami/ruby/lib/ruby/gems/2.1.0/gems/bundler-1.16.1/lib/bundler/runtime.rb:108:in `block in definition_method'
/opt/bitnami/ruby/lib/ruby/gems/2.1.0/gems/bundler-1.16.1/lib/bundler/runtime.rb:20:in `setup'
/opt/bitnami/ruby/lib/ruby/gems/2.1.0/gems/bundler-1.16.1/lib/bundler.rb:107:in `setup'
/opt/bitnami/ruby/lib/ruby/gems/2.1.0/gems/bundler-1.16.1/lib/bundler/setup.rb:20:in `<top (required)>'
/opt/bitnami/ruby/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:135:in `require'
/opt/bitnami/ruby/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:135:in `rescue in require'
/opt/bitnami/ruby/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:144:in `require'
/opt/bitnami/ruby/lib/ruby/gems/2.1.0/gems/passenger-5.0.6/lib/phusion_passenger/loader_shared_helpers.rb:278:in `block in run_load_path_setup_code'
/opt/bitnami/ruby/lib/ruby/gems/2.1.0/gems/passenger-5.0.6/lib/phusion_passenger/loader_shared_helpers.rb:381:in `running_bundler'
/opt/bitnami/ruby/lib/ruby/gems/2.1.0/gems/passenger-5.0.6/lib/phusion_passenger/loader_shared_helpers.rb:276:in `run_load_path_setup_code'
/opt/bitnami/ruby/lib/ruby/gems/2.1.0/gems/passenger-5.0.6/helper-scripts/rack-preloader.rb:99:in `preload_app'
/opt/bitnami/ruby/lib/ruby/gems/2.1.0/gems/passenger-5.0.6/helper-scripts/rack-preloader.rb:157:in `<module:App>'
/opt/bitnami/ruby/lib/ruby/gems/2.1.0/gems/passenger-5.0.6/helper-scripts/rack-preloader.rb:29:in `<module:PhusionPassenger>'
/opt/bitnami/ruby/lib/ruby/gems/2.1.0/gems/passenger-5.0.6/helper-scripts/rack-preloader.rb:28:in `<main>'</pre>
[ 2018-03-15 15:35:29.9342 28957/7f4ceaeef700 age/Hel/Req/CheckoutSession.cpp:252 ]: [Client 1-2] Cannot checkout session because a spawning error occurred. The identifier of the error is 16a39427. Please see earlier logs for details about the error.

Did you load the Bitnami environment before running the "bundle" commands? There's a script at /opt/bitnami/ called "use_redmine". Please run it before running the commands.
For instance:
/opt/bitnami/use_redmine
cd /opt/bitnami/apps/redmine/htdocs/
bundle ...
Note: if you installed the Redmine Stack as superuser "root" on your Ubuntu, you need to load the environment using sudo /opt/bitnami/use_redmine

Related

Execution Chef Cookbook using chef-solo

I am trying to execute chef solo on my windows vm locally using Powershell. (I am trying to execute cookbook during provisioning customise Windows VM on cloud)
All cookbook recipe dependencies are available within the cookbook.
Create solo.rb for recipe execution & web.json to run recipe.
"type": "powershell",
"inline": "chef-client --chef-license=accept -z -o cookbooks\\cookbook_workstation"
Error:
WARN: Failed to read the private key C:\chef\client.pem: #<Errno::ENOENT: No such file or directory # rb_sysopen - C:\chef\client.pem>
WARN: Error while reporting run start to Data Collector. URL: https://localhost:443/data-collector Exception: No HTTP Code -- I cannot read C:\chef\client.pem, which you told me to use to sign requests!
FATAL: NoMethodError: undefined method logger' for nil:NilClass <internal:warning>:43:in warn': warning: Chef::Compliance::Runner#logger at C:/opscode/chef/embedded/lib/ruby/2.7.0/forwardable.rb:154 forwarding to private method NilClass#logger (StructuredWarnings::BuiltInWarning)
Using chef-solo so I don't need chef server - how can I overcome client.pem WARN and logger issue. Pointers would be very helpful

GConf Error: "Failed to contact configuration server ... 1: Not running within active session"

I have installed Gnumeric in CentOS 6.5, then use ssconvert command to convert .xls/.xlsx file to CSV, but I still get the following error:
$ ssconvert
GConf Error: Failed to contact configuration server; some possible causes are that you need to enable TCP/IP networking for ORBit, or you
have stale NFS locks due to a system crash. See
http://projects.gnome.org/gconf/ for information. (Details - 1: Not
running within active session)
GConf Error: Failed to contact configuration server; some possible causes are that you need to enable TCP/IP networking for ORBit, or you
have stale NFS locks due to a system crash. See
http://projects.gnome.org/gconf/ for information. (Details - 1: Not
running within active session)
** (ssconvert:5725): WARNING **: Configured default font 'Sans 10.000000' not available, trying fallback...
** (ssconvert:5725): WARNING **: Fallback font 'Sans 10.000000' not available, trying 'fixed'...
** (ssconvert:5725): WARNING **: Even 'fixed 10' failed ?? We're going to exit now,there is something wrong with your font
configuration
Can you help me?
As this is an old question, the answer is in case someone will get the same error (like me today on CentOS 6.8), you missed to install the Sans font:
yum install gnu-free-sans-fonts
For docker alpine images this might help:
RUN apk add --update \
msttcorefonts-installer fontconfig \
ttf-opensans

PDOException' with message 'could not find driver'

Fatal error: Uncaught exception 'PDOException' with message 'could not find driver' in /home/kholifah/htdocs/cechcalk.ck/userAuth.php:22 Stack trace: #0 /home/kholifah/htdocs/cechcalk.ck/userAuth.php(22): PDO->__construct('?????pgsql:dbna...') #1 {main} thrown in /home/kholifah/htdocs/cechcalk.ck/userAuth.php on line 22
It looks like you are missing module called pdo_pgsql.
Look in your php.ini for a line extension=php_pdo_pgsql.dll. It should be uncommented.
On Ubuntu or other linux distribution you can install PDO driver with something like
apt-get install php5-pgsql.
I was also facing this problem into xampp now its works for me, May be it will helpful to you also in linux platform lamp or latest version of Php 5.6 - 7.
Just uncomment these lines from php.ini file
extension=pdo_pgsql
extension=pgsql
Example from my php.ini file
The earliest answers forgot to mention that you need to restart some services after enabling the following in php.ini file:
extension=pdo_pgsql
extension=pgsql
You need to restart your web server, in my case my using nginx, so I do
sudo systemctl restart nginx.service
After that I restart php-fpm using:
sudo systemctl restart php-fpm.service
Thats All...cheers

Sinatra App on Heroku ActiveRecord::StatementInvalid: PGError: ERROR:

SCENARIO:
I currently have anapplication on Heroku that is Sinatra Application + ActiveRecord. What currently works:
• I am able to view static pages of my site
• I am able to run migrations
• I am able to push my local development db to my Heroku DB (heroku db:push postgres://localhost/dev)
• I am able to pull from the Heroku DB down to my localhost DB (heroku db:pull postgres://localhost/dev)
THE ERROR:
When I navigate to a page that makes a simple query like:
#pics = Picture.find(:all)
I get this error in my log file
DEBUG -- : NoMethodError: undefined method `values' for #<PGresult:0x00000002844098>: SHOW client_min_messages
DEBUG -- : PGError: ERROR: invalid value for parameter "client_min_messages": ""
: SET client_min_messages TO ''
ActiveRecord::StatementInvalid - PGError: ERROR: invalid value for parameter "client_min_messages": ""
/app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.1.3/lib/active_record/connection_adapters/postgresql_adapter.rb:592:in `async_exec'
At this point I'm not sure what is wrong so I decided to log onto the heroku console and run this command to see if my tables are in the DB
> heroku console
> ActiveRecord::Base.connection.tables
AND I get a similar errors
ActiveRecord::StatementInvalid: PGError: ERROR: invalid value for parameter "client_min_messages": ""
: SET client_min_messages TO ''
/app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.1.3/lib/active_record/connection_adapters/postgresql_adapter.rb:592:in `async_exec'
/app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.1.3/lib/active_record/connection_adapters/postgresql_adapter.rb:592:in `block in execute'
/app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.1.3/lib/active_record/connection_adapters/abstract_adapter.rb:244:in `block in log'
/app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.1.3/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
Then I decided to try this in the console...
> ActiveRecord::Base.establish_connection
> ActiveRecord::AdapterNotSpecified: ActiveRecord::AdapterNotSpecified
/app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.1.3/lib/active_record/connection_adapters/abstract/connection_specification.rb:54:in `establish_connection'
/home/heroku_rack/lib/console.rb:158:in `block (2 levels) in <top (required)>'
/home/heroku_rack/lib/console.rb:148:in `eval'
/home/heroku_rack/lib/console.rb:148:in `_eval'
At this point it would seem that I have no tables and adapter connection but how can that be when I'm able to run migrations and push and pull from the Heroku DB?
UPDATE 1 - NOT MUCH FURTHER ALONG BUT MORE INSIGHT
So I decided to start from scratch and do this over again. I seem to have made some progress but I'm stuck. At re-ran my scenario I mentioned above and succeed. So my database, migration and data are all in the DB. But my app still cannot connect to the DB. BUT what's weird is my console interaction.
> heroku console
> ActiveRecord::Base.connection_config
> {:adapter=>"postgresql", :database=>"1e2e12e21e", :username=>"1e2e12e21e", :password=>"i2j3i23joo12", :host=>"1e2-12e-2e1212-e2e2e1.compute-1.amazonaws.com", :port=>5432, :encoding=>"unicode"}
NOTE: I replaced the real details with this fake stuff just to illustrate
> ActiveRecord::Base.connection_handler
> #<ActiveRecord::ConnectionAdapters::ConnectionHandler:0x00000002f8a578 #connection_pools={"….
NOTE: This a really long string but it has content
> ActiveRecord::Base.connected?
> false
At this point I really don't get it? I don't get how I can keep running db migrations, keeping push and pulling data, log into Heroku Console see my connection_config details, BUT when I run my app internal server error. AND when I run ActiveRecord::Base.connection.tables in heroku console I get ActiveRecord::StatementInvalid: PGError: ERROR: invalid value for parameter "client_min_messages": ""
Any thoughts on what I could be doing wrong?
FINAL UPDATE
Here is what the problem is:
Heroku support kindly pointed to me to a known issue with activerecord 3.1.3. It's a bug that should be fixed in future updates: https://github.com/rails/rails/commit/92a3c487bb0d125c437e53a7f45c31fcca97f2d9
How to solve the problem:
I decided to use a much lower version of activerecord in my gemfile gem "activerecord", "~> 3.0.9 and my site is up and running with no problems so far.
Why I never tried this out before I don't know. I hope this post anyone else.
I had this problem for a long time and it was driving me nuts. I couldn't find a solution anywhere (and many rails updates passed by not solving the "problem"), so i decided to just hunt down the issue myself. It turned out to be an easy fix. Just add an additional key, value pair: :min_messages => "warn" (or whatever message level you want) to the ActiveRecord setup in your configure block. here's what I'm using in my Sinatra app's right now, using Sinatra 1.3.2 and ActiveRecord 3.2.2:
db = URI.parse(ENV['DATABASE_URL'] || "postgres://user:password#localhost/database")
adapter = (db.scheme == "postres") ? "postgresql" : db.scheme
ActiveRecord::Base.configurations[:production] = {
:adapter => adapter,
:username => db.user,
:password => db.password,
:port => db.port,
:database => db.path.sub(%r(^/),""),
:host => db.host,
:min_messages => "warn"
}
unless ActiveRecord::Base.connected?
ActiveRecord::Base.establish_connection ActiveRecord::Base.configurations[:production]
ActiveRecord::Base.logger = Logger.new(STDOUT)
end
hope this helps you and any other people having these issues!
None of the other suggestions worked for me. I ultimately fixed this by switching to the Heroku cedar stack:
heroku create your app --stack cedar
I had this problem on both bamboo-ree-1.8.7 and bamboo-mri-1.9.2 stacks. The application worked fine on localhost, and migrated OK on heroku, but reading the database inside the heroku web stack failed with a client_min_messages complaint.
Setting the :min_messages (as suggested in another answer) to either "warn" or "warning" produced different errors.
Forcing my ActiveRecord down to 3.0.11 (from 3.2.3) resolved the issue. (Not that I see anything in AR to explain this. I speculate it's related to differing postgres versions ... I'm using 9.0.3, suspect the heroku bamboo shared is 8.4)
Pushing this up in my gem file worked for me.
group :production do
gem 'pg'
gem 'activerecord', '~> 3.0.9'
end

Sinatra app on Passenger can't find Rack (using RVM)

I've been fighting with a staging server for this Sinatra app for two days. I'm getting pretty frustrated. The latest pothole is a Ruby error handed up by Passenger:
no such file to load -- rack
The nginx.conf file shows which Ruby we're using, and where Passenger is located:
passenger_root /usr/local/rvm/gems/ruby-1.9.2-p180/gems/passenger-3.0.5;
passenger_ruby /usr/local/rvm/rubies/ruby-1.9.2-p180/bin/ruby;
OK, so that's Ruby 1.9.2 for us.
The vhost configuration includes:
root /var/www/staging-proweb/current/rack/public;
passenger_enabled on;
rack_env staging;
and the rackup file has:
require 'rubygems'
require 'sinatra'
require 'myapp1.rb'
run Sinatra::Application
which then sends us to the myapp1.rb file, which includes
require 'rubygems'
require 'rack'
require 'sinatra'
...and I assume the sinatra require is what's calling for rack.
The gem's there:
~$ which ruby
/usr/local/rvm/rubies/ruby-1.9.2-p180/bin/ruby
~$ gem list rack
*** LOCAL GEMS ***
rack (1.2.2)
rack-flash (0.1.1)
The error seems to be in a file in the RVM directory, judging from the first three lines of the stack trace:
0 /usr/local/rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb 36 in `require'
1 /usr/local/rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb 36 in `require'
2 /usr/local/rvm/gems/ruby-1.9.2-p180/gems/passenger-3.0.5/lib/phusion_passenger/rack/application_spawner.rb 219 in `load_rack_app'
What should I try next? I'm pretty stumped at this point.
It looks like the issue was with the passenger_ruby configuration value. RVM provides a wrapper to set up the appropriate environment for that Ruby (including the gems), so the passenger_ruby line should have read
passenger_ruby /usr/local/rvm/wrappers/ruby-1.9.2-p180/ruby;
With that in place, we seem to be up and running.