Skip to content

Loading…

loading issues #6

Closed
rkh opened this Issue · 5 comments

4 participants

@rkh
~/Workspace/sinatra-contrib (git: master) ❷ gem install laser --prerelease
Fetching: ripper-plus-1.3.0.gem (100%)
Fetching: axiom_of_choice-1.0.0.gem (100%)
Fetching: stream-0.5.gem (100%)
Fetching: object_regex-1.0.1.gem (100%)
Fetching: trollop-1.16.2.gem (100%)
Fetching: laser-0.7.0.pre1.gem (100%)
Building native extensions.  This could take a while...
Successfully installed ripper-plus-1.3.0
Successfully installed axiom_of_choice-1.0.0
Successfully installed stream-0.5
Successfully installed object_regex-1.0.1
Successfully installed trollop-1.16.2
Successfully installed laser-0.7.0.pre1
6 gems installed
~/Workspace/sinatra-contrib (git: master) ❷ laser --help
/Users/konstantin/.rvm/gems/ruby-1.9.2-p290/gems/laser-0.7.0.pre1/lib/laser.rb:26:in `require': no such file to load -- treetop (LoadError)
    from /Users/konstantin/.rvm/gems/ruby-1.9.2-p290/gems/laser-0.7.0.pre1/lib/laser.rb:26:in `<top (required)>'
    from /Users/konstantin/.rvm/gems/ruby-1.9.2-p290/gems/laser-0.7.0.pre1/bin/laser:6:in `require'
    from /Users/konstantin/.rvm/gems/ruby-1.9.2-p290/gems/laser-0.7.0.pre1/bin/laser:6:in `<top (required)>'
    from /Users/konstantin/.rvm/gems/ruby-1.9.2-p290/bin/laser:19:in `load'
    from /Users/konstantin/.rvm/gems/ruby-1.9.2-p290/bin/laser:19:in `<main>'
~/Workspace/sinatra-contrib (git: master) ❷ gem install treetop
Fetching: treetop-1.4.10.gem (100%)
Successfully installed treetop-1.4.10
1 gem installed
~/Workspace/sinatra-contrib (git: master) ❷ laser --help
/Users/konstantin/.rvm/gems/ruby-1.9.2-p290/gems/laser-0.7.0.pre1/lib/laser.rb:26:in `require': no such file to load -- treetop (LoadError)
    from /Users/konstantin/.rvm/gems/ruby-1.9.2-p290/gems/laser-0.7.0.pre1/lib/laser.rb:26:in `<top (required)>'
    from /Users/konstantin/.rvm/gems/ruby-1.9.2-p290/gems/laser-0.7.0.pre1/bin/laser:6:in `require'
    from /Users/konstantin/.rvm/gems/ruby-1.9.2-p290/gems/laser-0.7.0.pre1/bin/laser:6:in `<top (required)>'
    from /Users/konstantin/.rvm/gems/ruby-1.9.2-p290/bin/laser:19:in `load'
    from /Users/konstantin/.rvm/gems/ruby-1.9.2-p290/bin/laser:19:in `<main>'
~/Workspace/sinatra-contrib (git: master) ❷ gem which treetop
/Users/konstantin/.rvm/gems/ruby-1.9.2-p290/gems/treetop-1.4.10/lib/treetop
~/Workspace/sinatra-contrib (git: master) ❷ irb
reruby-1.9.2-p290 :001 > require 'treetop'
 => true 
ruby-1.9.2-p290 :002 > ^D
~/Workspace/sinatra-contrib (git: master) ❷ ruby -r treetop -S laser --help
/Users/konstantin/.rvm/gems/ruby-1.9.2-p290/gems/laser-0.7.0.pre1/lib/laser.rb:26:in `require': no such file to load -- treetop (LoadError)
    from /Users/konstantin/.rvm/gems/ruby-1.9.2-p290/gems/laser-0.7.0.pre1/lib/laser.rb:26:in `<top (required)>'
    from /Users/konstantin/.rvm/gems/ruby-1.9.2-p290/gems/laser-0.7.0.pre1/bin/laser:6:in `require'
    from /Users/konstantin/.rvm/gems/ruby-1.9.2-p290/gems/laser-0.7.0.pre1/bin/laser:6:in `<top (required)>'
    from /Users/konstantin/.rvm/gems/ruby-1.9.2-p290/bin/laser:19:in `load'
    from /Users/konstantin/.rvm/gems/ruby-1.9.2-p290/bin/laser:19:in `<main>'
~/Workspace/sinatra-contrib (git: master) ❷ irb
reruby-1.9.2-p290 :001 > require 'treetop'
 => true 
ruby-1.9.2-p290 :002 > require 'laser'
NameError: uninitialized constant Rake::DSL
    from /Users/konstantin/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/rake.rb:2482:in `const_missing'
    from /Users/konstantin/.rvm/gems/ruby-1.9.2-p290/gems/laser-0.7.0.pre1/lib/laser/rake/task.rb:5:in `<class:LaserTask>'
    from /Users/konstantin/.rvm/gems/ruby-1.9.2-p290/gems/laser-0.7.0.pre1/lib/laser/rake/task.rb:4:in `<module:Rake>'
    from /Users/konstantin/.rvm/gems/ruby-1.9.2-p290/gems/laser-0.7.0.pre1/lib/laser/rake/task.rb:3:in `<module:Laser>'
    from /Users/konstantin/.rvm/gems/ruby-1.9.2-p290/gems/laser-0.7.0.pre1/lib/laser/rake/task.rb:2:in `<top (required)>'
    from /Users/konstantin/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /Users/konstantin/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /Users/konstantin/.rvm/gems/ruby-1.9.2-p290/gems/polyglot-0.3.1/lib/polyglot.rb:64:in `require'
    from /Users/konstantin/.rvm/gems/ruby-1.9.2-p290/gems/laser-0.7.0.pre1/lib/laser.rb:91:in `<top (required)>'
    from /Users/konstantin/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:59:in `require'
    from /Users/konstantin/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:59:in `rescue in require'
    from /Users/konstantin/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
    from /Users/konstantin/.rvm/gems/ruby-1.9.2-p290/gems/polyglot-0.3.1/lib/polyglot.rb:64:in `require'
    from (irb):2
    from /Users/konstantin/.rvm/rubies/ruby-1.9.2-p290/bin/irb:16:in `<main>'
ruby-1.9.2-p290 :004 > require 'laser'
/Users/konstantin/.rvm/gems/ruby-1.9.2-p290/gems/laser-0.7.0.pre1/lib/laser.rb:2: warning: already initialized constant VERSION
/Users/konstantin/.rvm/gems/ruby-1.9.2-p290/gems/laser-0.7.0.pre1/lib/laser.rb:3: warning: already initialized constant TESTS_ACTIVATED
/Users/konstantin/.rvm/gems/ruby-1.9.2-p290/gems/laser-0.7.0.pre1/lib/laser.rb:4: warning: already initialized constant ROOT
/Users/konstantin/.rvm/gems/ruby-1.9.2-p290/gems/laser-0.7.0.pre1/lib/laser.rb:5: warning: already initialized constant SETTINGS
Warning: creating new instance of Class Object
Warning: creating new instance of Class Class
Warning: creating new instance of Class Module
Warning: creating new instance of Class BasicObject
Laser::Analysis::Bootstrap::BootstrappingError: Bootstrapping failed: GlobalScope has already been initialized
    from /Users/konstantin/.rvm/gems/ruby-1.9.2-p290/gems/laser-0.7.0.pre1/lib/laser/analysis/bootstrap/bootstrap.rb:39:in `bootstrap'
    from /Users/konstantin/.rvm/gems/ruby-1.9.2-p290/gems/laser-0.7.0.pre1/lib/laser.rb:80:in `<top (required)>'
    from /Users/konstantin/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /Users/konstantin/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /Users/konstantin/.rvm/gems/ruby-1.9.2-p290/gems/polyglot-0.3.1/lib/polyglot.rb:64:in `require'
    from (irb):4
    from /Users/konstantin/.rvm/rubies/ruby-1.9.2-p290/bin/irb:16:in `<main>'
ruby-1.9.2-p290 :005 > ^D
@guillaumerose

Same here (with ruby-1.9.2-p290 too)

@godfat

It seems laser would try to use the Gemfile which lies on the current path. So you might need to add laser to your Gemfile...

Well, I don't think laser should use bundler for people who runs it.

laser-0.7.0.pre1/bin/laser:

#!/usr/bin/env ruby                                                             
require 'rubygems'                                                              
require 'bundler/setup'                                                         
Bundler.require(:default)                                                       
$:.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))                      
require 'laser'                                                                 
Laser::Runner.new(ARGV.dup).run
@michaeledgar

Shoot. My understanding was that Bundler would use the Gemfile for the application packaged with the laser library code. It worked for me because I happened to test in a directory with a sufficient Gemfile.

It looks like Bundler isn't appropriate for a CLI application. Back to the drawing board. New prerelease this weekend.

@michaeledgar

Hey everyone, thanks for helping me pin this down. I never did learn how bundler works with gems too well, it seems. But I just tested the new prerelease (pre2) without a Gemfile - this should run just fine!

@godfat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.