I'm trying to install Gitlab with omnibus package for Debian 7. Gitlab is running but it's very slow. Tail logs showed me, that unicorn process timeouts because get requests for assets timing out.
I read somewhere that I have to perform bundle exec rake assets:precompile RAILS_ENV=production but bundle command not found. Also, git command not found. Does omnibus package install ruby and git or I should do it manually? I couldn't find ruby or git in usr/bin or somewhere else.
The syntax bundle exec rake some_task is available for the normal GitLab installation, where you install all components manually.
With GitLab omnibus you can use gitlab-rake some_task. It will automatically use the GitLab's internal ruby installation, internal bundle etc.
Related
I am looking for advice on how to correctly setup Ruby/RVM for use with Jenkins. When running Jenkins builds it runs them as Jenkins and I would like to be able to run builds with things like
gem install gemName
Without getting a you do not have permission to write to /Library/Ruby/Gems for example.
Currently this folder is owned by root wheel which explains why Jenkins does not have permission.
What is the best way to set this up? Do I just change the permission on the folder?
I also find myself running builds with
withEnv(['PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:$PATH']) {
sh '''npm install
grunt build
gem install gemName
'''
}
Which feels like a bit of a workaround to not setting up my environment correctly ?
One thing I noticed is your not telling Jenkins what rvm gemset you want to use. You also need to set the she-bang.
withEnv(['PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:$PATH') {
sh '''#!/bin/bash -l
rvm use 2.3.3#gemset --create
npm install
grunt build
gem install bundler
bundle install
```
}
Is it possible to run the bundle viz command excluding gems from a specific group (usually the production one)?
Running bundle viz --without production does not work, so the syntax appears somehow different from the one of bundle install.
This was recently added, but it hasn't been released yet. See https://github.com/bundler/bundler/pull/3050
You can try cloning the Bundler git repository and running it from master. The easiest way to do that is to set up a shell alias to run bundle from your clone, as described in https://github.com/bundler/bundler/blob/master/DEVELOPMENT.md#development-setup
I have set up my aws environment succesfully. However i am having one probelem. In my Gemfile i have the following line:
gem 'activeadmin', :github => 'gregbell/active_admin'
When i do a git aws.push i can see the following error in the aws logs:
/usr/local/share/ruby/gems/2.0/gems/bundler-1.3.5/lib/bundler/source/git.rb:177:in `rescue in load_spec_files': git://github.com/gregbell/active_admin.git (at master) is not checked out. Please run `bundle install` (Bundler::GitError)
I was able to fix that problem by creating this file: .ebextensions/ruby.config
option_settings:
- option_name: BUNDLE_DISABLE_SHARED_GEMS
value: "1"
- option_name: BUNDLE_PATH
value: "vendor/bundle"
packages:
yum:
git: []
This packages everything into vendor/bundle and my app starts correctyl.
However I have two problems with this approach:
It takes very long to deploy because it needs to install all gems every time
I am not longer able to execute commands when I ssh into the EC2 instance. For example I have to start an rpush deamon. Locally this works with bundle exec rpush development but on EC2 this results in:
bundle exec rpush
/usr/local/share/ruby/gems/2.0/gems/bundler-1.3.5/lib/bundler.rb:284: warning: Insecure world writable dir /var/app/current/vendor/bundle/bin in PATH, mode 040777
git://github.com/gregbell/active_admin.git (at master) is not checked out. Please run bundle install
Is there an other way for installing the gems correctly and at the same time using the system gems? Or if that is not possible, how can I start rpush when the gems are bundled?
Update your Gemfile.lock (bundle install&& bundle update) in your local env. and push a commit with Gemfile and Gemfile.lock. Deploy to AWS again.
Can you check if using gem 'activeadmin', 'git://github.com:gregbell/active_admin' in your Gemfile works for you?
You can also get faster deployments utilizing vendor/cache by following the instructions given here:
http://blogs.aws.amazon.com/application-management/post/Tx2XVRWSS4E971S/Locally-Packaging-Gem-Dependencies-for-Ruby-Applications-in-Elastic-Beanstalk
What solved my problem: I modified the bundle install script and added the --deployment flag
Using openSUSE and Ubuntu with installed dependencies I can't clone the remote repository with Rugged::Repository.clone_at method and getting the error message:
Rugged::NetworkError: This transport isn't implemented. Sorry
The code:
credentials = Rugged::Credentials::SshKey.new(:privatekey=>'path/to/privatekey', :publickey=>'path/to/publickey', :passphrase=>'passphrase')
Rugged::Repository.clone_at 'ssh://github.com/vmoravec/repo', 'dir/to/destination', :credentials => credentials
My Gemfile for a rails project contais reference to the github repo like this:
gem 'rugged', git: 'git://github.com/libgit2/rugged.git', branch: 'development', submodules: true
The gem has been installed with command bundle install --path bundle/
The cloning does not work even with using bundle exec rails console
Installed system packages:
libssh2, libssh2-devel
openssl, libopenssl-devel, libopenssl
There is already similar question asked here on SO, but the solution does not work (although it's for MacOS I think): Getting Rugged::NetworkError on #connect
Removing the bundle/ directory and reinstalling the gems with bundle install --path bundle/ resolved the issue on both systems. It seems that the build system was not able for some reasons to detect the /usr/lib64/libssh2.so.1 dependency required for ssh transport. Carlos, thanks for the hint to use ldd rugged.so to check that.
I'm trying to install the gem 'taglib-ruby' on Heroku. This gem compiles as a native extension which requires a system dependency called taglib, so after compiling and uploading it through heroku vulcan, I achieved to compile the gem via command line on heroku bash:
bundle exec gem install taglib-ruby -- --with-opt-dir=/app/vendor/taglib
And in order to this parameter would be used by bundler later, I added it as a bundler configuration through the command:
bundle config build.taglib-ruby '--with-opt-dir=/app/vendor/taglib'
I've already verified this config was applied, inspecting the file /.bundle/config and looking for the line BUNDLE_BUILD__TAGLIB-RUBY.
However after pushing out my project to heroku and while it is executing the bundle install command, heroku complains that the above gem (taglib-ruby) cannot be installed due the taglib library isn't present, although it's what I was trying to solve with the option '--with-opt-dir=/app/vendor/taglib' mentioned above.
So it appears that Heroku is ignoring the bundler configuration.
What could be happening? Do you know another way the achieve the same intention (install a gem with custom build options) on Heroku?