Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible issue with Ruby 2.2? #31

Closed
rdscorreia74 opened this issue Jan 13, 2015 · 14 comments · Fixed by #33
Closed

Possible issue with Ruby 2.2? #31

rdscorreia74 opened this issue Jan 13, 2015 · 14 comments · Fixed by #33
Labels

Comments

@rdscorreia74
Copy link
Contributor

@tdobrovolskij
Hi Tad.
I'm installing Sanguinews to a brand new Archlinux box.
Here are some error messages when I try to run Sanguinews after I finish installing it.

[root@dock-clone ~]# gem install sanguinews
WARNING: You don't have /root/.gem/ruby/2.2.0/bin in your PATH,
gem executables will not run.
Building native extensions. This could take a while...
Successfully installed sanguinews-0.70
Parsing documentation for sanguinews-0.70
Installing ri documentation for sanguinews-0.70
Done installing documentation for sanguinews after 4 seconds
1 gem installed
[root@dock-clone ~]# /root/.gem/ruby/2.2.0/bin/sanguinews
/root/.gem/ruby/2.2.0/gems/sanguinews-0.70/lib/sanguinews.rb:148: warning: duplicated key at line 151 ignored: :prefix
/usr/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in require': cannot load such file -- bundler/setup (LoadError) from /usr/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:inrequire'
from /root/.gem/ruby/2.2.0/gems/sanguinews-0.70/lib/sanguinews.rb:20:in <top (required)>' from /usr/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:inrequire'
from /usr/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in require' from /root/.gem/ruby/2.2.0/gems/sanguinews-0.70/bin/sanguinews:2:in<top (required)>'
from /root/.gem/ruby/2.2.0/bin/sanguinews:23:in load' from /root/.gem/ruby/2.2.0/bin/sanguinews:23:in

'

Could this be a Ruby 2.2 issue?
Or did I miss something when I was installing? GCC is there. Not sure about Ruby headers though...
Cheers

@rdscorreia74 rdscorreia74 changed the title Issue with Ruby 2.2 Possible issue with Ruby 2.2? Jan 13, 2015
@tdobrovolskij
Copy link
Owner

I guess that you have installed ruby via rvm and forgot about the last step:

source ~/.rvm/scripts/rvm

@rdscorreia74
Copy link
Contributor Author

Hi Tad.
In fact I installed ruby via package manager.

EDIT:
Actually, after installing Arch I installed base-devel, gcc and ruby.
pacman -S base-devel gcc ruby

@tdobrovolskij
Copy link
Owner

I can say you that it's definitely not 2.2 version's fault.

$ ruby -v
ruby 2.2.0preview1 (2014-09-17 trunk 47616) [x86_64-darwin14]

$ gem install sanguinews
Fetching: parseconfig-1.0.6.gem (100%)
Successfully installed parseconfig-1.0.6
Fetching: nzb-0.2.2.gem (100%)
Successfully installed nzb-0.2.2
Fetching: speedometer-0.1.2.gem (100%)
Successfully installed speedometer-0.1.2
Fetching: sanguinews-0.70.gem (100%)
Building native extensions.  This could take a while...
Successfully installed sanguinews-0.70
Parsing documentation for parseconfig-1.0.6
Installing ri documentation for parseconfig-1.0.6
Parsing documentation for nzb-0.2.2
Installing ri documentation for nzb-0.2.2
Parsing documentation for speedometer-0.1.2
Installing ri documentation for speedometer-0.1.2
Parsing documentation for sanguinews-0.70
Installing ri documentation for sanguinews-0.70
Done installing documentation for parseconfig, nzb, speedometer, sanguinews after 0 seconds
4 gems installed

$ sanguinews
You need to specify something to upload!
Usage: sanguinews [OPTIONS] [DIRECTORY] | -f FILE1..[FILEX]

Options
    -c, --config CONFIG              use different config file
    -C, --check                      check headers while uploading; slow but reliable
    -f, --file FILE                  upload FILE, treat all additional parameters as files
    -g, --groups GROUP_LIST          use these groups(comma separated) for upload
    -h, --help                       help
    -p, --password PASSWORD          use PASSWORD as your password(overwrites config file)
    -r, --recursive                  process all files under each directory recursively
    -u, --user USERNAME              use USERNAME as your username(overwrites config file)
    -v, --verbose                    be verbose?
    -V, --version                    print version information and then exit

I have never used ArchLinux so I am not familiar with distro specific things there, but I see that there is something wrong with your installation.

@rdscorreia74
Copy link
Contributor Author

Hmmm this here is:
ruby 2.2.0p0 (2014-12-25 revision 49005) [i686-linux]

@rdscorreia74
Copy link
Contributor Author

I don't know where to take this. To ruby forums? To Archlinux forums? What would you do if you were in my shoes?
Thanks

@tdobrovolskij
Copy link
Owner

Try

export PATH="$PATH:/root/.gem/ruby/2.2.0/bin"

If this doesn't help, try installing ruby-headers package. I have no more ideas at the moment.

@rdscorreia74
Copy link
Contributor Author

I already have ruby in the path.
As for ruby-headers, that's an AUR package and I would have to compile it because it doesn't come pre-compiled. I'll try to compile it tonight.
Is ruby-headers really necessary? I mean, is there an alternative to ruby-headers? Because if Archlinux community didn't find they needed to provide a pre-compiled binary package of ruby headers I would assume that it's need is very unusual.
Will let you know later after I compile ruby headers from AUR.
Thanks in advance :)

@tdobrovolskij
Copy link
Owner

This path is not for ruby, it's for gem binaries, so you won't need to specify full path to sanguinews and would be able to just run "sanguinews". Most highly likely is that something is wrong with your path, I'm just not sure what exactly. So that's why I would dig in this direction in your place.

As for ruby-headers, maybe they are provided in some other way in ArchLinux, but they are definitely needed to compile C ruby extensions.

@rdscorreia74
Copy link
Contributor Author

http://irclog.whitequark.org/ruby/2015-01-14
Someone on IRC is telling me that bundler might be needed?

@bradland
Copy link
Contributor

Tangential to this issue (because his stack trace complains about it), it appears that require 'bundler/setup' is called in lib/sanguinews.rb#L20, but bundler is not listed as a dep in the gemspec, so it is not installed along with sanguinews.

@bradland
Copy link
Contributor

Ok, so actually, it's not tangential, haha :) The issue is the un-spec'd bundler dep. The duplicate key line is just a warning from 2.2 (which is a new feature btw) about a duplicate key in lib/sanguinews.rb on lines 148 and 151 (the key/value prefix: @config.prefix is specified twice). The actual error starts with the line:

/usr/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in require': cannot load such file -- bundler/setup (LoadError) from /usr/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:inrequire'

That error results from a lack of the bundler gem, which results from a lack of dependency specification. Although, I don't see any references to the Bundler constant anywhere else in the app, so I'm not sure if there is actually a bundler dependency within the app at all, or if it's just there because bundler is being used in development.

@tdobrovolskij
Copy link
Owner

Ok, thank you for your input, Brad. I guess that bundler as a requirement is a left-over from earlier stages of development, because I can't find where it would be needed now. I will test it and remove it if it's the case.

@rdscorreia74
Copy link
Contributor Author

Hi bradland.
Thanks for your input on the subject.
After installing bundler on my system I can say that now sanguinews runs :D
I still get a duplicate line message but I guess that can be easily fixed with bradland's contribution.
/root/.gem/ruby/2.2.0/gems/sanguinews-0.70/lib/sanguinews.rb:148: warning: duplicated key at line 151 ignored: :prefix

@tdobrovolskij
Copy link
Owner

The problem is fixed now. @bradland thank you once again for your contribution and thank you, @john3voltas , for bringing it up. I have uploaded the updated gem to rubygems.org.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants