Note that there are some explanatory texts on larger screens.

plurals
  1. POerror ruby "TypeError - can't dup Symbol" in code
    primarykey
    data
    text
    <p>have issue with code that rise just now but work before i got this code:</p> <ol> <li><p>Controller</p> <pre><code>def new errors ||= Array.new if params[:file].blank? errors.push(I18n.t("errors.messages.file_error")) end if errors.length == 0 # begin # binding.pry assetObject = Assets.new(:asset=&gt;params[:file]) assetObject.save! image = assetObject.asset.url(:small) imageExpBanner = assetObject.asset.url(:expBanner) data = OpenStruct.new({ id: assetObject.id, uri: image, expBannerUri: imageExpBanner }) @responseObject = OpenStruct.new({ status: true, errors: [], code: API_CODE_ERRORS['Services']['Global']['success'], objectData: data }) render :template =&gt; 'api/v1/general/assets/new' ,:handlers =&gt; [:rabl],:formats =&gt; [:json] #rescue =&gt; e # binding.pry # logger.error e # errors.push(I18n.t("errors.messages.file_size_error")) # render :json =&gt; Api::Init.ShowErrorJson(API_CODE_ERRORS['Services']['Global']['file_size'],I18n.t("errors.messages.feelike.input_error"), errors).to_json # end else render :json =&gt; Api::Init.ShowErrorJson(API_CODE_ERRORS['Services']['Global']['formInputError'],I18n.t("errors.messages.feelike.input_error"), errors).to_json end </code></pre> <p>end</p></li> <li><p>Model</p></li> </ol> <p>class Assets &lt; ActiveRecord::Base</p> <pre><code> attr_accessible :asset,:asset_content_type, :asset_file_name, :asset_file_size has_attached_file :asset, :styles =&gt; { :small =&gt; "150x150&gt;" , :expBanner =&gt; "620x184", :expBigImage =&gt; "304X304", :expSmallImage =&gt; "148X148", :storage =&gt; :s3, :s3_credentials =&gt; "#{Rails.root}/config/s3.yml", :path =&gt; "/uploads/:style/:id/:hash.:extension", :url =&gt; :s3_eu_url , :hash_secret =&gt; "longSecretString" } validates :asset, :attachment_presence =&gt; true validates_attachment_size :asset, :less_than =&gt; 10.megabytes validates_attachment_content_type :asset, :content_type =&gt; ['image/jpeg','image/gif', 'image/png'] end </code></pre> <p>now its return me this error: </p> <pre><code>Started POST "/api/general/assets/new" for 127.0.0.1 at 2013-03-28 11:32:19 +0200 Processing by Api::V1::General::AssetsController#new as JSON Parameters: {"file"=&gt;#&lt;ActionDispatch::Http::UploadedFile:0x007fc39853ac10 @original_filename="usidentification.jpg", @content_type="image/jpeg", @headers="Content-Disposition: form-data; name=\"file\"; filename=\"usidentification.jpg\"\r\nContent-Type: image/jpeg\r\n", @tempfile=#&lt;File:/tmp/RackMultipart20130328-15640-1hdj5ee&gt;&gt;} WARNING: Can't verify CSRF token authenticity Completed 500 Internal Server Error in 3491ms TypeError - can't dup Symbol: (gem) paperclip-3.4.0/lib/paperclip/attachment.rb:176:in `block in styles' (gem) paperclip-3.4.0/lib/paperclip/attachment.rb:175:in `styles' (gem) paperclip-3.4.0/lib/paperclip/attachment.rb:421:in `post_process_styles' (gem) paperclip-3.4.0/lib/paperclip/attachment.rb:415:in `block (2 levels) in post_process' /usr/local/rvm/gems/ruby-1.9.3-p327@global/gems/activesupport-3.2.9/lib/active_support/callbacks.rb:403:in `_run__3148635882202100687__asset_post_process__2098004068316531280__callbacks' /usr/local/rvm/gems/ruby-1.9.3-p327@global/gems/activesupport-3.2.9/lib/active_support/callbacks.rb:405:in `__run_callback' /usr/local/rvm/gems/ruby-1.9.3-p327@global/gems/activesupport-3.2.9/lib/active_support/callbacks.rb:385:in `_run_asset_post_process_callbacks' /usr/local/rvm/gems/ruby-1.9.3-p327@global/gems/activesupport-3.2.9/lib/active_support/callbacks.rb:81:in `run_callbacks' (gem) paperclip-3.4.0/lib/paperclip/callbacks.rb:26:in `run_paperclip_callbacks' (gem) paperclip-3.4.0/lib/paperclip/attachment.rb:414:in `block in post_process' /usr/local/rvm/gems/ruby-1.9.3-p327@global/gems/activesupport-3.2.9/lib/active_support/callbacks.rb:403:in `_run__3148635882202100687__post_process__2098004068316531280__callbacks' /usr/local/rvm/gems/ruby-1.9.3-p327@global/gems/activesupport-3.2.9/lib/active_support/callbacks.rb:405:in `__run_callback' /usr/local/rvm/gems/ruby-1.9.3-p327@global/gems/activesupport-3.2.9/lib/active_support/callbacks.rb:385:in `_run_post_process_callbacks' /usr/local/rvm/gems/ruby-1.9.3-p327@global/gems/activesupport-3.2.9/lib/active_support/callbacks.rb:81:in `run_callbacks' (gem) paperclip-3.4.0/lib/paperclip/callbacks.rb:26:in `run_paperclip_callbacks' (gem) paperclip-3.4.0/lib/paperclip/attachment.rb:413:in `post_process' (gem) paperclip-3.4.0/lib/paperclip/attachment.rb:108:in `assign' </code></pre> <p>now what dose it means TypeError - can't dup Symbol now i try few ways fix at and got this every time need help in this </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