Skip to content

Error when installing rails_apps_composer using Bundler #114

@mmay

Description

@mmay

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>'

Activity

DanielKehoe

DanielKehoe commented on Sep 13, 2012

@DanielKehoe
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

mmay commented on Sep 18, 2012

@mmay
Author

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

Closing.

listrophy

listrophy commented on Mar 6, 2013

@listrophy
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

listrophy commented on Mar 6, 2013

@listrophy
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

listrophy commented on Mar 6, 2013

@listrophy
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

DanielKehoe commented on Mar 6, 2013

@DanielKehoe
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

listrophy commented on Mar 6, 2013

@listrophy
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

DanielKehoe commented on Mar 6, 2013

@DanielKehoe
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

listrophy commented on Mar 6, 2013

@listrophy
Contributor

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

DanielKehoe

DanielKehoe commented on Mar 6, 2013

@DanielKehoe
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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @listrophy@mmay@DanielKehoe

        Issue actions

          Error when installing rails_apps_composer using Bundler · Issue #114 · RailsApps/rails_apps_composer