安装shopify_theme命令行工具时出错

时间:2013-11-12 21:53:03

标签: ruby rubygems shopify

我一直在努力安装shopify_theme一个用于与Shopify主题资产互动的控制台工具。

我一直在尝试按照github项目页面上的使用说明进行操作,但是碰壁了:

通过我的终端(OS X Mavericks)我输入:

gem install shopify_theme

我收回了这个错误:

ERROR:  While executing gem ... (Gem::ImpossibleDependenciesError)
httparty-0.12.0 requires json (~> 1.8) but it conflicted:
Activated json-1.8.1 instead of (~> 1.5.4) via:
shopify_theme-0.0.12

我尝试通过手动安装JSON,手动安装httpary以及手动安装其他相关依赖项来解决这个问题,但没有成功。但它没有任何区别。

请停止!

编辑:我想我找到了一个解决方案:

在我的头撞到屏幕8小时后,我发现了一个解决我的依赖性问题的方法。就我而言,我正在全新安装OS X Mavericks(10.9)。

打开终端并执行以下操作:

1)通过rvm安装最新版本的ruby。 (http://net.tutsplus.com/tutorials/ruby/how-to-install-ruby-on-a-mac/

\curl -L https://get.rvm.io | bash -s stable —rails —autolibs=enabled # Or, —ruby=1.9.3

2)更新rvm。

rvm get stable —auto-dotfiles

3)shopify_theme要求您使用ruby 1.9。

rvm install ruby-1.9.3-p448
rvm use 1.9

4)转到项目根目录,我们将专门为您的工作目录安装软件包。

cd path/to/project/root/

5)要处理特定的gem依赖项,请使用Bundler。 (http://bundler.io/

gem install bundler

6)在工作目录中创建一个Gemfile。

bundle init

7)编辑你的Gemfile。在您选择的编辑器中打开它。用这个替换它的内容:

source “https://rubygems.org”

gem ‘shopify_theme’
gem ‘httparty’

8)生成Gemfile.lock并安装您的依赖项。

bundle install

9)最后你可以安装shopify_theme。

gem install shopify_theme

这对我有用。如果有人在这里认识到不必要的步骤,我有兴趣知道。

0 个答案:

没有答案