I have upgraded my ruby version to ruby ruby 2.4.2p198 (2017-09-14 revision 59899) [x86_64-darwin19]
When I run bundle to update my gems, I get next error that I have no idea what to do with:
bundle
Fetching gem metadata from http://rubygems.org/..............
Fetching https://github.com/stripe/stripe-ruby
Fetching rake 10.1.0
Installing rake 10.1.0
Fetching i18n 0.6.5
Installing i18n 0.6.5
Fetching minitest 4.7.5
Installing minitest 4.7.5
Fetching multi_json 1.14.1
Installing multi_json 1.14.1
Fetching atomic 1.1.14
Installing atomic 1.1.14 with native extensions
Fetching thread_safe 0.1.3
Installing thread_safe 0.1.3
Fetching tzinfo 0.3.37
Installing tzinfo 0.3.37
Fetching activesupport 4.0.0
Installing activesupport 4.0.0
Fetching builder 3.1.4
Installing builder 3.1.4
Fetching erubis 2.7.0
Installing erubis 2.7.0
Fetching rack 1.5.2
Installing rack 1.5.2
Fetching rack-test 0.6.2
Installing rack-test 0.6.2
Fetching actionpack 4.0.0
Installing actionpack 4.0.0
Fetching mime-types 1.25
Installing mime-types 1.25
Fetching polyglot 0.3.3
Installing polyglot 0.3.3
Fetching treetop 1.4.15
Installing treetop 1.4.15
Fetching mail 2.5.4
Installing mail 2.5.4
Fetching actionmailer 4.0.0
Installing actionmailer 4.0.0
Fetching activemodel 4.0.0
Installing activemodel 4.0.0
Fetching activerecord-deprecated_finders 1.0.3
Installing activerecord-deprecated_finders 1.0.3
Fetching arel 4.0.0
Installing arel 4.0.0
Fetching activerecord 4.0.0
Installing activerecord 4.0.0
Fetching addressable 2.3.6
Installing addressable 2.3.6
Fetching gyoku 1.3.1
Installing gyoku 1.3.1
Fetching mini_portile 0.5.3
Installing mini_portile 0.5.3
Fetching nokogiri 1.6.1
Installing nokogiri 1.6.1 with native extensions
Fetching akami 1.3.1
Installing akami 1.3.1
Using bundler 1.17.3
Fetching chronic 0.10.2
Installing chronic 0.10.2
Fetching coffee-script-source 1.6.3
Installing coffee-script-source 1.6.3
Fetching execjs 2.0.1
Installing execjs 2.0.1
Fetching coffee-script 2.2.0
Installing coffee-script 2.2.0
Fetching thor 0.18.1
Installing thor 0.18.1
Fetching railties 4.0.0
Installing railties 4.0.0
Fetching coffee-rails 4.0.0
Installing coffee-rails 4.0.0
Fetching css_parser 1.3.5
Installing css_parser 1.3.5
Fetching hike 1.2.3
Installing hike 1.2.3
Fetching htmlentities 4.3.2
Installing htmlentities 4.3.2
Fetching httpi 2.4.1
Installing httpi 2.4.1
Fetching jbuilder 1.5.1
Installing jbuilder 1.5.1
Fetching jquery-rails 3.0.4
Installing jquery-rails 3.0.4
Fetching json 1.8.1
Installing json 1.8.1 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /Users/Rober/.rvm/rubies/ruby-2.4.2/lib/ruby/gems/2.4.0/gems/json-1.8.1/ext/json/ext/generator
/Users/Rober/.rvm/rubies/ruby-2.4.2/bin/ruby -I /Users/Rober/.rvm/rubies/ruby-2.4.2/lib/ruby/site_ruby/2.4.0 -r ./siteconf20191125-59844-rge3ax.rb extconf.rb
creating Makefile
current directory: /Users/Rober/.rvm/rubies/ruby-2.4.2/lib/ruby/gems/2.4.0/gems/json-1.8.1/ext/json/ext/generator
make "DESTDIR=" clean
current directory: /Users/Rober/.rvm/rubies/ruby-2.4.2/lib/ruby/gems/2.4.0/gems/json-1.8.1/ext/json/ext/generator
make "DESTDIR="
compiling generator.c
In file included from generator.c:1:
./../fbuffer/fbuffer.h:175:47: error: too few arguments provided to function-like macro invocation
VALUE result = rb_str_new(FBUFFER_PAIR(fb));
^
/Users/Rober/.rvm/rubies/ruby-2.4.2/include/ruby-2.4.0/ruby/intern.h:795:9: note: macro 'rb_str_new' defined here
#define rb_str_new(str, len) RB_GNUC_EXTENSION_BLOCK( \
^
In file included from generator.c:1:
./../fbuffer/fbuffer.h:175:11: warning: incompatible pointer to integer conversion initializing 'VALUE' (aka 'unsigned long') with an expression of type 'VALUE (const char *,
long)' (aka 'unsigned long (const char *, long)') [-Wint-conversion]
VALUE result = rb_str_new(FBUFFER_PAIR(fb));
^ ~~~~~~~~~~
generator.c:840:25: error: use of undeclared identifier 'rb_cFixnum'
} else if (klass == rb_cFixnum) {
^
generator.c:842:25: error: use of undeclared identifier 'rb_cBignum'
} else if (klass == rb_cBignum) {
^
1 warning and 3 errors generated.
make: *** [generator.o] Error 1
make failed, exit code 2
Gem files will remain installed in /Users/Rober/.rvm/rubies/ruby-2.4.2/lib/ruby/gems/2.4.0/gems/json-1.8.1 for inspection.
Results logged to /Users/Rober/.rvm/rubies/ruby-2.4.2/lib/ruby/gems/2.4.0/extensions/x86_64-darwin-19/2.4.0/json-1.8.1/gem_make.out
An error occurred while installing json (1.8.1), and Bundler cannot continue.
Make sure that `gem install json -v '1.8.1' --source 'http://rubygems.org/'` succeeds before bundling.
In Gemfile:
sdoc was resolved to 0.3.20, which depends on
rdoc was resolved to 3.12.2, which depends on
json
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.
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!
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)
How do I check the dependencies of an older version of a gem? The 'gem dependency' command appears to only work with the newest version, despite having a -v option (version) in the 'gem help dependency' page.
Here's a list of all the available versions:
gem list -all -r activesupport
*** REMOTE GEMS ***
activesupport (3.2.3, 3.2.2, 3.2.1, 3.2.0, 3.1.4, 3.1.3, 3.1.2, 3.1.1, 3.1.0, 3.0.12, 3.0.11, 3.0.10, 3.0.9, 3.0.8, 3.0.7, 3.0.6, 3.0.5, 3.0.4, 3.0.3, 3.0.2, 3.0.1, 3.0.0, 2.3.14, 2.3.12, 2.3.11, 2.3.10, 2.3.9, 2.3.8, 2.3.7, 2.3.6, 2.3.5, 2.3.4, 2.3.3, 2.3.2, 2.2.3, 2.2.2, 2.1.2, 2.1.1, 2.1.0, 2.0.5, 2.0.4, 2.0.2, 2.0.1, 2.0.0, 1.4.4, 1.4.3, 1.4.2, 1.4.1, 1.4.0, 1.3.1, 1.3.0, 1.2.5, 1.2.4, 1.2.3, 1.2.2, 1.2.1, 1.1.1, 1.1.0, 1.0.4, 1.0.3, 1.0.2, 1.0.1, 1.0.0)
activesupport-cascadestore (0.0.2, 0.0.1)
However, I can't seem to get the dependencies for older versions of the gem.
gem dependency activesupport -r -v 3.2.3
Gem activesupport-3.2.3
i18n (~> 0.6, runtime)
multi_json (~> 1.0, runtime)
gem dependency activesupport -r -v 1.4.2
No gems found matching activesupport (= 1.4.2)
gem dependency activesupport -r -v 1.4.1
No gems found matching activesupport (= 1.4.1)
..and here's a post circa 2009 that encounters the same problem:
http://www.ruby-forum.com/topic/194703
relevant: http://xkcd.com/979/
Does anybody have an alternate way to check the dependencies of an older version of a gem?
EDIT: Still looking for a way to find all dependencies of a an older version of a gem.
Well, it is not as convenient as using RubyGems through the command line, but you can find that information on RubyGems.org when browsing through gems.
For example, ActiveSupport 3.2.0.rc1 introduced a dependency on i18n, while 3.1.0.beta1 introduced the dependency on multi_json.