I'm using a bitnami ruby stack appliance, and trying to set up capistrano to deploy my app from my MS windows laptop to the appliance. During the bundle install portion the deployment fails when native extensions can't be built. This happens for nokogiri and pg gems so far.
For example:
* ←[33mexecuting "cd /opt/bitnami/projects/melvin/releases/20130826221225 && bundle
install --gemfile /opt/bitnami/projects/melvin/releases/20130826221225/Gemfile --path
/opt/bitnami/projects/melvin/shared/bundle --deployment --quiet --without development
test"←[0m
produces:
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/opt/bitnami/ruby/bin/ruby extconf.rb --with-pg-config=/usr/pgsql-9.2/bin/pg_config
Using config values from /usr/pgsql-9.2/bin/pg_config
sh: 1: /usr/pgsql-9.2/bin/pg_config: not found
sh: 1: /usr/pgsql-9.2/bin/pg_config: not found
checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
But if I open a terminal and ssh in, and issue gem install pg -v '0.16.0' it works fine.
So what is different about what I'm doing from the ssh terminal, and what capistrano is doing (presumably from the same ssh connection)?
I've edited the PATH in my .bashrc to use the same PATH as in the bitnami console.
Anyone ever used capistrano to deploy to a bitnami ruby stack appliance (ubuntu 12.04 I think)?
UPDATE ---
I just tried cap deploy -d and aborted the deploy just before it rm's the release directory. Then I used my ssh terminal and went to the release directory and issued "sudo bundle install" which also gave the error above. So maybe it's not a difference between capistrano and manual ssh, but it must be something in the release directory, since "sudo gem install 'pg'" works, which doesn't matter which directory I'm in.
Also, because I can get the gem to install means the necessary libraries, etc. are installed on my machine somewhere - but bundler seems to have trouble accessing them.
So I'm thinking this is a bundler issue not a capistrano issue, maybe?
Confirmed, I'm bypassing capistrano and it's a problem with bundler.
So why would gem install pg -v '0.16.0' work but bundle install not?
MORE ---
So, bundle install --system works. Then I can do a bundle install --local.
But a bundle install --local --deployment fails, 'could not find pg-0.16.0 in any of the sources'. I don't understand what that means, it's on the system and shows up in a 'gem list'.
I wonder if there's a way to force capistrano to do this?
Related
I want to install Gitlab on Mac OS X. Therefore I followed
Installation Guid for Gitlab on OS X
However, I get into trouble when I install ruby gems by bundle.
bundle install --deployment --without development test mysql aws kerberos
resulted in,
Gem files will remain installed in /Users/git/gitlab/vendor/bundle/ruby/2.3.0/gems/charlock_holmes-0.7.3 for inspection.
Results logged to /Users/git/gitlab/vendor/bundle/ruby/2.3.0/extensions/x86_64-darwin-16/2.3.0-static/charlock_holmes-0.7.3/gem_make.out
An error occurred while installing charlock_holmes (0.7.3), and Bundler cannot continue.
Make sure that `gem install charlock_holmes -v '0.7.3'` succeeds before bundling.
In Gemfile:
gitlab_git was resolved to 10.5.0, which depends on
github-linguist was resolved to 4.7.6, which depends on
charlock_holmes
I tried Unable to install version 0.7.3 on Mac OS Sierra in order to install charlock_holmes.
gem install charlock_holmes -v 0.7.3 -- --with-cxxflags=-std=c++11
it resulted in successfully installed.
Building native extensions with: '--with-cxxflags=-std=c++11'
This could take a while...
Successfully installed charlock_holmes-0.7.3
Parsing documentation for charlock_holmes-0.7.3
Done installing documentation for charlock_holmes after 0 seconds
1 gem installed
So I am confused why I can not keep install gems..
I install all gems by
bundle install --no-deployment --without development test mysql aws kerberos
However, I got in other error...
bundle exec rake gitlab:setup RAILS_ENV=production
resulted in,
D, [2018-01-25T16:22:14.066436 #89351] DEBUG -- sentry: ** [Raven] compared with non class/module excluded from capture due to environment or should_capture callback
rake aborted!
TypeError: compared with non class/module
I had this problem today. What fixed it for me was updating icu4c, then re-installing ruby which will compile with the updated version. I use ruby-install and chruby so it was basically like this:
$ brew upgrade icu4c
$ chruby 2.3.4 # change to previous ruby (if necessary)
$ rm -rf .rubies/ruby-2.4.4 # drop ruby compiled with old version of icu4c
$ ruby-install ruby 2.4.4 # don't forget to restart your terminal after this completes
$ ruby -e 'puts RUBY_VERSION'
2.4.4
$ bundle install # now it works!
I am new to programming and am trying to get rails installed on my terminal. I have been following instructions from a friend, installing the xcode command line tools, homebrew, git, rbenv, ruby-build, ruby gems, ruby, and postgres. But whenever, I try $gem install rails, I get the following:
Russell-Silvers-MacBook-Pro:~ Russell_Silver$ gem install rails
ERROR: While executing gem ... (Errno::EACCES)
Permission denied # rb_sysopen - /Users/Russell_Silver/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rails-4.2.0/README.md
This is especially frustrating because when I run $gem list, it says I have rails 3.2.18. Which is peculiar, because when I run $rails v$, it tells me I have Rails 4.2.0.
When I try to use rails rails my new_app
Errno::EACCES: Permission denied # rb_sysopen - /Users/Russell_Silver/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rails-4.2.0/README.md
An error occurred while installing rails (4.2.0), and Bundler cannot continue.
Make sure that `gem install rails -v '4.2.0'` succeeds before bundling.
run bundle exec spring binstub --all
/Users/Russell_Silver/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/bundler-1.8.3/lib/bundler/shared_helpers.rb:83: warning: Insecure world writable dir /Users/Russell_Silver in PATH, mode 040707
bundler: command not found: spring
Install missing gem executables with `bundle install`
Russell-Silvers-MacBook-Pro:~ Russell_Silver$ bundle install
/Users/Russell_Silver/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/bundler-1.8.3/lib/bundler/vendor/thor/shell/basic.rb:355: warning: Insecure world writable dir /Users/Russell_Silver in PATH, mode 040707
Could not locate Gemfile or .bundle/ directory
This is really frustrating, especially for someone new to programming such as myself, so I am seeking help from anybody who might know what is wrong.
Your rbenv installation was incorrectly installed as it had elevated privileges which caused your user account to not have write access to ~/.rbenv.
Issue the following command in order to take of ownership of the directory:
sudo chown -R Russell_Silver ~/.rbenv
Note that some users may have a different rbenv directory, e.g. /usr/local/var/rbenv. This would take the place of ~/.rbenv in the above command.
Every time i install a gem on production using bundle install i got this error
Could not find rake-10.4.2 in any of the sources (Bundler::GemNotFound)
Also i get the following warning when i do a bundle install
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
I tried removing the Gemfile.lock and re-installed the gems but it still not working
Thanks in advance.
I am deploying Rails app using Capistrano to Centos VPS. On my VPS I can gem install pg, however when I run cap staging deploy, the process failed due to
An error occurred while installing pg (0.17.1), and Bundler cannot continue.
DEBUG[07a4f16d] Make sure that `gem install pg -v '0.17.1'` succeeds before bundling.
When the command 'cd /var/www/projectx/releases/20141117004357 && /usr/local/rvm/bin/rvm default do bundle install --binstubs /var/www/projectx/shared/bin --path /var/www/projectx/shared/bundle --without development test --deployment --quiet'
So on the VPS I can install pg gem globally, but it failed when it trys to run bundle in my release directory cd /var/www/projectx/releases/20141117004357
The error :
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/usr/local/rvm/rubies/ruby-2.1.0/bin/ruby -r ./siteconf20141116-8316-zgkk04.rb extconf.rb --with-pg-config=/opt/local/lib/postgresql91/bin/pg_config
Using config values from /opt/local/lib/postgresql91/bin/pg_config
sh: /opt/local/lib/postgresql91/bin/pg_config: No such file or directory
sh: /opt/local/lib/postgresql91/bin/pg_config: No such file or directory
checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Is it caused by --with-pg-config=/opt/local/lib/postgresql91/bin/pg_config, my pg_config is is a different location, how do I change this?
any idea?
Thanks
I am new to ruby on rails and I just downloaded a new Rails project directory that my friend sent to me. I put that directory on the Desktop and cd into it. I want to play with the code on my local host to learn from the code. But when I tried to run "rails s", it gives me the error saying that
"Could not find pg-0.17.1 in any of the sources
Run `bundle install` to install missing gems."
So I ran "bundle install", then it gave the error that
"An error occurred while installing pg (0.17.1), and Bundler cannot continue.
Make sure that `gem install pg -v '0.17.1'` succeeds before bundling."
I googled the problem for a while but I did not find any solution..
"rails s" stills works fine in my own project's directory. But how can I make it work in the directory I just downloaded? Am I supposed to do some other setup or installing?
Make sure you have installed postgres on your local machine.
gem install pg --with-pg-config works, bundle fails
Here how I made development environment on my Mac.
Install PostgreSQL via Homebrew package manager brew install postgresql. This should install all necessary header files for gem compilation.