本文介绍了无法在Windows环境中安装state_machines gem的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Rails的新手,希望在定制之前检查Spree电子商务解决方案的外观。这就是为什么我从RubyInstaller,DevKit,Rails,Spree等安装Ruby。



在安装 state_machines gem时,下面出现错误,并且最终未安装宝石。

  C:\> gem install state_machines 

错误:执行gem ...( Errno :: EINVAL)
无效参数@ rb_sysopen - C:/Dev/Ruby/lib/ruby/gems/2.1.0/gems/state_m
achines- 0.2.2 / test / unit / node_collection /这会影响 bundle install 以后的spree项目:

  Errno :: EINVAL:无效参数@ rb_sysopen  -  C:/ Dev / Ruby / lib /ruby/gems/2.1.0/g 
ems / state_machines-0.2.2 / test / unit / node_collection / node_collection_after_being_c
opied_test.rb
安装state_machines时发生错误(0.2.2 )和Bundler不能
continue.Make捆绑之前确保`gem install state_machines -v'0.2.2'`
成功。

当前安装的ruby版本为:
ruby​​ 2.1.5p273(2014-11-13 revision 48405)[i386-mingw32] + devkit

rails版本是4.2.0

我在Windows上运行环境,没有任何可能转移到Linux。

解决方案

我也遇到了这个问题。



看起来像state_machines有一些测试用例文件,其名称中有换行符。
我敢打赌,这是问题的原因。
我在这里提交了拉请求:
与此同时,我的分支没有问题:



具体修正(目前为止,直到pullrequest是接受)是:

  git clone https://github.com/jeff-hamm/state_machines 
cd state_machines
bundle gem state_machines
rake install

完成后,'gem install spree_core'在windows上工作得很好。请记住,我不打算让分支保持最新状态(如果请求被接受,我会将其删除),因此,该克隆网址不会是理想的长$ <

I am new to Rails and would like to check how Spree ecommerce solution looks like before the customization. That's why I installed Ruby from RubyInstaller, DevKit, Rails, Spree etc.

During installation of state_machines gem, below error appears and the gem is eventually not installed.

C:\>gem install state_machines 

ERROR:  While executing gem ... (Errno::EINVAL)
Invalid argument @ rb_sysopen - C:/Dev/Ruby/lib/ruby/gems/2.1.0/gems/state_m
achines-  0.2.2/test/unit/node_collection/node_collection_after_being_copied_test.rb

This has impact on the bundle install of spree project later on:

Errno::EINVAL: Invalid argument @ rb_sysopen - C:/Dev/Ruby/lib/ruby/gems/2.1.0/g
ems/state_machines-0.2.2/test/unit/node_collection/node_collection_after_being_c
opied_test.rb
An error occurred while installing state_machines (0.2.2), and Bundler cannot
continue.Make sure that `gem install state_machines -v '0.2.2'` 
succeeds before bundling.

Current ruby version installed is:ruby 2.1.5p273 (2014-11-13 revision 48405) [i386-mingw32] + devkit

rails version is 4.2.0

I am running on Windows environment, without any possibility to move to Linux.

解决方案

I ran into this too.

Looks like state_machines has some test case files that have a newline in the name. I'd bet that is the cause of the issue.I've submitted a pull request over here: https://github.com/state-machines/state_machines/pull/11In the meantime, my branch doesn't have the issue: https://github.com/jeff-hamm/state_machines

The specific fix (for the moment, until the pullrequest is accepted) is:

git clone https://github.com/jeff-hamm/state_machines
cd state_machines
bundle gem state_machines
rake install

After doing that, 'gem install spree_core' worked just fine on windows.

Keep in mind I am not planning on keeping my branch up to date (I will delete it if the request is accepted), so, that clone url won't be ideal for long

这篇关于无法在Windows环境中安装state_machines gem的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-23 13:52