Errors when compiling assets on deployment - ruby

Forgive my tone, but this is an example of a Ruby on Rails issue that really pisses me off.
We have an application in development (specs below). When we deploy to our dev server, we:
svn checkout the branch
bundle install
bundle update
bundle exec rake assets:precompile
On one deploy, all succeeded. About 30 minutes later, there was a commit to the project that was nothing functional (just deleting a config/.yml file from the project). That commit triggered another deploy, and that one failed. Inspecting the log shows what looked like a JS compilation error on a JS file included by a gem. Re-deploying showed another similar error, but for a different file.
None of the files for the project have changed. Most of the gems in our Gemfile are pegged to a specific version, and i inspected the list of gems output from the 'bundle update' deploy process for the deploy that succeeded vs. the one that failed and they are identical.
I'm also including the precompile errors from the log. Any input on where to investigate would be much appreciated.
Application
Ruby 1.9.3
Rails 3.1.11
Gems
Using rake 11.1.2
Using multi_json 1.12.1
Using activesupport 3.1.11
Using builder 3.0.4
Using i18n 0.7.0
Using activemodel 3.1.11
Using erubis 2.7.0
Using rack 1.3.10
Using rack-cache 1.6.1
Using rack-mount 0.8.3
Using rack-test 0.6.3
Using hike 1.2.3
Using tilt 1.3.7
Using sprockets 2.0.5
Using actionpack 3.1.11
Using mime-types 1.25.1
Using polyglot 0.3.5
Using treetop 1.4.15
Using mail 2.3.3
Using actionmailer 3.1.11
Using arel 2.2.3
Using tzinfo 0.3.35
Using activerecord 3.1.11
Using activeresource 3.1.11
Using awesome_print 1.6.1
Using rack-ssl 1.3.4
Using json 1.8.3
Using rdoc 3.12.2
Using thor 0.14.6
Using railties 3.1.11
Using momentjs-rails 2.11.1
Using bootstrap3-datetimepicker-rails 4.17.37
Using bundler 1.10.3
Using coffee-script-source 1.10.0
Using execjs 2.7.0
Using coffee-script 2.4.1
Using coffee-rails 3.1.1
Using dynamic_form 1.1.4
Using fastercsv 1.5.5
Using geocoder 1.0.5
Using hirb 0.7.3
Using jquery-rails 3.1.2
Using jquery-ui-rails 4.1.2
Using jquery_ui_rails_helpers 0.0.4
Using libv8 3.16.14.7
Using mysql2 0.3.20
Using paint 0.9.0
Using pdfkit 0.8.2
Using rack-mini-profiler 0.9.8
Using rails 3.1.11
Using rails-console-tweaks 1.0.2
Using rails3-jquery-autocomplete 1.0.12
Using ref 2.0.0
Using sass 3.4.22
Using sass-rails 3.1.7
Using therubyracer 0.12.2
Using tinymce-rails 4.0.12
Using uglifier 2.7.1
Using will_paginate 3.0.7
Using wirb 1.0.3
Using wirble 0.1.3
Using wkhtmltopdf-binary 0.9.9.3
First Error
rake aborted!
TypeError: wrong argument type Object (expected Data) (in /.../js/jquery.easing.min.js)/.../gems/therubyracer-0.12.2/lib/v8/function.rb:13:in `Call'/.../gems/therubyracer-0.12.2/lib/v8/function.rb:13:in `block (2 levels) in methodcall'/.../gems/therubyracer-0.12.2/lib/v8/error.rb:84:in `block in try'/.../gems/therubyracer-0.12.2/lib/v8/error.rb:83:in `call'/.../gems/therubyracer-0.12.2/lib/v8/error.rb:83
Second Error
(note that this second deploy was manually initiated right after the first, with literally no changes to the code being deployed)
rake aborted!
TypeError: wrong argument type String (expected Data) (in /.../revolution/js/extensions/revolution.extension.video.min.js)

Related

NameError uninitialized constant Aws::STS

Not sure what I'm missing here. As I have two projects. One that works, and one that gives me this error:
NameError (uninitialized constant Aws::STS)
And I don't see a difference, even down to the versions of Ruby gems I'm using.
The list of gems in my WORKING project is:
Using rake 13.0.6
Using concurrent-ruby 1.1.10
Using i18n 1.10.0
Using minitest 5.15.0
Using tzinfo 2.0.4
Using zeitwerk 2.5.4
Using activesupport 6.1.5
Using builder 3.2.4
Using erubi 1.10.0
Using racc 1.6.0
Using nokogiri 1.12.5 (x86_64-linux)
Using rails-dom-testing 2.0.3
Using crass 1.0.6
Using loofah 2.16.0
Using rails-html-sanitizer 1.4.2
Using actionview 6.1.5
Using rack 2.2.3
Using rack-test 1.1.0
Using actionpack 6.1.5
Using nio4r 2.5.8
Using websocket-extensions 0.1.5
Using websocket-driver 0.7.5
Using actioncable 6.1.5
Using globalid 1.0.0
Using activejob 6.1.5
Using activemodel 6.1.5
Using activerecord 6.1.5
Using marcel 1.0.2
Using mini_mime 1.1.2
Using activestorage 6.1.5
Using mail 2.7.1
Using actionmailbox 6.1.5
Using actionmailer 6.1.5
Using actiontext 6.1.5
Using activemodel-serializers-xml 1.0.2
Using activeresource 6.0.0
Using public_suffix 4.0.7
Using addressable 2.8.0
Using aws-eventstream 1.2.0
Using aws-sigv4 1.5.0
Using json 2.6.1
Using ffi 1.15.5
Using ethon 0.15.0
Using typhoeus 1.4.0
Using amz_sp_api 0.2.2
Using awesome_print 1.9.2
Using aws-partitions 1.587.0
Using jmespath 1.6.1
Using aws-sdk-core 3.130.2
Using aws-sdk-signer 1.38.0
Using aws-sdk-sqs 1.51.1
Using bindex 0.8.1
Using msgpack 1.5.1
Using bootsnap 1.11.1
Using browser_sniffer 1.4.0
Using bundler 2.3.4
Using byebug 11.1.3
Using matrix 0.4.2
Using regexp_parser 2.3.0
Using xpath 3.2.0
Using capybara 3.36.0
Using childprocess 4.1.0
Using chronic 0.10.2
Using connection_pool 2.2.5
Using faraday-net_http 2.0.2
Using ruby2_keywords 0.0.5
Using faraday 2.2.0
Using faraday-typhoeus 0.2.0
Using faraday_middleware-aws-sigv4 0.5.0
Using thor 1.2.1
Using figaro 1.2.0
Using graphql 1.13.11
Using graphql-client 0.17.0
Using hashie 5.0.0
Using mime-types-data 3.2022.0105
Using mime-types 3.4.1
Using multi_xml 0.6.0
Using httparty 0.20.0
Using jbuilder 2.11.5
Using jwt 2.3.0
Using rb-fsevent 0.11.1
Using rb-inotify 0.10.1
Using listen 3.7.1
Using method_source 1.0.0
Using money 6.16.0
Using multi_json 1.15.0
Using oauth2 1.4.9
Using rack-protection 2.2.0
Using omniauth 2.0.4
Using omniauth-oauth2 1.7.2
Using omniauth-rails_csrf_protection 1.0.1
Using omniauth-shopify-oauth2 2.3.2
Using pagy 5.10.1
Using pg 1.3.5
Using pg_search 2.3.6
Using puma 4.3.12
Using rack-cors 1.1.1
Using rack-proxy 0.7.2
Using rack-timeout 0.6.3
Using railties 6.1.5
Using sprockets 4.0.3
Using sprockets-rails 3.4.2
Using rails 6.1.5
Using redirect_safely 1.0.0
Using redis 4.6.0
Using rexml 3.2.5
Using rounding 1.0.1
Using ruby-limiter 2.2.2
Using rubyzip 2.3.2
Using tilt 2.0.10
Using sassc-rails 2.1.2
Using sass-rails 6.0.0
Using selenium-webdriver 4.1.0
Using shopify_api 9.5.1
Using shopify_app 18.0.3
Using sidekiq 6.4.1
Using turbolinks-source 5.2.0
Using turbolinks 5.2.1
Using webdrivers 5.0.0
Using webpacker 4.3.0
Using whenever 1.0.0
Then the list of gems in my NON-WORKING project is this:
Using rake 13.0.6
Using concurrent-ruby 1.1.10
Using i18n 1.12.0
Using minitest 5.16.3
Using tzinfo 2.0.5
Using zeitwerk 2.6.0
Using activesupport 6.1.7
Using builder 3.2.4
Using erubi 1.11.0
Using mini_portile2 2.8.0
Using racc 1.6.0
Using nokogiri 1.13.8 (x86_64-linux)
Using rails-dom-testing 2.0.3
Using crass 1.0.6
Using loofah 2.19.0
Using rails-html-sanitizer 1.4.3
Using actionview 6.1.7
Using rack 2.2.4
Using rack-test 2.0.2
Using actionpack 6.1.7
Using nio4r 2.5.8
Using websocket-extensions 0.1.5
Using websocket-driver 0.7.5
Using actioncable 6.1.7
Using globalid 1.0.0
Using activejob 6.1.7
Using activemodel 6.1.7
Using activerecord 6.1.7
Using marcel 1.0.2
Using mini_mime 1.1.2
Using activestorage 6.1.7
Using mail 2.7.1
Using actionmailbox 6.1.7
Using actionmailer 6.1.7
Using actiontext 6.1.7
Using activemodel-serializers-xml 1.0.2
Using activeresource 6.0.0
Using public_suffix 5.0.0
Using addressable 2.8.1
Using aws-eventstream 1.2.0
Using aws-sigv4 1.5.1
Using json 2.6.2
Using ffi 1.15.5
Using ethon 0.15.0
Using typhoeus 1.4.0
Using amz_sp_api 0.2.2
Using awesome_print 1.9.2
Using aws-partitions 1.587.0
Using jmespath 1.6.1
Using aws-sdk-core 3.130.2
Using aws-sdk-signer 1.38.0
Using aws-sdk-sqs 1.51.1
Using aws-sdk-sts 1.7.0
Using bindex 0.8.1
Using msgpack 1.5.6
Using bootsnap 1.13.0
Using browser_sniffer 1.4.0
Using redis 4.8.0
Using brpoplpush-redis_script 0.1.2
Using bundler 2.3.4
Using byebug 11.1.3
Using matrix 0.4.2
Using regexp_parser 2.6.0
Using xpath 3.2.0
Using capybara 3.37.1
Using childprocess 4.1.0
Using chronic 0.10.2
Using numerizer 0.1.1
Using chronic_duration 0.10.6
Using coderay 1.1.3
Using connection_pool 2.3.0
Using multi_json 1.15.0
Using dogapi 1.45.0
Using easypost 4.8.0
Using excon 0.92.5
Using faraday-net_http 3.0.0
Using ruby2_keywords 0.0.5
Using faraday 2.5.2
Using faraday-typhoeus 0.2.1
Using faraday_middleware-aws-sigv4 0.5.0
Using thor 1.2.1
Using figaro 1.2.0
Using graphql 2.0.14
Using graphql-client 0.18.0
Using hashie 5.0.0
Using mime-types-data 3.2022.0105
Using mime-types 3.4.1
Using multi_xml 0.6.0
Using httparty 0.20.0
Using jbuilder 2.11.5
Using jeff 2.0.2
Using jwt 2.5.0
Using rb-fsevent 0.11.2
Using rb-inotify 0.10.1
Using listen 3.7.1
Using method_source 1.0.0
Using money 6.16.0
Using version_gem 1.1.1
Using snaky_hash 2.0.1
Using oauth2 2.0.9
Using rack-protection 3.0.1
Using omniauth 2.1.0
Using omniauth-oauth2 1.8.0
Using omniauth-rails_csrf_protection 1.0.1
Using omniauth-shopify-oauth2 2.3.2
Using pagy 5.10.1
Using peddler 2.4.5
Using pg 1.4.3
Using pg_search 2.3.6
Using pry 0.14.1
Using slop 3.6.0
Using pry-remote 0.1.8
Using puma 4.3.12
Using rack-proxy 0.7.4
Using rack-timeout 0.6.3
Using railties 6.1.7
Using sprockets 4.1.1
Using sprockets-rails 3.4.2
Using rails 6.1.7
Using redirect_safely 1.0.0
Using redis-prescription 1.0.0
Using rexml 3.2.5
Using ruby-limiter 2.2.2
Using rubyzip 2.3.2
Using sassc 2.4.0
Using tilt 2.0.11
Using sassc-rails 2.1.2
Using sass-rails 6.0.0
Using websocket 1.2.9
Using selenium-webdriver 4.5.0
Using shopify_api 9.5.1
Using shopify_app 18.0.3
Using sidekiq 6.5.7
Using sidekiq-status 2.1.3
Using sidekiq-throttled 0.17.0
Using sidekiq-unique-jobs 7.1.27
Using spring 2.1.1
Using spring-watcher-listen 2.0.1
Using turbolinks-source 5.2.0
Using turbolinks 5.2.1
Using web-console 4.2.0
Using webdrivers 5.1.0
Using webpacker 4.3.0
Using whenever 1.0.0
Then the actual code is exactly the same!
module Amazon::GetAwsTempKeyService
module_function
def call
sts_client = Aws::STS::Client.new(
region: "us-east-1", #pretty sure this is just tied to my creds, so this is static
credentials: Aws::Credentials.new(ENV["AWS_CLIENT_ID"], ENV["AWS_CLIENT_SECRET"]) #same here, these are the app's keys
)
sts_client.assume_role({
role_arn: ENV["ROLE_ARN"], #static as this is the role arn associated with my user in AWS
role_session_name: "SPSession"
}).to_h[:credentials]
#this includes the [:access_key_id] [:secret_access_key] AND [:session_token]
end
end
No idea where I went wrong?! I made sure those ENV variables are defined correctly.

How to run a Ruby application in Cloud9 IDE that uses Ruby 2D gem?

I am using Cloud9 IDE and have Ruby gems simple2d and ruby2d installed. I am trying to run this code:
require 'ruby2d'
set width: 300, height: 200
s = Square.new
s.color = 'red'
show
When I run my code, the small terminal at the bottom of the screen says something like "Your code is running at...link_goes_here". Clicking the link takes you to a page very similar to: Ruby on Rails: Welcome Aboard.
I am very new to Ruby, but understand that this page indicates that "additional steps" may need to be taken in order to see your application run (i.e. setting up models, controller, and routes). However, after a little bit of Googling, it seems that people only do these "additional steps" when doing "HTML" related things (please excuse my lack of proper terminology). For example, Getting Started with Rails walks the reader through changing the Ruby on Rails: Welcome Aboard page to say "Hello, Rails" (and then other things after that).
Can someone please explain/show me what to do in order to run my code?
Thanks!
EDIT: 2018-03-27
It appears that I have a Gemfile: Cloud9 IDE Directory
When I ran bundle install I got the following output:
Using rake 12.0.0
Using i18n 0.8.6
Using json 1.8.6
Using minitest 5.10.3
Using thread_safe 0.3.6
Using tzinfo 1.2.3
Using activesupport 4.2.5
Using builder 3.2.3
Using erubis 2.7.0
Using mini_portile2 2.2.0
Using nokogiri 1.8.0
Using rails-deprecated_sanitizer 1.0.3
Using rails-dom-testing 1.0.8
Using loofah 2.0.3
Using rails-html-sanitizer 1.0.3
Using actionview 4.2.5
Using rack 1.6.8
Using rack-test 0.6.3
Using actionpack 4.2.5
Using globalid 0.4.0
Using activejob 4.2.5
Using mime-types-data 3.2016.0521
Using mime-types 3.1
Using mail 2.6.6
Using actionmailer 4.2.5
Using activemodel 4.2.5
Using arel 6.0.4
Using activerecord 4.2.5
Using debug_inspector 0.0.3
Using binding_of_caller 0.7.2
Using bundler 1.16.1
Using byebug 9.1.0
Using coffee-script-source 1.12.2
Using execjs 2.7.0
Using coffee-script 2.4.1
Using thor 0.20.0
Using railties 4.2.5
Using coffee-rails 4.1.1
Using concurrent-ruby 1.0.5
Using ffi 1.9.18
Using multi_json 1.12.1
Using jbuilder 2.7.0
Using jquery-rails 4.3.1
Using sprockets 3.7.1
Using sprockets-rails 3.2.0
Using rails 4.2.5
Using rb-fsevent 0.10.2
Using rb-inotify 0.9.10
Using rdoc 4.3.0
Using sass-listen 4.0.0
Using sass 3.5.1
Using tilt 2.0.8
Using sass-rails 5.0.6
Using sdoc 0.4.2
Using spring 2.0.2
Using sqlite3 1.3.13
Using turbolinks-source 5.0.3
Using turbolinks 5.0.1
Using uglifier 3.2.0
Using web-console 2.3.0
Bundle complete! 12 Gemfile dependencies, 60 gems now installed.
Use bundle info [gemname] to see where a bundled gem is installed.
I still run into the same issue when trying to run my code.

Push to heroku fails: revealed dependencies not in the API or the lockfile

I can't push to heroku.
The bundler has found unmet dependencies of nokogiri 1.6.8.1.
$ git push heroku master
....
remote: The latest bundler is 1.15.4, but you are currently running 1.15.2.
remote: To update, run `gem install bundler`
remote: Downloading nokogiri-1.6.8.1 revealed dependencies not in the API or the
remote: lockfile (mini_portile2 (~> 2.1.0)).
remote: Either installing with `--full-index` or running `bundle update nokogiri` should
remote: fix the problem.
remote: !
remote: ! Failed to install gems via Bundler.
remote: !
remote: ! Push rejected, failed to compile Ruby app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to digitreco.
I am on the Heroku -16 stack. I tried downgrading nokogiri to 1.5.9 in the Gemfile but it resolves to 1.6.0 due to other dependencies.
Any help is appreciated.
I have a solution for the second problem (the nokogiri & mini_portile2 file mismatch).
gem install nokogiri # step 1
bundle install # step 2
bundle update # step 3
bundle install # step 4
bundle install # step 5
bundle update # step 6
git commit -a -m "Fix nokogiri and mini_portile2 problem" # step 7
git push # step 8
git push heroku master # step 9
Steps 2 through 6 are repetitiously redundant, but I am just retracing my steps via my bash history.
I do not have a solution for your first problem, but once I solved the second problem, the first problem was just a warning.
I hope this works for you.
-Ben
Actually the Benjamin solution worked for me. But just running:
$ gem install nokogiri
Fetching: mini_portile2-2.3.0.gem (100%)
Successfully installed mini_portile2-2.3.0
Fetching: nokogiri-1.8.2.gem (100%)
Building native extensions. This could take a while...
Successfully installed nokogiri-1.8.2
2 gems installed
$ bundle update
Fetching gem metadata from https://rubygems.org/.........
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies.....
Using rake 12.3.1
Using concurrent-ruby 1.0.5
Using i18n 1.0.0
Using minitest 5.11.3
Using thread_safe 0.3.6
Using tzinfo 1.2.5
Using activesupport 5.2.0
Using builder 3.2.3
Using erubi 1.7.1
Using mini_portile2 2.3.0
Using nokogiri 1.8.2
Using rails-dom-testing 2.0.3
Using crass 1.0.4
Using loofah 2.2.2
Using rails-html-sanitizer 1.0.4
Using actionview 5.2.0
Using rack 2.0.4
Using rack-test 1.0.0
Using actionpack 5.2.0
Using nio4r 2.3.0
Using websocket-extensions 0.1.3
Using websocket-driver 0.7.0
Using actioncable 5.2.0
Using globalid 0.4.1
Using activejob 5.2.0
Using mini_mime 1.0.0
Using mail 2.7.0
Using actionmailer 5.2.0
Using activemodel 5.2.0
Using arel 9.0.0
Using activerecord 5.2.0
Using mimemagic 0.3.2
Using marcel 0.3.2
Using activestorage 5.2.0
Using public_suffix 3.0.2
Using addressable 2.5.2
Using io-like 0.3.0
Using archive-zip 0.11.0
Using execjs 2.7.0
Using autoprefixer-rails 8.2.0
Using bcrypt 3.1.11
Using bindex 0.5.0
Using msgpack 1.2.4
Using bootsnap 1.3.0
Using popper_js 1.12.9
Using rb-fsevent 0.10.3
Using ffi 1.9.23
Using rb-inotify 0.9.10
Using sass-listen 4.0.0
Using sass 3.5.6
Using bootstrap 4.0.0
Using bundler 1.16.1
Using byebug 10.0.2
Using xpath 3.0.0
Using capybara 3.0.1
Using childprocess 0.9.0
Using chromedriver-helper 1.2.0
Using coffee-script-source 1.12.2
Using coffee-script 2.4.1
Using method_source 0.9.0
Using thor 0.20.0
Using railties 5.2.0
Using coffee-rails 4.2.2
Using temple 0.8.0
Using tilt 2.0.8
Using haml 5.0.4
Using multi_json 1.13.1
Using jbuilder 2.7.0
Using jquery-rails 4.3.1
Using listen 3.1.5
Using pg 1.0.0
Using puma 3.11.3
Using sprockets 3.7.1
Using sprockets-rails 3.2.1
Using rails 5.2.0
Using rubyzip 1.2.1
Using sass-rails 5.0.7
Using selenium-webdriver 3.11.0
Using spring 2.0.2
Using spring-watcher-listen 2.0.1
Using turbolinks-source 5.1.0
Using turbolinks 5.1.1
Using uglifier 4.1.9
Using web-console 3.6.0
Bundle updated!
after running those commands it changed my Gemfile.lock:
diff --git a/Gemfile.lock b/Gemfile.lock
index 49818a3..0ad5e64 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
## -110,11 +110,13 ## GEM
method_source (0.9.0)
mimemagic (0.3.2)
mini_mime (1.0.0)
mini_portile2 (2.3.0)
minitest (5.11.3)
msgpack (1.2.4)
multi_json (1.13.1)
nio4r (2.3.0)
nokogiri (1.8.2)
mini_portile2 (~> 2.3.0)
pg (1.0.0)
popper_js (1.12.9)
public_suffix (3.0.2)
With Color, for easier reading
1)run $sudo apt-get install libsqlite3-dev
if it responds: E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem. then run $sudo dpkg --configure -a
2)run $rails s if it responds: Downloading nokogiri-1.10.0 revealed dependencies not in the API or the lockfile (mini_portile2 (~> 2.4.0)). Either installing with --full-index or running bundle update nokogiri should fix the problem.
3)run $ bundle update nokogiri and all will be perfect again!
4) start server again and voila!

How to debug Middleman 3 gem installation issues on Windows.

I have installed Middleman 3.1.5 as described on my Windows 8 Machnine along with Ruby using rubyinstaller-2.0.0-p247.exe and followed the steps to get started with success. I am now building my first site with some success (coding some pages, starting the server, building the site) but when I try to use some advanced third party components like middleman-navigation or middleman-deploy I seem to hit a wall. At first I thought of a mistake by myself but as more and more things seem to be buggy I want to figure out what is wrong with my setup or at least confirm nothing is.
Some example output that seems buggy to me:
$ middleman help
WARN: Unresolved specs during Gem::Specification.reset:
rack (>= 1.0, >= 1.4.5)
thor (< 2.0, >= 0.15.2)
activesupport (~> 3.2.6)
listen (~> 1.2.2)
i18n (~> 0.6.1)
WARN: Clearing out unresolved specs.
Please report a bug if this causes problems.
Tasks:
...
When i try to install middleman-deploy as described, adding gem "middleman-deploy" to my Gemfile and run bundle install there is no indication that anything changed:
$ bundle install
Using i18n (0.6.5)
Using multi_json (1.8.0)
Using activesupport (3.2.14)
Using chunky_png (1.2.8)
Using coffee-script-source (1.6.3)
Using execjs (1.4.0)
Using coffee-script (2.2.0)
Using fssm (0.2.10)
Using sass (3.2.10)
Using compass (0.12.2)
Using eventmachine (1.0.3)
Using http_parser.rb (0.5.3)
Using em-websocket (0.5.0)
Using ffi (1.9.0)
Using tilt (1.3.7)
Using haml (4.0.3)
Using hike (1.2.3)
Using kramdown (1.1.0)
Using rb-fsevent (0.9.3)
Using rb-inotify (0.9.2)
Using rb-kqueue (0.2.0)
Using listen (1.2.3)
Using bundler (1.3.5)
Using rack (1.5.2)
Using rack-test (0.6.2)
Using thor (0.18.1)
Using middleman-core (3.1.5)
Using middleman-more (3.1.5)
Using sprockets (2.10.0)
Using sprockets-helpers (1.0.1)
Using sprockets-sass (1.0.1)
Using middleman-sprockets (3.1.4)
Using uglifier (2.1.2)
Using middleman (3.1.5)
Using rack-livereload (0.3.15)
Using middleman-livereload (3.1.0)
Using wdm (0.1.0)
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.
I then add a configuration to config.rb and try to use the gem without success:
$ middleman deploy
WARN: Unresolved specs during Gem::Specification.reset:
rack (>= 1.0, >= 1.4.5)
thor (< 2.0, >= 0.15.2)
multi_json (~> 1.0)
rb-inotify (>= 0.9)
WARN: Clearing out unresolved specs.
Please report a bug if this causes problems.
There's no 'deploy' command for Middleman. Try 'middleman help' for a list of commands.
Please help me to narrow down the cause of these issues.
I had a similar WARN: Unresolved specs during Gem::Specification.reset: message when I did middleman build I'm on a Mac using rvm with ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-darwin12.3.0]. I found an issue post on GitHub with a similar WARN and the fix was to run gem regenerate_binstubs. It cleared the WARN for me. I'm not sure exactly what that does but it clears up a few issues with rubygems-bundler.

ruby 1.9.2 strange warning when running cucumber specs

I just updated to try rails 3, using rvm with ruby 1.9.2-p0.
When I run my cucumber specs then I get following strange warnings
/home/ubuntu/.rvm/gems/ruby-1.9.2-p0/gems/rack-1.2.1/lib/rack/utils.rb:16: warning: regexp match /.../n against to UTF-8 string
/home/ubuntu/.rvm/gems/ruby-1.9.2-p0/gems/rack-1.2.1/lib/rack/utils.rb:16: warning: regexp match /.../n against to UTF-8 string
/home/ubuntu/.rvm/gems/ruby-1.9.2-p0/gems/rack-1.2.1/lib/rack/utils.rb:16: warning: regexp match /.../n against to UTF-8 string
My bundle contains following gems...
Using rake (0.8.7)
Using abstract (1.0.0)
Using activesupport (3.0.0)
Using builder (2.1.2)
Using i18n (0.4.1)
Using activemodel (3.0.0)
Using erubis (2.6.6)
Using rack (1.2.1)
Using rack-mount (0.6.13)
Using rack-test (0.5.4)
Using tzinfo (0.3.23)
Using actionpack (3.0.0)
Using mime-types (1.16)
Using polyglot (0.3.1)
Using treetop (1.4.8)
Using mail (2.2.5)
Using actionmailer (3.0.0)
Using arel (1.0.1)
Using activerecord (3.0.0)
Using activeresource (3.0.0)
Using bundler (1.0.0)
Using culerity (0.2.12)
Using nokogiri (1.4.3.1)
Using ffi (0.6.3)
Using json_pure (1.4.6)
Using rubyzip (0.9.4)
Using selenium-webdriver (0.0.28)
Using capybara (0.3.9)
Using configuration (1.1.0)
Using diff-lcs (1.1.2)
Using trollop (1.16.2)
Using gherkin (2.1.5)
Using term-ansicolor (1.0.5)
Using cucumber (0.8.5)
Using cucumber-rails (0.3.2)
Using database_cleaner (0.5.2)
Using launchy (0.3.7)
Using mysql2 (0.2.3)
Using rspec-core (2.0.0.beta.20)
Using rspec-expectations (2.0.0.beta.20)
Using rspec-mocks (2.0.0.beta.20)
Using rspec (2.0.0.beta.20)
Using yard (0.6.0)
Using pickle (0.4.2)
Using thor (0.14.0)
Using railties (3.0.0)
Using rails (3.0.0)
Using rspec-rails (2.0.0.beta.20)
Using spork (0.8.4)
Using webrat (0.7.1)
does anyone know how to get rid of these warnings? And where they are coming from?
There is a good solution available to this that I found on a blog post by Enrico Stahn:
http://blog.enricostahn.com/warning-regexp-match-n-against-to-utf-8-strin
The problem is in Rack and has apparently already been fixed in 1.3.0 but you may not be able to upgrade to it yet.
So until you can upgrade to Rack 1.3.0, create the file config/initializers/rack_hotfix.rb with the following content:
# TODO: Can be removed after updating to rack 1.3.0
module Rack
module Utils
def escape(s)
CGI.escape(s.to_s)
end
def unescape(s)
CGI.unescape(s)
end
end
end
This worked a charm for me and then I supplemented it with a pending test to on of my RSpec files as a gentle reminder to drop the initializer once Rack's been upgraded.
describe ApplicationController do
...
it "should not include the rack_hotfix.rb initializer after upgrading to rack 1.3.0"
end
See:
https://github.com/jnicklas/capybara/issues/87 and https://github.com/jnicklas/capybara/issues/243
for some discussion of the issue. The resolution seems to be that both Capybara and Rack needed to change some things to arrive at a good solution.
If I'm understanding correctly, Rack 1.3 and Capybara 1.0 should solve the issue. At the moment though, Rails 3.0.8 still requires Rack ~> 1.2.1, ignoring Rack 1.3 even if you have it installed. So I think Rails (specifically actionpack) will need to upgrade its dependency to have a clean fix.
There is a gem called "escape_utils" that takes care of this problem. Here is the link to an article explaining the problem.
Add this to a file in features/support or put it in the env.rb file:
# Stop endless errors like
# ~/.rvm/gems/ruby-1.9.2-p0#global/gems/rack-1.2.1/lib/rack/utils.rb:16:
# warning: regexp match /.../n against to UTF-8 string
$VERBOSE = nil
This will suppress those warnings, though I am not sure what is causing them in the first place. I am getting them, also
Maybe your scripts are encoded in ASCII or a different format from UTF-8?

Resources