简体   繁体   中英

Can I use the Shopify API or no

Quite basic question probably but I'm beyond confused. I mostly code in PHP but I'm looking to learn how to create a shopify app. I installed Ruby/Ruby on rails on my server. I then tried to install the shopify-api gem.

Initially I got an error that Ruby was the wrong version. I then had Ruby updated to version 2.1.0.

Now when I try to install the shopify-api gem I get this.

ERROR: Error installing shopify_api: There are no versions of activesupport (< 6, >= 5.0) compatible with your Ruby & RubyGems. Maybe try installing an older version of the gem you're looking for?

activesupport requires Ruby version >= 2.2.2. The current ruby version is 2.1.0.

So from my understanding I should try update Ruby to 2.2.2. However after talking to my host, my cPanel Cent OS server can only work with up to version 2.1.0.

So with this server am I out of luck trying to use the shopify api?

If so, is it possible to make an app using PHP. I saw some PHP wrappers but no one seems to use them.

The best option in such case would be to use different hosting - Ruby 2.1 was released more than 4 years ago and certain libraries won't support it.

If you cannot change hosting, instead you can try using older version of Rails. Versions starting from 5.0.0 require at least Ruby 2.2, however version 4.2.10 should work with Ruby 2.1. To use older version of Rails, you need to update your Gemfile and put gem 'rails', '~> 4.2' there.

Be aware that using such old version of Ruby and Rails means some potential issues - security updates are not release for Ruby 2.1 anymore, some new libraries might not work with Rails 4.2, you'll need to always find a version that supports older Rails. Using another hosting and using new version of Ruby and Rails is strongly recommended.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM