1

I want to run a heroku server and after installing ruby and ruby gems, wanted to run ' bundle install'. I received a compile error when trying to install therubyracer and realised it is because therubyracer does not run on windows from here. It is suggested on other several questions to change the gem file to not include therubyracer on windows, and instead use execjs. I downloaded execjs, but how do I change the gem file?

this is my current gem file:

source 'https://rubygems.org'

gem 'sinatra'
gem 'sinatra-contrib'
gem 'heroku'

group :development do
   gem 'less'
end

these are suggestions made here and here

gem 'therubyracer-heroku', '~> 0.8.1.pre3', :platform => :ruby
gem 'therubyracer', :platform => :ruby

I tried inserting either of these lines, which did not work (running 'bundle install' still attempted to install therubyracer and failed.) So I suspect I must add the :platform => :ruby else where.

Can anyone point me to how to modify my gem file to fix this problem?

Thank you!

ps: using Ruby 1.9.3.

4

1 回答 1

2

如果您仅使用 therubyracer 进行资产编译,并且您正在部署到 cedar,那么您现在可以将这两个 gem 从您的 Gemfile 中删除,heroku 会做正确的事情。

heroku文档

如果您之前使用的是 therubyracer 或 therubyracer-heroku,则不再需要这些 gem,并且强烈建议您不要使用这些 gem,因为这些 gem 会占用大量内存。

于 2012-03-15T05:52:19.647 回答