1

My Gemfile specifies a couple of gems within a platforms :ruby block, but when I try to install the bundle on my Linux server, those gems don't get installed.

Can someone orient me? I'm trying to specify gems I want on my Linux server but not Windows.

platforms :ruby do
    gem 'execjs', '~> 1.4.0'
    gem 'therubyracer', '~> 0.10.1'

    unless RUBY_VERSION.to_f >= 1.9
        gem 'pre-johnson', '~> 2.0'
    end
end

When I run bundle show therubyracer, I get the message Could not find gem 'therubyracer' in the current bundle.

JellicleCat
  • 28,480
  • 24
  • 109
  • 162
  • That's so, but shouldn't my gems be installed anyway? When I run `bundle platform`, ruby is listed among the platforms for which my app has gems. This is not the case when I execute `bundle platform` in the same app on my Windows machine. – JellicleCat Dec 05 '12 at 21:29
  • (Less important: I'd be happy with the possible duplicate thread, but that asker didn't get his answer satisfactorilly, and I don't see any solutions that don't limit portability or impose negative side effects.) – JellicleCat Dec 05 '12 at 21:37
  • Yeah I agree; deleting my comment. Which interpreter are you running, anyway? – Abe Voelker Dec 05 '12 at 21:43
  • Thanks for asking. I'm not sure that this refers to the interpreter, but: ruby-1.9.3-p194. (If that isn't it, can you tell me how to determine which interpreter I'm using?) – JellicleCat Dec 05 '12 at 22:24
  • Ah. `RUBY_PLATFORM` yields `x86_64-linux`; `rvm current` yields `ruby-1.9.3-p194@rails326`; `which ruby` yields `/usr/local/rvm/rubies/ruby-1.9.3-p194/bin/ruby`; `ruby -v` yields `ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]`. I don't know where to go from here. – JellicleCat Dec 07 '12 at 18:15
  • 1
    I don't think I was right about the `RUBY_PLATFORM` thing, but your environment looks fine to me - your Gemfile should be installing those gems given your interpreter (I tried it out on my Linux machine w/ same interpreter and it worked fine). Only things I can think are that either something else in the Gemfile is messing things up, or perhaps something is wrong with the rvm install - I noticed that you have it installed system-wide in `/usr/local/rvm`; historically I've had nothing but trouble w/ rvm "Multi-User" installs. I'd suggest switching to single-user install (`~/.rvm`) if possible – Abe Voelker Dec 07 '12 at 18:46

0 Answers0