Capistrano does not find bundler - deployment

When I try to deploy im getting a:
bash: /srv/books/current/bin/bundle: No such file or directory
When I login on the deploy server doing 'which bundler' results is:
/usr/local/rvm/gems/ruby-2.0.0-p353#books/bin/bundle
Problem when I use the ssh that capistrano uses to deploy and do which then:
ssh root#server 'which bundler'
It throws
which: no bundler in (/usr/local/rvm/gems/ruby-2.0.0-p353/bin:/usr/local/rvm/gems/ruby-2.0.0-p353#global/bin:/usr/local/rvm/rubies/ruby-2.0.0-p353/bin:/usr/local/rvm/bin:/usr/lib/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin)

For more information on why some things in Capistrano don’t work, when they work perfectly in an SSH session, it might be best to read through http://www.capistranorb.com/documentation/faq/why-does-something-work-in-my-ssh-session-but-not-in-capistrano/ and see if you can reproduce the problem after reading through that.
You don't mention which version of Capistrano you are using, but for both 2.x and 3.x there are decent (3rd party and first party) integrations for RVM available)

Related

Reverting to old Google Cloud SDK shell version

I am trying to deploy a Java project into Google App Engine from Eclipse and am blocked by JSPs.
Everything JSP makes my app not capable of deploying due to "'utf8' codec can't decode byte" error.
Not trying to insert any strange (not UTF-8) character, everything Eclipse is set to UTF-8.
Tried to send archives which were OK with the Google App Engine Tools for Eclipse (soon to be deprecated), won't deploy.
I've seen threads regarding reverting the Google Cloud Tools for Eclipse plugin to previous version (1.58 seemed to avoid a few problems) being a possible solution to these recent errors but I have a problem installing, the batch just tells me "Install will exit" ?!
Tried to uninstall previous (latest) versions before, made sure I was launching the bundled-python batch, still not capable of installing an old version of the Google Cloud SDK shell.
Would be glad if anybody had any suggestion at what makes my install fail.
Thanks in advance.
There are a few ways you can get older version of Google Cloud SDK.
Download versioned archive
(If you are on windows) Grab google-cloud-sdk-XXX.0.0-windows-x86_64-bundled-python.zip file.
Unzip it to some\dir
Add some\dir\google-cloud-sdk\bin directory to your system path
Restart your command prompt (or other apps which depend on gcloud) and run for example gcloud info, it should be fully functional installation, no need to run install.bat.
Alternatively, use existing SDK installation and gcloud component manager to go back to previous versions. For example
gcloud components update --version 158.0.0
target by version number using apt-get :
sudo apt-get install google-cloud-sdk=294.0.0-0

Bundle only supports platforms x64-mingw32 but local is x86_64-linux

I developed my Rails Application in a Windows environment and I am trying to deploy into Linux Ubuntu 16.04. I am stumbling upon this error:
Your bundle only supports platforms ["x64-mingw32"] but your local
platforms are ["ruby", "x86_64-linux"] and there's no compatible match
between those two lists.
I think the problem is with gemfile.lock . in addition to seeing strings with 'x64-mingw32' for each gem; I find that there is also this:
PLATFORMS
x64-mingw32
How do I make my application run in a Linux 16.04 LTS Environment?
Your Gemfile.lock is restricting the platform your app can run on.
Deploying the app into Linux without the .lock file should resolve your issue.
If you have any Windows-specific gems in your Gemfile, its better to move them to a dedicated block:
# Gemfile
platform :mswin, :mingw, :x64_mingw do
gem "tzinfo-data"
gem "win32_api"
end
Capistrano requires the Gemfile.lock file for deployment. Bundler is the one that is causing this but according to their Github it is intented behaviour to make your app compatible with different platforms.
In order for this to work - as of 1.13, you could run bundle lock --add-platform ruby on Windows to add the ruby platform to your lockfile ahead of time.
Github Issue

How to install Hipchat Server on CentOS 6?

In my deep dive into the CentOS terminal, I was able to install and setup Jira, Confluence, and Bitbucket servers. However, the Hipchat Server seems to be based on something completely different.
Is there a step by step guide to installing Hipchat; From what's needed (dependencies) to installing (which I'm not even sure is part of the process) to seeing it work (log-in, etc.)?
Atlassian's official guide is written in such a way, that I look at it confused - as if it's a riddle that will never be solved. lol
By HipChat4, I'm assuming you refer to the HipChat Client. If so, have you tried the instructions outlined here?
sudo bash -c ‘cat > /etc/yum.repos.d/hipchat.repo << EOF_hipchat
[atlassian-hipchat]
name=Atlassian Hipchat
baseurl=https://atlassian.artifactoryonline.com/atlassian/hipchat-yum-client/
enabled=1
gpgcheck=0
EOF_hipchat’
sudo yum update
sudo yum install hipchat4
If what you're trying to install is the server, then keep in mind that HipChat Server is only supported on AWS (via the Atlassian provided AMI), or as a VM for private datacenters (via the Atlassian provided OVA). You can't install HipChat Server directly on a Linux box.
If your OS can run a virtualization platform (e.g. VirtualBox) then you can download the OVA from https://www.hipchat.com/server#get-hipchat-server, import it, start your VM and configure it. More thorough instructions are available here.

How to install a plugin in redmine 1.4.4 via SSH on redmine VM?

I have got access to redmine VM via SSH and have plugin files on my local machine. Now I need to install it in redmine.
Can anyone explain the steps to do it? I am using a windows 7 machine as SSH client.
You can use SFTP client such as WinSCP (Windows client that I uses) or find any other.
SFTP is SSH File Transfer Protocol, i.e. you will have access to VM's file system via SSH connection, and Redmine plugins installation will be just files copying :)
Also, SFTP clients can launch simple commands as touch (touch tmp/restart.txt command needed to restart Ruby on Rails applications)
Put the plugin directory in the vendor/plugins sub directory of your Redmine installation. Check the plugin installation instructions for any additional steps that might be necessary.
Redmine 1.4.4 is several years old, you should first make sure with a local test that the plugin actually works with that version. And you should really upgrade to a recent version of Redmine (current stable is 3.2) as there have been quite a few security issues in Rails and Redmine since 1.4.4 was released.

Can't install Jekyll on Mac - trying to set up Github Blog

I sucessfully installed Ruby, version 1.8.7 and have been trying to install Jekyll in the Terminal using sudo gem install jekyll. Here's the error I get:
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions into the /Library/Ruby/Gems/1.8 directory. unknown68a86d3f981e:~ srb_1974$ sudo gem install jekyll
Building native extensions. This could take a while... ERROR: Error
installing jekyll: ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
extconf.rb mkmf.rb can't find header files for ruby at
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h
Gem files will remain installed in
/Library/Ruby/Gems/1.8/gems/fast-stemmer-1.0.1 for inspection. Results
logged to
/Library/Ruby/Gems/1.8/gems/fast-stemmer-1.0.1/ext/gem_make.out
I've read a bunch of topics, but can't get anything to work. Many topics say I have to have XCode first, but it won't even download, much less install. I read that in Lion you have to set up another administrator and install it under that profile, so I did that, but the install package doesn't exist. It won't even download. I think this may be because I'm not a registered Apple Developer?
Another recommendation was that I install Ruby RVM - this also won't install. Here's the command I used: bash < <( curl https://rvm.beginrescueend.com/releases/rvm-install-head )
And here's the error I get:
% Total % Received % Xferd Average Speed Time Time Time
Current
Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:--
--:--:-- 0 curl: (60) SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL
routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed More
details here: http://curl.haxx.se/docs/sslcerts.html
curl performs SSL certificate verification by default, using a
"bundle" of Certificate Authority (CA) public keys (CA certs). If the
default bundle file isn't adequate, you can specify an alternate file
using the --cacert option. If this HTTPS server uses a certificate
signed by a CA represented in the bundle, the certificate
verification probably failed due to a problem with the certificate
(it might be expired, or the name might not match the domain name in
the URL). If you'd like to turn off curl's verification of the
certificate, use the -k (or --insecure) option. unknown68a86d3f981e:~
srb_1974$
I only care about Ruby RVM and XCode to the extent that I need them to install Jekyll. I'm just trying to get my Github blog going and I can't seem to do it. I've read and read and read documentation and there's something I'm missing. I'm pretty sure it's knowledge everyone's assuming I have - I don't. I'm a beginner programmer. Any help would be much appreciated.
Ok, here's how I got it to work. It was kind of a random experimentation process until something worked.
I installed XCode and Ruby RVM per others' suggestions and the latter led to my resolution. One of the suggestions on this page said to run "rvm requirements" and read the text. It basically tells you what you need to run & upgrade rubies. This documentation was quite helpful. It explained that what I needed to install Jekyll wasn't really XCode - it was GCC. Evidently, older versions of XCode came with GCC, but newer versions do not, which is why installing XCode didn't solve my problem. It also directed me to where I could download & install GCC, warning me that installing GCC over a newer version of XCode is known to cause problems. So, I uninstalled XCode & headed over here to install GCC.
It was that simple - I installed GCC and Jekyll installed in seconds.
ERROR: Error installing jekyll: ERROR: Failed to build gem native extension.
So the error is "Failed to build gem native extension." when you run sudo gem install jekyll command. You'll find a tip in Jekyll Wiki's Install section:
If you encounter errors like Failed to build gem native extension on Windows you may ...
On OSX, you may need to update RubyGems:
$ sudo gem update --system
So, try to update your RubyGems and run sudo gem install jekyll after that. And I think you don't need to install ruby rvm if you're not a ruby developer.
Btw, I think Ruby v1.9.1 is a recommended version.
And for your Xcode related question, you can download it from App Store though you're not a registered Apple developer. It's free.
Xcode is useful when you need to build some libs with gcc (gcc will be installed together after you've installed the Xcode). But I've no idea whether you'll need it when you install the jekyll.
I tried all the solutions above and did not work. I posted my answer here originally:
RVM requirements error
but for brevity, this is what I posted:
It seems that on OSX 10.9 and XCode5 moved some libs around on us. So I had to install XCode5-DP6 (Dev Preview 6), opened up DP6 and in the settings, you have to tell the command line tools to use the new DP6 build and not the Standard XCode from the marketplace.
First, I had to install homebrew. Nothing liked to play with macports. I am on my first mac as of only a month ago, so macports was just what solved apache for me at the time. I then had to run 'brew install autoconf'
Once I did that I then ran rvm requirements, everything installed without issue. then sudo gem install jekyll from there and it all works like a charm now.
I'm sure once Mavericks is actually released this will get ironed out. We are using early releases after all...
Same issue encountered! After reading this article and random experimentation like following,
xcode install
curl -sSL https://get.rvm.io | bash
sudo gem install jekyll
fixed the issue and could successfully install jekyll