这是我第一次使用 Ruby 创建 Shopify 应用程序,所以我有几个问题,我尝试使用以下命令进行安装:
bundle install
但我收到这个错误:
[!] There was an error parsing `Gemfile`:
[!] There was an error while loading `my_app.gemspec`: cannot load such file -- my_app/version
Does it try to require a relative path? That's been removed in Ruby 1.9. Bundler cannot continue.
# from /var/www/html/shopify_app/my_app.gemspec:2
# -------------------------------------------
# $LOAD_PATH.push File.expand_path('../lib', __FILE__)
> require "my_app/version"
#
# -------------------------------------------
. Bundler cannot continue.
这是我已经拥有的:
my_app.gemspec
$LOAD_PATH.push File.expand_path('../lib', __FILE__)
require "my_app/version"
Gem::Specification.new do |s|
s.name = "my_app"
s.version = ShopifyApp::VERSION
s.platform = Gem::Platform::RUBY
s.author = "Shopify"
s.summary = %q{This gem is used to get quickly started with the Shopify API}
s.required_ruby_version = ">= 2.3.1"
s.add_runtime_dependency('rails', '>= 5.0.0')
s.add_runtime_dependency('shopify_api', '>= 4.3.5')
s.add_runtime_dependency('omniauth-shopify-oauth2', '~> 1.2.0')
s.add_development_dependency('rake')
s.add_development_dependency('byebug')
s.add_development_dependency('sqlite3')
s.add_development_dependency('minitest')
s.add_development_dependency('mocha')
s.files = `git ls-files`.split("\n").reject { |f| f.match(%r{^(test|example)/}) }
s.test_files = `git ls-files -- {test}/*`.split("\n")
s.require_paths = ["lib"]
end
有什么建议吗?
你需要version.rb
在你的my_app
目录下添加一个文件来解决错误:
[!] There was an error while loading `my_app.gemspec`: cannot load such file -- my_app/version
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句