Note that there are some explanatory texts on larger screens.

plurals
  1. POshopify_app syntax error
    primarykey
    data
    text
    <p><strong>Edit: Debugging has got me further. Question clarified.</strong></p> <p>We have installed Ruby, RubyGems and Rails and have forked the shopify_app project. We have created a new rails applications and added three items to the Gemfile: <code>execjs</code>, <code>therubyracer</code> and <code>shopify_app</code>.</p> <p>Running <code>rails s</code> in order to start our rails application returns this trace:</p> <pre><code>root@ubuntu:/usr/local/pete-shopify/cart# rails s Faraday: you may want to install system_timer for reliable timeouts /var/lib/gems/1.8/gems/shopify_app-4.1.0/lib/shopify_app.rb:15:in `require': /var/lib /gems/1.8/gems/shopify_app-4.1.0/lib/shopify_app/login_protection.rb:5: syntax error, unexpected ':', expecting kEND (SyntaxError) ...rce::UnauthorizedAccess, with: :close_session ^ from /var/lib/gems/1.8/gems/shopify_app-4.1.0/lib/shopify_app.rb:15 from /var/lib/gems/1.8/gems/bundler-1.2.1/lib/bundler/runtime.rb:68:in `require' from /var/lib/gems/1.8/gems/bundler-1.2.1/lib/bundler/runtime.rb:68:in `require' from /var/lib/gems/1.8/gems/bundler-1.2.1/lib/bundler/runtime.rb:66:in `each' from /var/lib/gems/1.8/gems/bundler-1.2.1/lib/bundler/runtime.rb:66:in `require' from /var/lib/gems/1.8/gems/bundler-1.2.1/lib/bundler/runtime.rb:55:in `each' from /var/lib/gems/1.8/gems/bundler-1.2.1/lib/bundler/runtime.rb:55:in `require' from /var/lib/gems/1.8/gems/bundler-1.2.1/lib/bundler.rb:128:in `require' from /usr/local/pete-shopify/cart/config/application.rb:7 from /var/lib/gems/1.8/gems/railties-3.2.8/lib/rails/commands.rb:53:in `require' from /var/lib/gems/1.8/gems/railties-3.2.8/lib/rails/commands.rb:53 from /var/lib/gems/1.8/gems/railties-3.2.8/lib/rails/commands.rb:50:in `tap' from /var/lib/gems/1.8/gems/railties-3.2.8/lib/rails/commands.rb:50 from script/rails:6:in `require' from script/rails:6 </code></pre> <p>I haven't modified any files since forking from Github. Lines 1 - 6 of login_protection.rb are as follows:</p> <pre><code>module ShopifyApp::LoginProtection extend ActiveSupport::Concern included do rescue from ActiveResource::UnauthorizedAccess, with: :close_session end </code></pre> <p>I've looked into this and it <strong>seems</strong> that the error is caused by a new-style hash syntax between Ruby 1.8 and 1.9; <code>key : value</code> instead of <code>key =&gt; value</code>.</p> <p>Running <code>ruby -v</code> from the command line returns <code>ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux]</code>. This would seem to be OK... but I did some debugging, and inside the file <code>/var/lib/gems/1.8/gems/shopify_app-4.1.0/lib/shopify_app.rb</code> (at the top) by putting this:</p> <p>puts RUBY_VERSION exit</p> <p>It printed <code>1.8.7</code>. **Why are <code>ruby -v</code> and <code>RUBY_VERSION</code> giving me different results? And am I correct in assuming this is the cause of my problems?</p> <p>Note: To upgrade Ruby I installed the later version with <code>apt-get</code> and then switched to it by using <code>update-alternatives --config ruby</code> and selecting option 2 like this:</p> <pre><code>root@ubuntu:/usr/local/pete-shopify/cart# update-alternatives --config ruby There are 2 choices for the alternative ruby (providing /usr/bin/ruby). Selection Path Priority Status ------------------------------------------------------------ 0 /usr/bin/ruby1.8 50 auto mode 1 /usr/bin/ruby1.8 50 manual mode * 2 /usr/bin/ruby1.9.1 10 manual mode </code></pre> <p>Also note: We're PHP/Python developers so this is all new to us!</p> <p><strong>Summary:</strong></p> <p><strong>1 - Am I right in determining the cause of the syntax error?</strong></p> <p><strong>2 - Why does <code>RUBY_VERSION</code> and <code>ruby -v</code> give me different results?</strong></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload