voltrb / volt

A Ruby web framework where your Ruby runs on both server and client
MIT License
3.22k stars 196 forks source link

Volt new command - Cannot load such file -- thor #309

Open fzingg opened 9 years ago

fzingg commented 9 years ago

When executing the command :

volt new todo_example

I got :

/home/fcooker/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/volt-0.9.5/lib/volt/cli.rb:4:in `require': cannot load such file -- thor (LoadError)
    from /home/fcooker/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/volt-0.9.5/lib/volt/cli.rb:4:in `<top (required)>'
    from /home/fcooker/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /home/fcooker/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /home/fcooker/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/volt-0.9.5/bin/volt:4:in `<top (required)>'
    from /home/fcooker/.rbenv/versions/2.2.2/bin/volt:23:in `load'
    from /home/fcooker/.rbenv/versions/2.2.2/bin/volt:23:in `<main>'

Environment :

rbenv 0.4.0 ruby 2.2.2 thor gem 0.19.1 volt gem 0.9.5

ryanstout commented 9 years ago

@fzingg your the first person to report this, so my guess is its somehow related to your environment. I'm running with rbenv no problem. Can you try removing volt and installing it again?

gem uninstall volt
gem install volt
fzingg commented 9 years ago

@ryanstout , yes it's probably related to my environment. However, I tried uninstall volt, thor then reinstall, still the same issue. I also tried to install another ruby (2.2.3) then install volt , but still the same issue.

I'm continuing my investigation.

ryanstout commented 9 years ago

@fzingg any luck on this one? I'm not really sure what it could be. If things are setup right, you should also get a thor command if the rbenv stuff is on the path. If you type thor into the terminal do you get anything?

fzingg commented 9 years ago

@ryanstout , Thank you for your concern. I just fixed the problem yesterday :

Everything (thor, volt commands) worked well in any directories except the one I wanted to create the Volt project (thor -- LoadError Issue).

The problem is that I had a Gemfile (with only the bundle gem declared inside) and Gemfile.lock in this directory. So I guess that Volt binary could not find any thor file. But if I tried to run Thor in this directory and everything was ok. I guess it took the global Gemfile and not the empty one.

Anyway, I can start to use Volt and hope I can contribute efficiently instead of disturbing everyone with my environment problem !

ryanstout commented 9 years ago

@fzingg ok, so you are saying you had a Gemfile in a path above the directory you were running the volt command in?

fzingg commented 9 years ago

My directories structure is like this :

/HOME
     .rbenv
     myapplications
          myapp1
                Gemfile (generated by bundle command)
                Gemfile.lock
          myapp2
                Gemfile (generated by bundle command)
                Gemfile.lock
          myapp3
                Gemfile (generated by bundle command)
                Gemfile.lock

So when I create a new application (with rails new myappx or volt new myappx for example), I run the command under myapplications directory.

But probably because one day I ran the command bundle under myapplications directory I had generated a Gemfile and a Gemfile.lock After deleting both of them, everything was fine. (I never had this issue before when running rails new myappx