在windows上的therubyracer宝石

Nik*_* So 50 rubygems ruby-on-rails bundler devkit

我已经在Windows上安静地开发了几周没有添加任何宝石,今天我决定进行捆绑更新,但我无法通过这个名为therubyracer的宝石.我安装了devkit,它正在根据文档的验证程序工作.

我的问题是:有没有办法在Windows上安装这个宝石?

这个gem是否需要rails 3.1,这就是为什么现在我进行捆绑更新它会被"滑入"rails 3.0.8作为未来3.1迁移的早期启动手势?

编辑包括Gemfile和Gemfile.lock

# Gemfile
# source 'http://rubygems.org'
source :rubygems

gem 'rails'
gem 'rake', '0.8.7'
gem 'youtube_it'
gem 'panda'
gem "nifty-generators"
# gem "mongoid", "2.0.0.rc.7"
gem "mongoid"
gem "mongoid-eager-loading"
# gem 'mongoid_search'
gem "bson_ext", ">1.1.5"
gem 'devise'
gem 'cancan'
gem 'hirb'
# gem 'heroku'
gem 'rest-client'
gem 'less' # needs the more plugin
# gem 'hash_extension'
gem 'aws-s3', :require => 'aws/s3' # s3.rb
gem 'jquery-rails', ">= 0.2.7" # rails g jquery:install
# gem 'mongrel', ">= 1.2.0.pre2"
gem 'delayed_job'
gem 'delayed_job_mongoid'
gem 'kaminari'



# Gemfile.lock
GEM
  remote: http://rubygems.org/
  specs:
    abstract (1.0.0)
    actionmailer (3.0.8)
      actionpack (= 3.0.8)
      mail (~> 2.2.19)
    actionpack (3.0.8)
      activemodel (= 3.0.8)
      activesupport (= 3.0.8)
      builder (~> 2.1.2)
      erubis (~> 2.6.6)
      i18n (~> 0.5.0)
      rack (~> 1.2.1)
      rack-mount (~> 0.6.14)
      rack-test (~> 0.5.7)
      tzinfo (~> 0.3.23)
    activemodel (3.0.8)
      activesupport (= 3.0.8)
      builder (~> 2.1.2)
      i18n (~> 0.5.0)
    activerecord (3.0.8)
      activemodel (= 3.0.8)
      activesupport (= 3.0.8)
      arel (~> 2.0.10)
      tzinfo (~> 0.3.23)
    activeresource (3.0.8)
      activemodel (= 3.0.8)
      activesupport (= 3.0.8)
    activesupport (3.0.8)
    arel (2.0.10)
    aws-s3 (0.6.2)
      builder
      mime-types
      xml-simple
    bcrypt-ruby (2.1.4-x86-mingw32)
    bson (1.3.1)
    bson_ext (1.3.1)
    builder (2.1.2)
    cancan (1.6.5)
    daemons (1.1.3)
    delayed_job (2.1.4)
      activesupport (~> 3.0)
      daemons
    delayed_job_mongoid (1.0.2)
      delayed_job (~> 2.1.1)
      mongoid (~> 2.0.0.rc)
    devise (1.3.4)
      bcrypt-ruby (~> 2.1.2)
      orm_adapter (~> 0.0.3)
      warden (~> 1.0.3)
    erubis (2.6.6)
      abstract (>= 1.0.0)
    hirb (0.4.5)
    i18n (0.5.0)
    jquery-rails (1.0.10)
      railties (~> 3.0)
      thor (~> 0.14)
    json (1.5.2)
    kaminari (0.12.4)
      rails (>= 3.0.0)
    less (1.2.21)
      mutter (>= 0.4.2)
      treetop (>= 1.4.2)
    mail (2.2.19)
      activesupport (>= 2.3.6)
      i18n (>= 0.4.0)
      mime-types (~> 1.16)
      treetop (~> 1.4.8)
    mime-types (1.16)
    mongo (1.3.1)
      bson (>= 1.3.1)
    mongoid (2.0.2)
      activemodel (~> 3.0)
      mongo (~> 1.3)
      tzinfo (~> 0.3.22)
    mongoid-eager-loading (0.3.1)
    mutter (0.5.3)
    nifty-generators (0.4.6)
    oauth (0.4.4)
    orm_adapter (0.0.5)
    panda (1.4.2)
      json
      rest-client
      ruby-hmac (>= 0.3.2)
    polyglot (0.3.1)
    rack (1.2.3)
    rack-mount (0.6.14)
      rack (>= 1.0.0)
    rack-test (0.5.7)
      rack (>= 1.0)
    rails (3.0.8)
      actionmailer (= 3.0.8)
      actionpack (= 3.0.8)
      activerecord (= 3.0.8)
      activeresource (= 3.0.8)
      activesupport (= 3.0.8)
      bundler (~> 1.0)
      railties (= 3.0.8)
    railties (3.0.8)
      actionpack (= 3.0.8)
      activesupport (= 3.0.8)
      rake (>= 0.8.7)
      thor (~> 0.14.4)
    rake (0.8.7)
    rest-client (1.6.1)
      mime-types (>= 1.16)
    ruby-hmac (0.4.0)
    thor (0.14.6)
    treetop (1.4.9)
      polyglot (>= 0.3.1)
    tzinfo (0.3.28)
    warden (1.0.4)
      rack (>= 1.0)
    xml-simple (1.0.16)
    youtube_it (1.4.2)
      builder
      oauth (>= 0.4.4)

PLATFORMS
  x86-mingw32

DEPENDENCIES
  aws-s3
  bson_ext (> 1.1.5)
  cancan
  delayed_job
  delayed_job_mongoid
  devise
  hirb
  jquery-rails (>= 0.2.7)
  kaminari
  less
  mongoid
  mongoid-eager-loading
  nifty-generators
  panda
  rails
  rake (= 0.8.7)
  rest-client
  youtube_it
Run Code Online (Sandbox Code Playgroud)

小智 66

不,我目前无法知道当前在Windows上安装此gem.问题是目前没有针对Windows的libv8 gem的预编译版本,源版本仅与*nix兼容.它不一定是那种方式,它只需要有人花时间让Windows编译工作.https://github.com/fractaloop/libv8

也就是说,Windows应该附带一个JScript,即Microsoft JavaScript运行时,rails(通过execjs)将自动检测和使用,因此您应该能够删除对therubyracer的依赖.

作为那个宝石的维护者,这当然会让我感到难过,但它应该让你顺利.

  • 嗨,只是添加一个快速注释:您可以在Gemfile中编写`gem'therubyracer',:platform =>:ruby`,这样`therubyracer`只能安装在linux和OSX上,而不能安装在Windows上. (19认同)

Dom*_*ers 13

这基本上就是Nik所做的,我相信:

在你的Gemfile中,将TheRubyRacer gem分离到生产环境,如下所示:

group :production do
  gem 'therubyracer-heroku', :platform => :ruby
end
Run Code Online (Sandbox Code Playgroud)

在您的开发环境中,而不是简单的bundle install

bundle install --without production
Run Code Online (Sandbox Code Playgroud)

或者,正如尼克所说,bundle install development.当您部署到Heroku时,它将安装gem,因为它是生产环境.

Rails大师:请建议编辑,以减少这个.

  • 你可以在你的Gemfile中添加`gem'therubyracer',:platform =>:ruby`,这样`therubyracer`只能安装在linux和OSX上,而不是Windows上 (2认同)

小智 10

所有这些问题的原因是therubyracer-0.11.0beta1-x86-mingw32.gem和v8.dll.

我已经编译了必要的dll和gem文件并将它们上传到github.

下载包并按照说明操作.

https://github.com/eakmotion/therubyracer_for_windows