Gitorious: git-poller won't start - ruby

I just installed a fresh gitorious on my server and wanted to test it when I found out that the git-poller didn't run. And it also didn't want to start.
I followed this guide: http://gitorious.org/gitorious/pages/DebianSqueezeInstallation, my system is Debian Squeeze and Ruby -v says ruby 1.8.7
Everything from that guide works so far. The system is up and running but I can't start the poller. All the poller writes into the logs is the following:
tmp/pids/poller.log
*** below you find the most recent exception thrown, this will be likely (but not certainly) the exception that made the application exit abnormally ***
#<MissingSourceFile: no such file to load -- user_auto_completions_helper>
*** below you find all exception objects found in memory, some of them may have been thrown in your application, others may just be in memory because they are standard exceptions ***
#<NoMemoryError: failed to allocate memory>
#<SystemStackError: stack level too deep>
#<fatal: exception reentered>
#<LoadError: no such file to load -- daemons>
#<TypeError: Expected a filter, an endpoint, a callable or a list of any of these.>
#<NameError: uninitialized constant ActiveMessaging>
#<MissingSourceFile: no such file to load -- user_auto_completions_helper>
tmp/pids/poller.output
/home/clients/client1/web85/web/vendor/rails/activesupport/lib/active_support/dependencies.rb:443:in `load_missing_constant': uninitialized constant ActiveMessaging (NameError)
from /home/clients/client1/web85/web/vendor/rails/activesupport/lib/active_support/dependencies.rb:80:in `const_missing'
from /home/clients/client1/web85/web/vendor/rails/activesupport/lib/active_support/dependencies.rb:92:in `const_missing'
from /home/clients/client1/web85/web/lib/gitorious/messaging/stomp_poller.rb:13
from /var/lib/gems/1.8/gems/daemons-1.1.0/lib/daemons/application.rb:203:in `load'
from /var/lib/gems/1.8/gems/daemons-1.1.0/lib/daemons/application.rb:203:in `start_load'
from /var/lib/gems/1.8/gems/daemons-1.1.0/lib/daemons/application.rb:292:in `start'
from /var/lib/gems/1.8/gems/daemons-1.1.0/lib/daemons/controller.rb:70:in `run'
from /var/lib/gems/1.8/gems/daemons-1.1.0/lib/daemons.rb:143:in `run'
from /var/lib/gems/1.8/gems/daemons-1.1.0/lib/daemons/cmdline.rb:112:in `call'
from /var/lib/gems/1.8/gems/daemons-1.1.0/lib/daemons/cmdline.rb:112:in `catch_exceptions'
from /var/lib/gems/1.8/gems/daemons-1.1.0/lib/daemons.rb:142:in `run'
from script/poller:30
I'm using ispconfig as a webserver management tool, that's where the weird paths are from. I changed all paths from the howto to fit, tho.
Anybody got an idea? I can provide more material if needed, but I just don't know what could be usefull. This is my first question on stackoverflow so please don't shoot me if I didn't do everything right :)

After a lot of reading and trial and error (I started about 3 times from scratch, trying Ruby 1.9.2 and REE both from source and with RVM) I tried another howto[1] which had one big difference to the first one: It suggested downloading and installing Rubygems 1.4.2 instead of the apt-version of Rubygems.
At first I didn't want to do that because I was afraid that it would break my system (there are a lot of other things running on that server, including Redmine) which it did, but after I re-installed all missing gems everything worked again.
Now everything (Gitorious and Redmine) is working with apt-version of Ruby 1.8.7 and the non-apt-version of Rubygems 1.4.2.
[1] http://cjohansen.no/en/ruby/setting_up_gitorious_on_your_own_server/
Since I stumbled upon another, hopefully last problem:
I installed gitorious for my standard web user (in order to respect ISPConfig's policy) and made a new git-user for the repositories. To be able to exchange data I added both to the same usergroup and fixed the permissions.
The problem I ran into was that the git poller added new repositories for his own, that means "git:git" instead of "git:sharedgroup". To fix this you just have to set the default group id for the git-folder (/var/git in my case):
chgrp -R <group_name> /var/git
chmod -R g+s /var/git
It appears that the two commands above did work but adding a new project broke everything again because the git-poller added a folder for the project and the repository which resulted in the repository-folder having the wrong owner again.
I (hopefully) fixed that with changing my /etc/init.d/git-poller script from
/bin/su - git -c "cd /var/www/git.mydomain.com/web;RAILS_ENV=production script/poller $#"
to
/bin/su - git -c "newgrp <group_name> && cd /var/www/git.mydomain.com/web;RAILS_ENV=production script/poller $#"

Related

Exception Load Errors, for files that exist (even in multiple places?)

I am finding these errors (via debug) and don't understand why I'm getting them. I'm not sure if I have duplicate files for a reason either. I'm using .rvm and it has a gems directory with a ruby directory inside of it, but there is also .rvm/rubies/ruby-'version' directory. I was trying to find some info about the ruby and gem folder structure but so far haven't had much luck.
In other words maybe it's possible I have multiple versions of Ruby or something isn't right?
Example rubygems.rb
Exception `LoadError' at /home/vagrant/.rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/rubygems.rb:1346 - cannot load such file -- rubygems
defaults/operating_system
**Yet I did a find the file**
./vagrant/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/rubygems.rb
./vagrant/.rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/rubygems.rb
./vagrant/.rvm/rubies/ruby-2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.0/lib/bundler/plugin/installer/rubygems.rb
./vagrant/.rvm/rubies/ruby-2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.0/lib/bundler/source/rubygems.rb
./vagrant/.rvm/gems/ruby-2.4.1/gems/bundler-1.15.1/lib/bundler/plugin/installer/rubygems.rb
./vagrant/.rvm/gems/ruby-2.4.1/gems/bundler-1.15.1/lib/bundler/source/rubygems.rb
./vagrant/.rvm/gems/ruby-2.4.1/gems/rubygems-update-2.6.12/bundler/lib/bundler/plugin/installer/rubygems.rb
./vagrant/.rvm/gems/ruby-2.4.1/gems/rubygems-update-2.6.12/bundler/lib/bundler/source/rubygems.rb
./vagrant/.rvm/gems/ruby-2.4.1/gems/rubygems-update-2.6.12/lib/rubygems.rb
vagrant#vagrant:/home$
Here is one for kernel_require.rb
Exception `LoadError' at /home/vagrant/.rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55 - cannot load
such file -- sinatra
Yet Sinatra was running
here are the kernel_requires
./vagrant/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb
./vagrant/.rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb
./vagrant/.rvm/gems/ruby-2.4.1/gems/rubygems-update-2.6.12/lib/rubygems/core_ext/kernel_require.rb
At first I thought there was another Ruby -v not being managed however I went through the RVM structure and see no discrepancies.
Anyone interested in seeing the directory structure (it wasn't on RVM site), I found it here.
It then came down to my load errors. I found a post in Ruby trunk issues that said load error, no file found for rubygems.rb was normal, if you are running debug. I believe it is looking at outside sources of rubygems?.
The last issue was syntax errors for /forwardable/impl.rb. This was because, again debug was set. Now I'm not entirely sure what the message means, but the line referenced, 6, is 'resue SyntaxError'.
So I learned a bit more using RVM , gems and some on bundler. Side note, I was able to use bundle exec on the Sinatra app.

Why did my minitest/pride alias break?

Silly, cosmetic question for everyone.
I take pride in my testing. That is, I like to use minitest/pride. Unfortunately, not everyone on my team is a fan, so I have activated it in the past using the command line instead of modifying the code by setting an alias to this:
RUBYOPT=-rminitest/pride bex rake`
(bex is an alias to bundle exec, and the default rake task runs our tests.)
Recently, we updated the ruby version of our project from 1.9.3 to 2.2.0. This has broken my alias, and now when I try to run it, I get this error instead:
/Users/cf5455/.rubies/ruby-2.2.0/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- minitest/pride (LoadError)
from /Users/cf5455/.rubies/ruby-2.2.0/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
My best guess as to why this is happening is that MiniTest was changed since our last Ruby version and pride has been renamed or moved, but I have not been successfully able to Google its new name or location.
Does someone know a way that I can fix my arguments to get pride working again?
Duplicated your error by switching to ruby 2.3.0. I just ran the tests before installing any gems.
I managed to get the tests running with your alias by simply doing a gem minitest install. Not sure if your problem is caused by the same reason since I'm using rbenv for managing my rubies and gems but it does feel like you are having a package management issue. Hope this helps.

Pushing Gem to Hosted Credentialed Feed Is Failing

I'm trying to push a gem to hosted Artifactory and am encountering problems every step of the way.
My environment is:
Operating System: Windows 7 x64 Professional
Ruby: ruby 1.9.3p545
I had to do a trick with cacert.pem to add the artifactory url to my list of sources, but that part is working now. The next step in Artifactory documentation is to get an api key and pipe it to ~/.gem/credentials.
When I do that the api key downloads successfully, but gem completely breaks.
gem
C:/ruby193/lib/ruby/1.9.1/psych.rb:203:in `parse': (<unknown>): control characters are not allowed at line 1 column 1 (Psych::SyntaxError)
from C:/ruby193/lib/ruby/1.9.1/psych.rb:203:in `parse_stream'
from C:/ruby193/lib/ruby/1.9.1/psych.rb:151:in `parse'
from C:/ruby193/lib/ruby/1.9.1/psych.rb:127:in `load'
from C:/ruby193/lib/ruby/site_ruby/1.9.1/rubygems/config_file.rb:253:in `load_file'
from C:/ruby193/lib/ruby/site_ruby/1.9.1/rubygems/config_file.rb:223:in `load_api_keys'
from C:/ruby193/lib/ruby/site_ruby/1.9.1/rubygems/config_file.rb:208:in `initialize'
from C:/ruby193/lib/ruby/site_ruby/1.9.1/rubygems/gem_runner.rb:78:in `new'
from C:/ruby193/lib/ruby/site_ruby/1.9.1/rubygems/gem_runner.rb:78:in `do_configuration'
from C:/ruby193/lib/ruby/site_ruby/1.9.1/rubygems/gem_runner.rb:51:in `run'
I can't even use gem as long as the credentials file is there, so I have to remove it.
If I try to push without the credentials file and using the --host option, gem seems to ignore the --host options.
gem push .\my_gem-0.0.1.0.beta.gem --host $artifactory.source
Enter your RubyGems.org credentials.
Don't have an account yet? Create one at http://rubygems.org/sign_up
Email:
Password:
Pushing gem to https://rubygems.org...
HTTP Basic: Access denied.
This is a proprietary gem, so publishing to rubygems.org is NOT an option. There definitely seems to be a problem with my environment, but I've been unable to figure out what it is--and none of the other documentation of SO questions seem to be on point.
I know that I'm going to need to get gem to read the credentials file to push successfully, but it seems like a more basic issue that gem is ignoring the --host parameter.
It took a lot of effort, but I think I've resolved my issues. It was a problem in 2 parts.
Solution Part 1
With respect to the issue of gem ignoring the --host option, this is resolved by updating gem.
Apparently the version of gem that ships with ruby 1.9.3v545 on Windows is broken. After updating gem it acted like it was trying to upload to the correct url.
Solution Part 2
The second issue involves a corrupted credentials file. What's happening here is that when piping the output from the curl command into the credentials file, the credentials file is being encoded with Unicode. To resolve this I used a slightly different curl command (in powershell)
curl $url | Out-File ~/.gem/credentials -Encoding "ASCII"
Now I'm able to upload the gem successfully.
If the SSL_CERT_FILE environment variable trick doesn't work, you can also try editing your .gemrc file as follows:
:ssl_ca_cert: C:\\path\\to\\cacert.pem

Running Bundler on Windows - permission denied on /dev/null

I'm trying to set up a Ruby dev environment on Windows. So far it's fairly "vanilla", that is, it pretty much only consists of Ruby (1.9.1), Bundler (1.3.5) and a few random gems.
Now, whenever I try to run Bundler, I get the following exception:
C:/Ruby19/lib/ruby/1.9.1/rubygems/user_interaction.rb:544:in `initialize': Permission denied - /dev/null (Errno::EACCES)
Checking the source code, I found that Bundler determines that you're running Windows by trying to access /dev/null and then rescuing Errno::ENOENT ("No such file or directory"). I tried patching it to also rescue Errno:EACCES ("Permission denied"), and voila - it seems to run just fine.
I tried running the shell in elevated mode, but it still threw Errno:EACCES.
My question is simply this: Am I missing something? Or is this a bug in Bundler?
(for reference, I'm running on Windows 8)
/dev/null is a special file and is typically used for disposing of unwanted output streams of a process, or as a convenient empty file for input streams in *nix operating systems. It's not there in Windows.
If bundler is not checking on which operating system it's trying to use /dev/null then surely it's a problem at their end. To get things working without moving much you can use Cygwin.
I'm running on Windows 7.
I'v observed the issue "Errno:EACCES ("Permission denied")" for c:/dev/null
The directory c:/dev created (no "null" file) and problem resolved.

Error at the end of Installation of Ruby 2.0.0 on Mac Mountain Lion, also no mysql.sock file

I am a total noob to Ruby and Rails, so any help is appreciated about this.
I installed Ruby 2.0.0 using RVM. It got most of the way through, when I got this error message:
Error running 'env GEM_PATH=/Users/victoriamielke/.rvm/gems/ruby-2.0.0-p0:/Users/victoriamielke/.rvm/gems/ruby-2.0.0-p0#global:/Users/victoriamielke/.rvm/gems/ruby-2.0.0-p0:/Users/victoriamielke/.rvm/gems/ruby-2.0.0-p0#global GEM_HOME=/Users/victoriamielke/.rvm/gems/ruby-2.0.0-p0 /Users/victoriamielke/.rvm/rubies/ruby-2.0.0-p0/bin/ruby -d /Users/victoriamielke/.rvm/src/rubygems-2.0.3/setup.rb --verbose',
please read /Users/victoriamielke/.rvm/log/ruby-2.0.0-p0/rubygems.install.log
Installation of rubygems did not complete successfully.
I also opened up rubygems.install.log, and it said near the end:
ERROR: While executing gem ... (NoMethodError)
undefined method `fu_stream_blksize' for #<Gem::Commands::SetupCommand:0x007fcab29f5838>
What caused the failure of Rubygems to install?
Another problem am having is the error message ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2). I tried a Google search on this, which said I needed to find the mysql.sock file. Well, I have never found this file on my computer and could not find out in plain English how to add it or generate it.
Looks like the installation error is a recent known issue. If you're a beginner I recommend using Ruby 1.9.3, since 2.0.0 is brand new and you'll certainly find bugs in both the language implementation and libraries that haven't been tested on 2.0.0 yet.
The second issue is unrelated. It could be that you haven't started MySQL (did you run mysql.server start?), file permissions, MySQL configuration, or any number of other issues. You're not supposed to create /tmp/mysql.sock yourself, it's created automatically by MySQL. Please open a separate question about it.

Resources