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

Error when installing rails_apps_composer using Bundler #114

Closed
mmay opened this issue Sep 13, 2012 · 10 comments
Closed

Error when installing rails_apps_composer using Bundler #114

mmay opened this issue Sep 13, 2012 · 10 comments

Comments

@mmay
Copy link

mmay commented Sep 13, 2012

Got the RuntimeError:

RVM gem is currently unavailable

when creating a new app like so:

rails_apps_composer new name -r core

Not sure if this is something on my end or something internal.

      recipe  Running extras recipe...
      extras  Set a robots.txt file to ban spiders? (y/n) 
      extras  Set a robots.txt file to ban spiders? (y/n) y
      extras  Create a project-specific rvm gemset and .rvmrc? (y/n) y
      extras  Create a GitHub repository? (y/n) n
      extras  recipe banning spiders by modifying 'public/robots.txt'
      extras  recipe creating project-specific rvm gemset and .rvmrc
/var/folders/p3/rnkdqw0x1rsfsv7nvf9y91gc0000gn/T/template20120913-21771-16vdqdm:1652:in `rescue in apply': RVM gem is currently unavailable. (RuntimeError)
    from /var/folders/p3/rnkdqw0x1rsfsv7nvf9y91gc0000gn/T/template20120913-21771-16vdqdm:1646:in `apply'
    from /.../.rvm/gems/ruby-1.9.3-head/gems/thor-0.16.0/lib/thor/actions.rb:221:in `instance_eval'
    from /.../.rvm/gems/ruby-1.9.3-head/gems/thor-0.16.0/lib/thor/actions.rb:221:in `apply'
    from /.../.rvm/gems/ruby-1.9.3-head/gems/railties-3.2.7/lib/rails/generators/app_base.rb:109:in `apply_rails_template'
    from (eval):1:in `apply_rails_template'
    from /.../.rvm/gems/ruby-1.9.3-head/gems/thor-0.16.0/lib/thor/task.rb:27:in `run'
    from /.../.rvm/gems/ruby-1.9.3-head/gems/thor-0.16.0/lib/thor/invocation.rb:120:in `invoke_task'
    from /.../.rvm/gems/ruby-1.9.3-head/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `block in invoke_all'
    from /.../.rvm/gems/ruby-1.9.3-head/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `each'
    from /.../.rvm/gems/ruby-1.9.3-head/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `map'
    from /.../.rvm/gems/ruby-1.9.3-head/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `invoke_all'
    from /.../.rvm/gems/ruby-1.9.3-head/gems/thor-0.16.0/lib/thor/group.rb:238:in `dispatch'
    from /.../.rvm/gems/ruby-1.9.3-head/gems/thor-0.16.0/lib/thor/base.rb:425:in `start'
    from /.../.rvm/gems/ruby-1.9.3-head/gems/railties-3.2.7/lib/rails/commands/application.rb:38:in `<top (required)>'
    from /.../.rvm/rubies/ruby-1.9.3-head/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
    from /.../.rvm/rubies/ruby-1.9.3-head/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
    from /.../.rvm/gems/ruby-1.9.3-head/gems/railties-3.2.7/lib/rails/cli.rb:15:in `<top (required)>'
    from /.../.rvm/rubies/ruby-1.9.3-head/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
    from /.../.rvm/rubies/ruby-1.9.3-head/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
    from /.../.rvm/gems/ruby-1.9.3-head/gems/railties-3.2.7/bin/rails:7:in `<top (required)>'
    from /.../.rvm/gems/ruby-1.9.3-head/bin/rails:19:in `load'
    from /.../.rvm/gems/ruby-1.9.3-head/bin/rails:19:in `<main>'
@DanielKehoe
Copy link
Member

This is most likely due to an rvm installation problem. First, can you create a new rvm gemset manually? Do you have the newest rvm release? $ rvm get latest Try updating your rvm gem gem update rvm If still seeing a failure, I recommend removing and reinstalling rvm. Let me know how it goes.

@mmay
Copy link
Author

mmay commented Sep 18, 2012

Thanks for the quick reply. Silly me, the problem was that I didn't have the rvm gem in my current gemset.

Closing.

@mmay mmay closed this as completed Sep 18, 2012
@listrophy
Copy link
Contributor

I'm getting the same error. I'm using both the latest stable version of rvm and the latest version of the rvm gem.

Do I need to run rails_apps_composer from ruby's global gemset?

@listrophy
Copy link
Contributor

And if I say no to the rvm question, I still get an rvm-(seemingly-)related error:

The template [/path/to/template.rb] could not be loaded. Error: cannot load such file -- html2haml

@listrophy
Copy link
Contributor

Hmmm... I'm getting somewhere now. I'm using bundler to install rails_apps_composer, and it looks like I need to include all the gems I'll need in the Gemfile:

source 'https://rubygems.org'

gem 'rails'
gem 'rails_apps_composer'
gem 'html2haml'
gem 'rvm'
gem 'activerecord-postgresql-adapter'
gem 'simple_form'
gem 'figaro'
gem 'rspec-rails'
gem 'devise'
gem 'email_spec'

@DanielKehoe
Copy link
Member

You can install rails_apps_composer into the global gemset, but I recommend creating a gemset for rails_apps_composer:

$ rvm use ruby-2.0.0@rails_apps_composer --create

You'll need to add Rails before running rails_apps_composer:

$ gem install rails

Installation is simple:

$ gem install rails_apps_composer

Then try

rails_apps_composer new myapp -r core

There is no need to install additional gems as rails_apps_composer will add them to to a temporary application template and Bundler will install them as needed.

I suggest taking a look at the article http://railsapps.github.com/installing-rails.html to make sure your development environment is set up correctly. Not sure why you are seeing the errors.

@listrophy
Copy link
Contributor

I'm pretty sure the problem was that I had installed rails_apps_composer via bundler. Bundler was probably isolating rails_apps_composer from other gemsets (or some other such nonsense that is entirely acceptable except in rails_apps_composer's case).

I've got it working now(-ish) by not using bundler to install rails_apps_composer. Would you mind updating the Installation part of the readme to advise against using bundler to install rails_apps_composer? I think it would help others.

@DanielKehoe
Copy link
Member

I've never used Bundler this way so please help me understand. Did you create a new folder with a Gemfile that includes rails_apps_composer? And then ran bundle install to install rails_apps_composer?

@listrophy
Copy link
Contributor

That's exactly what I did. And it borked everything.

@DanielKehoe
Copy link
Member

Ok, good to know. I've update the README install instructions to offer a warning.

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

No branches or pull requests

3 participants