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

Gem not installing correctly #62

Closed
brentax opened this issue Oct 6, 2014 · 3 comments
Closed

Gem not installing correctly #62

brentax opened this issue Oct 6, 2014 · 3 comments

Comments

@brentax
Copy link

brentax commented Oct 6, 2014

Hi! I'm struggling to get the rails-api gem installed correctly. I am using this puppet script for a Vagrant machine. Windows 8 host with Ubuntu 12.04 guest.

I use the snippet below in my manifest, and get no errors from the installation. But when I try to run rails-api, I get rails-api: command not found. Any help would be great!

RVM output from vagrant up

==> default: Notice: /Stage[main]/Install-rvm/Rvm_system_ruby[ruby-2.1.3]/ensure: created
==> default: Notice: /Stage[main]/Install-rvm/Rvm_gemset[ruby-2.1.3@myproject]/ensure: created
==> default: Notice: /Stage[main]/Install-rvm/Rvm_gem[ruby-2.1.3@myproject/rails-api]/ensure: created
==> default: Notice: /Stage[main]/Install-rvm/Rvm_gem[ruby-2.1.3@myproject/rake]/ensure: ensure changed '10.1.0' to 'latest'
==> default: Notice: /Stage[main]/Install-rvm/Rvm_gem[ruby-2.1.3@myproject/bundler]/ensure: ensure changed '1.7.3' to 'latest'

Section of manifest file installing RVM.

class install-rvm {
  include rvm
  rvm::system_user { vagrant: ; }

  rvm_system_ruby {
    'ruby-2.1.3':
      ensure => 'present',
      default_use => true;
  }

  rvm_gemset {
    'ruby-2.1.3@myproject':
      ensure  => present,
      require => Rvm_system_ruby['ruby-2.1.3'];
  }

  rvm_gem {
    'ruby-2.1.3@myproject/bundler': ensure => latest, require => Rvm_gemset['ruby-2.1.3@myproject'];
    'ruby-2.1.3@myproject/rails-api': ensure => '0.2.1', require => Rvm_gemset['ruby-2.1.3@myproject'];
    'ruby-2.1.3@myproject/rake': ensure => latest, require => Rvm_gemset['ruby-2.1.3@myproject'];
  }

}

class { 'install-rvm': }
@carlossg
Copy link
Member

carlossg commented Oct 7, 2014

Are you using rvm ruby-2.1.3@myproject do rails-api ?

@brentax
Copy link
Author

brentax commented Oct 7, 2014

Ah, that worked! I didn't know about that syntax and couldn't find it in the readme. I'll submit a PR with that in the readme.

Is there anyway to install a gem globally so I can just use the bare rails-api command?

@carlossg
Copy link
Member

carlossg commented Oct 7, 2014

You are creating gemsets so gems are not system wide available, check gemsets in the rvm docs
You probably want to install in the default gemset (i.e. no gemset)

rvm_gem { 'ruby-2.1.3/bundler': ensure => latest ...

@carlossg carlossg closed this as completed Oct 7, 2014
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

2 participants