Closed NeilW closed 6 years ago
ruby -v ruby 1.9.3p484 (2013-11-22 revision 43786) [x86_64-linux]
Can you try that again, setting the environment variable DEBUG
when calling methadone? Just to make sure the exception is coming from bundler?
Also, what version of RubyGems?
I don't have the ability to provision a machine cleanly as you have to try any of this. I added that specific verison of Ruby the the .travis.yml
file to see if there's something there.
ubuntu@srv-m59eb:~$ DEBUG=1 methadone --log-level=debug --readme --rspec --license gplv3 app_name
Creating project for gem app_name
Executing 'bundle gem app_name --no-color'
stdout output of 'bundle gem app_name --no-color': create app_name/Gemfile
create app_name/Rakefile
create app_name/LICENSE.txt
create app_name/README.md
create app_name/.gitignore
create app_name/app_name.gemspec
create app_name/lib/app_name.rb
create app_name/lib/app_name/version.rb
Initializing git repo in /home/ubuntu/app_name
Invalid gemspec in [app_name.gemspec]: undefined method `prerelease?' for "0.0.1":String
(erb):1:in `render_license_partial': undefined method `name' for nil:NilClass (NoMethodError)
from /usr/lib/ruby/1.9.1/erb.rb:838:in `eval'
from /usr/lib/ruby/1.9.1/erb.rb:838:in `result'
from /var/lib/gems/1.9.1/gems/methadone-1.8.0/lib/methadone/cli.rb:102:in `render_license_partial'
from (erb):1:in `result'
from /usr/lib/ruby/1.9.1/erb.rb:838:in `eval'
from /usr/lib/ruby/1.9.1/erb.rb:838:in `result'
from /var/lib/gems/1.9.1/gems/methadone-1.8.0/lib/methadone/cli.rb:81:in `block in copy_file'
from /var/lib/gems/1.9.1/gems/methadone-1.8.0/lib/methadone/cli.rb:80:in `open'
from /var/lib/gems/1.9.1/gems/methadone-1.8.0/lib/methadone/cli.rb:80:in `copy_file'
from /var/lib/gems/1.9.1/gems/methadone-1.8.0/bin/methadone:60:in `block in <top (required)>'
from /var/lib/gems/1.9.1/gems/methadone-1.8.0/lib/methadone/main.rb:386:in `call'
from /var/lib/gems/1.9.1/gems/methadone-1.8.0/lib/methadone/main.rb:386:in `call_main'
from /var/lib/gems/1.9.1/gems/methadone-1.8.0/lib/methadone/main.rb:163:in `go!'
from /var/lib/gems/1.9.1/gems/methadone-1.8.0/bin/methadone:112:in `<top (required)>'
from /usr/local/bin/methadone:23:in `load'
from /usr/local/bin/methadone:23:in `<main>'
ubuntu@srv-m59eb:~$ gem --version 1.8.23
That version of RubyGems is over 2.5 years old—is there any way you can use a more recent version?
The bug is coming from RubyGems. The line of code in Methadone is during generation of the license file:
Name: <%= gemspec.name %><%#TODO: Get program name more efficiently -%>
Which calls gemspec
:
def gemspec
@gemspec || @gemspec=_get_gemspec
end
private
def _get_gemspec
files=Dir.glob("*.gemspec")
raise "Multiple gemspec files" if files.size>1
raise "No gemspec file" if files.size < 1
Gem::Specification::load(files.first) # <---- this is where it's blowing up
end
So, it's not a bundler issue.
If you have to use the given version of RubyGems, you can work around this by generating your app without a license and then adding one manually.
I do think it's reasonable for methadone to not pass bugs in core libraries onto you, the user.
That version of gem is the one that is installed by the OS packages on Ubuntu Trusty - which is a Long Term Support release and will be with us until 2019.
The Ruby community approach of upgrading everything all the time is somewhat frowned upon by the sysadmins who prefer stability.
Of course I've worked around it for what I'm doing, but I thought you'd want to know. Hopefully the run version of the tool I'm building using methadone won't hit any 'ancient ruby' problems.
Yeah, totally get that approach (which is why I've tried to make this and GLI support/not-break on 1.8.7 for as long as I could).
I'll keep this open as a bug, and thanks for all the details figuring it out!
Closing as old/won't fix. This is 4+ years old and I only have bandwidth to support supported rubies.
The bundle gem command fails when run via methadone, but doesn't when run on its own.
Step to reproduce:
Which gives: Creating project for gem app_name Executing 'bundle gem app_name --no-color' stdout output of 'bundle gem app_name --no-color': create app_name/Gemfile create app_name/Rakefile create app_name/LICENSE.txt create app_name/README.md create app_name/.gitignore create app_name/app_name.gemspec create app_name/lib/app_name.rb create app_name/lib/app_name/version.rb Initializing git repo in /home/ubuntu/app_name Invalid gemspec in [app_name.gemspec]: undefined method
prerelease?' for "0.0.1":String undefined method
name' for nil:NilClassYet running the command on the command prompt gives:
ubuntu@srv-t787y:~$ bundle gem app_name --no-color create app_name/Gemfile create app_name/Rakefile create app_name/LICENSE.txt create app_name/README.md create app_name/.gitignore create app_name/app_name.gemspec create app_name/lib/app_name.rb create app_name/lib/app_name/version.rb Initializing git repo in /home/ubuntu/app_name ubuntu@srv-t787y:~$