0

This is my first time creating a Shopify App with Ruby so i have a few question, im trying to install using this command:

bundle install

But im getting this error:

[!] 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.

This is what i have already:

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

Any suggestion?

1
  • Where is the file version.rb located? It's either missing, or your load path or require statement is wrong.Those are the possible alternatives. The error message tells you Ruby cannot find version.rb, so start by figuring out where that file is, then add the location to the question here. Commented Jul 29, 2018 at 1:49

1 Answer 1

1

you need to add a version.rb file under your my_app dir duet othe error:

[!] There was an error while loading `my_app.gemspec`: cannot load such file -- my_app/version
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.