Error while installing Rails on Mac - ruby-on-rails

After I install Rails and I run rails server for a cloned repository that runs on RoR I see:
Rails is not currently installed on this system. To get the latest version, simply type:
$ sudo gem install rails
You can then rerun your "rails" command.
Right before this I installed Rails which according to terminal was correctly installed.
The command I had run was sudo gem install rails -V. To which I get:
HEAD https://rubygems.org/latest_specs.4.8.gz
302 Moved Temporarily
HEAD https://s3.amazonaws.com/production.s3.rubygems.org/latest_specs.4.8.gz
200 OK
GET https://rubygems.org/latest_specs.4.8.gz
302 Moved Temporarily
GET https://s3.amazonaws.com/production.s3.rubygems.org/latest_specs.4.8.gz
200 OK
HEAD https://rubygems.org/specs.4.8.gz
302 Moved Temporarily
HEAD https://s3.amazonaws.com/production.s3.rubygems.org/specs.4.8.gz
200 OK
GET https://rubygems.org/specs.4.8.gz
302 Moved Temporarily
GET https://s3.amazonaws.com/production.s3.rubygems.org/specs.4.8.gz
200 OK
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/README.md
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/akshaysurve.jpg
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/belongs_to.png
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/book_icon.gif
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/bullet.gif
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/chapters_icon.gif
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/check_bullet.gif
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/credits_pic_blank.gif
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/csrf.png
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/edge_badge.png
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/favicon.ico
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/feature_tile.gif
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/footer_tile.gif
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/fxn.png
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/getting_started/challenge.png
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/getting_started/confirm_dialog.png
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/getting_started/forbidden_attributes_for_new_post.png
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/getting_started/form_with_errors.png
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/getting_started/index_action_with_edit_link.png
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/getting_started/new_post.png
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/getting_started/post_with_comments.png
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/getting_started/rails_welcome.png
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/getting_started/routing_error_no_controller.png
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/getting_started/routing_error_no_route_matches.png
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/getting_started/show_action_for_posts.png
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/getting_started/template_is_missing_posts_new.png
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/getting_started/undefined_method_post_path.png
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/getting_started/unknown_action_create_for_posts.png
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/getting_started/unknown_action_new_for_posts.png
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/grey_bullet.gif
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/habtm.png
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/has_many.png
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/has_many_through.png
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/has_one.png
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/has_one_through.png
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/header_backdrop.png
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/header_tile.gif
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/i18n/demo_html_safe.png
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/i18n/demo_localized_pirate.png
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/i18n/demo_translated_en.png
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/i18n/demo_translated_pirate.png
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/i18n/demo_translation_missing.png
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/i18n/demo_untranslated.png
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/icons/callouts/1.png
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/icons/callouts/10.png
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/icons/callouts/11.png
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/icons/callouts/12.png
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/icons/callouts/13.png
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/icons/callouts/14.png
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/icons/callouts/15.png
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/icons/callouts/2.png
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/icons/callouts/3.png
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/icons/callouts/4.png
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/icons/callouts/5.png
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/icons/callouts/6.png
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/icons/callouts/7.png
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/icons/callouts/8.png
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/icons/callouts/9.png
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/icons/caution.png
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/icons/example.png
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/icons/home.png
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/icons/important.png
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/icons/next.png
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/icons/note.png
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/icons/prev.png
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/icons/README
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/icons/tip.png
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/icons/up.png
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/icons/warning.png
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/jaimeiniesta.jpg
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/nav_arrow.gif
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/oscardelben.jpg
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/polymorphic.png
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/radar.png
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/rails4_features.png
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/rails_guides_kindle_cover.jpg
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/rails_guides_logo.gif
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/rails_logo_remix.gif
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/session_fixation.png
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/tab_grey.gif
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/tab_info.gif
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/tab_note.gif
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/tab_red.gif
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/tab_yellow.gif
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/tab_yellow.png
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/images/vijaydev.jpg
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/javascripts/guides.js
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/javascripts/jquery.min.js
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/javascripts/responsive-tables.js
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/javascripts/syntaxhighlighter/shBrushAppleScript.js
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/javascripts/syntaxhighlighter/shBrushAS3.js
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/javascripts/syntaxhighlighter/shBrushBash.js
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/javascripts/syntaxhighlighter/shBrushColdFusion.js
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/javascripts/syntaxhighlighter/shBrushCpp.js
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/javascripts/syntaxhighlighter/shBrushCSharp.js
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/javascripts/syntaxhighlighter/shBrushCss.js
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/javascripts/syntaxhighlighter/shBrushDelphi.js
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/javascripts/syntaxhighlighter/shBrushDiff.js
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/javascripts/syntaxhighlighter/shBrushErlang.js
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/javascripts/syntaxhighlighter/shBrushGroovy.js
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/javascripts/syntaxhighlighter/shBrushJava.js
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/javascripts/syntaxhighlighter/shBrushJavaFX.js
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/javascripts/syntaxhighlighter/shBrushJScript.js
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/javascripts/syntaxhighlighter/shBrushPerl.js
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/javascripts/syntaxhighlighter/shBrushPhp.js
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/javascripts/syntaxhighlighter/shBrushPlain.js
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/javascripts/syntaxhighlighter/shBrushPowerShell.js
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/javascripts/syntaxhighlighter/shBrushPython.js
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/javascripts/syntaxhighlighter/shBrushRuby.js
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/javascripts/syntaxhighlighter/shBrushSass.js
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/javascripts/syntaxhighlighter/shBrushScala.js
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/javascripts/syntaxhighlighter/shBrushSql.js
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/javascripts/syntaxhighlighter/shBrushVb.js
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/javascripts/syntaxhighlighter/shBrushXml.js
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/javascripts/syntaxhighlighter/shCore.js
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/stylesheets/fixes.css
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/stylesheets/kindle.css
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/stylesheets/main.css
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/stylesheets/print.css
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/stylesheets/reset.css
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/stylesheets/responsive-tables.css
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/stylesheets/style.css
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/stylesheets/syntaxhighlighter/shCore.css
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/stylesheets/syntaxhighlighter/shCoreDefault.css
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/stylesheets/syntaxhighlighter/shCoreDjango.css
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/stylesheets/syntaxhighlighter/shCoreEclipse.css
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/stylesheets/syntaxhighlighter/shCoreEmacs.css
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/stylesheets/syntaxhighlighter/shCoreFadeToGrey.css
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/stylesheets/syntaxhighlighter/shCoreMDUltra.css
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/stylesheets/syntaxhighlighter/shCoreMidnight.css
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/stylesheets/syntaxhighlighter/shCoreRDark.css
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/stylesheets/syntaxhighlighter/shThemeDefault.css
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/stylesheets/syntaxhighlighter/shThemeDjango.css
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/stylesheets/syntaxhighlighter/shThemeEclipse.css
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/stylesheets/syntaxhighlighter/shThemeEmacs.css
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/stylesheets/syntaxhighlighter/shThemeFadeToGrey.css
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/stylesheets/syntaxhighlighter/shThemeMDUltra.css
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/stylesheets/syntaxhighlighter/shThemeMidnight.css
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/stylesheets/syntaxhighlighter/shThemeRailsGuides.css
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/assets/stylesheets/syntaxhighlighter/shThemeRDark.css
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/bug_report_templates/action_controller_gem.rb
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/bug_report_templates/action_controller_master.rb
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/bug_report_templates/active_record_gem.rb
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/bug_report_templates/active_record_master.rb
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/CHANGELOG.md
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/app/assets/javascripts/application.js
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/app/assets/javascripts/comments.js.coffee
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/app/assets/javascripts/posts.js.coffee
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/app/assets/javascripts/welcome.js.coffee
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/app/assets/stylesheets/application.css
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/app/assets/stylesheets/comments.css.scss
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/app/assets/stylesheets/posts.css.scss
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/app/assets/stylesheets/welcome.css.scss
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/app/controllers/application_controller.rb
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/app/controllers/comments_controller.rb
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/app/controllers/posts_controller.rb
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/app/controllers/welcome_controller.rb
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/app/helpers/application_helper.rb
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/app/helpers/comments_helper.rb
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/app/helpers/posts_helper.rb
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/app/helpers/welcome_helper.rb
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/app/models/comment.rb
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/app/models/post.rb
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/app/views/comments/_comment.html.erb
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/app/views/comments/_form.html.erb
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/app/views/layouts/application.html.erb
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/app/views/posts/_form.html.erb
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/app/views/posts/edit.html.erb
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/app/views/posts/index.html.erb
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/app/views/posts/new.html.erb
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/app/views/posts/show.html.erb
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/app/views/welcome/index.html.erb
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/bin/bundle
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/bin/rails
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/bin/rake
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/config/application.rb
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/config/boot.rb
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/config/database.yml
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/config/environment.rb
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/config/environments/development.rb
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/config/environments/production.rb
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/config/environments/test.rb
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/config/initializers/backtrace_silencers.rb
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/config/initializers/filter_parameter_logging.rb
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/config/initializers/inflections.rb
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/config/initializers/locale.rb
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/config/initializers/mime_types.rb
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/config/initializers/secret_token.rb
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/config/initializers/session_store.rb
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/config/initializers/wrap_parameters.rb
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/config/locales/en.yml
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/config/routes.rb
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/config.ru
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/db/migrate/20130122042648_create_posts.rb
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/db/migrate/20130122045842_create_comments.rb
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/db/schema.rb
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/db/seeds.rb
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/Gemfile
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/Gemfile.lock
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/public/404.html
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/public/422.html
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/public/500.html
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/public/favicon.ico
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/public/robots.txt
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/Rakefile
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/README.rdoc
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/test/controllers/comments_controller_test.rb
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/test/controllers/posts_controller_test.rb
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/test/controllers/welcome_controller_test.rb
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/test/fixtures/comments.yml
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/test/fixtures/posts.yml
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/test/helpers/comments_helper_test.rb
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/test/helpers/posts_helper_test.rb
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/test/helpers/welcome_helper_test.rb
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/test/models/comment_test.rb
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/test/models/post_test.rb
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/code/getting_started/test/test_helper.rb
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/rails_guides/generator.rb
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/rails_guides/helpers.rb
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/rails_guides/indexer.rb
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/rails_guides/kindle.rb
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/rails_guides/levenshtein.rb
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/rails_guides/markdown/renderer.rb
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/rails_guides/markdown.rb
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/rails_guides.rb
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/Rakefile
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/source/2_2_release_notes.md
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/source/2_3_release_notes.md
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/source/3_0_release_notes.md
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/source/3_1_release_notes.md
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/source/3_2_release_notes.md
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/source/4_0_release_notes.md
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/source/_license.html.erb
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/source/_welcome.html.erb
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/source/action_controller_overview.md
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/source/action_mailer_basics.md
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/source/action_view_overview.md
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/source/active_model_basics.md
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/source/active_record_basics.md
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/source/active_record_callbacks.md
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/source/active_record_querying.md
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/source/active_record_validations.md
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/source/active_support_core_extensions.md
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/source/active_support_instrumentation.md
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/source/api_documentation_guidelines.md
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/source/asset_pipeline.md
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/source/association_basics.md
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/source/caching_with_rails.md
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/source/command_line.md
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/source/configuring.md
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/source/contributing_to_ruby_on_rails.md
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/source/credits.html.erb
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/source/debugging_rails_applications.md
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/source/development_dependencies_install.md
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/source/documents.yaml
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/source/engines.md
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/source/form_helpers.md
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/source/generators.md
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/source/getting_started.md
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/source/i18n.md
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/source/index.html.erb
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/source/initialization.md
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/source/kindle/copyright.html.erb
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/source/kindle/KINDLE.md
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/source/kindle/layout.html.erb
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/source/kindle/rails_guides.opf.erb
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/source/kindle/toc.html.erb
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/source/kindle/toc.ncx.erb
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/source/kindle/welcome.html.erb
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/source/layout.html.erb
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/source/layouts_and_rendering.md
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/source/maintenance_policy.md
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/source/migrations.md
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/source/nested_model_forms.md
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/source/plugins.md
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/source/rails_application_templates.md
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/source/rails_on_rack.md
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/source/routing.md
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/source/ruby_on_rails_guides_guidelines.md
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/source/security.md
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/source/testing.md
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/source/upgrading_ruby_on_rails.md
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/source/working_with_javascript_in_rails.md
/usr/local/lib/ruby/gems/2.0.0/gems/rails-4.0.1/guides/w3c_validator.rb
Successfully installed rails-4.0.1
Parsing documentation for rails-4.0.1
Parsing sources...
100% [260/260] guides/w3c_validator.rb
Done installing documentation for rails after 2 seconds
1 gem installed
Where am I wrong? I have Ruby 2.0.0 installed on my machine.

Can you let us know what this returns?
which rails
You should see something like this:
/Users/<user>/.rvm/gems/ruby-2.0.0-p247/bin
I am assuming you just need to update your PATH with the path to rails.
Make sure that you have something like this at the end of your login script (bash_login, etc):
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
This will ensure rvm is in your path.
Do you have to use sudo to install rails? If not, I would try installing without sudo.

Ok, I sorted it out myself, though the tough way as the railsinstaller doesn't work with Mavericks. Firstly, I uninstalled both rvm and homebrew doing that I accidentally deleted the ruby folder from my /User/bin folder too which deleted the default ruby package.
Now, I downloaded the source code from ruby-lang decompressed it and did a
./configure
make test
make install
which installed the package correctly. Since it was rvm, homebrew and macport clashing, I moved out the macport and used brew to upgrade my ruby install and finally download rails via
gem install rails

Install xcode before installing rails on your mac.

Related

How do i remove Docker completely?

i installed docker follow this post
https://blog.ssdnodes.com/blog/getting-started-docker-vps/
sudo curl -sS https://get.docker.com/ | sh
this leak seem unsafe, i wanted to remove everything with docker and reinstall again in other method.
after remove all and check with
find / -name '*docker*'
the log
/proc/sys/net/ipv4/conf/docker0
/proc/sys/net/ipv4/neigh/docker0
/proc/sys/net/ipv6/conf/docker0
/proc/sys/net/ipv6/neigh/docker0
/proc/1/task/1/net/dev_snmp6/docker0
/proc/1/net/dev_snmp6/docker0
/proc/2/task/2/net/dev_snmp6/docker0
/proc/2/net/dev_snmp6/docker0
/proc/3/task/3/net/dev_snmp6/docker0
/proc/3/net/dev_snmp6/docker0
/proc/84/task/84/net/dev_snmp6/docker0
/proc/84/net/dev_snmp6/docker0
/proc/92/task/92/net/dev_snmp6/docker0
/proc/92/net/dev_snmp6/docker0
/proc/96/task/96/net/dev_snmp6/docker0
/proc/96/net/dev_snmp6/docker0
/proc/114/task/114/net/dev_snmp6/docker0
/proc/114/net/dev_snmp6/docker0
/proc/127/task/127/net/dev_snmp6/docker0
/proc/127/net/dev_snmp6/docker0
/proc/133/task/133/net/dev_snmp6/docker0
/proc/133/net/dev_snmp6/docker0
/proc/134/task/134/net/dev_snmp6/docker0
/proc/134/net/dev_snmp6/docker0
/proc/151/task/151/net/dev_snmp6/docker0
/proc/151/net/dev_snmp6/docker0
/proc/368/task/368/net/dev_snmp6/docker0
/proc/368/net/dev_snmp6/docker0
/proc/371/task/371/net/dev_snmp6/docker0
/proc/371/net/dev_snmp6/docker0
/proc/372/task/372/net/dev_snmp6/docker0
/proc/372/net/dev_snmp6/docker0
/proc/373/task/373/net/dev_snmp6/docker0
/proc/373/task/376/net/dev_snmp6/docker0
/proc/373/task/390/net/dev_snmp6/docker0
/proc/373/net/dev_snmp6/docker0
/proc/386/task/386/net/dev_snmp6/docker0
/proc/386/net/dev_snmp6/docker0
/proc/393/task/393/net/dev_snmp6/docker0
/proc/393/net/dev_snmp6/docker0
/proc/404/task/404/net/dev_snmp6/docker0
/proc/404/net/dev_snmp6/docker0
/proc/407/task/407/net/dev_snmp6/docker0
/proc/407/net/dev_snmp6/docker0
/proc/408/task/408/net/dev_snmp6/docker0
/proc/408/net/dev_snmp6/docker0
/proc/416/task/416/net/dev_snmp6/docker0
/proc/416/net/dev_snmp6/docker0
/proc/448/task/448/net/dev_snmp6/docker0
/proc/448/net/dev_snmp6/docker0
/proc/572/task/572/net/dev_snmp6/docker0
/proc/572/net/dev_snmp6/docker0
/proc/574/task/574/net/dev_snmp6/docker0
/proc/574/net/dev_snmp6/docker0
/proc/2523/task/2523/net/dev_snmp6/docker0
/proc/2523/net/dev_snmp6/docker0
/proc/2526/task/2526/net/dev_snmp6/docker0
/proc/2526/net/dev_snmp6/docker0
/proc/3110/task/3110/net/dev_snmp6/docker0
/proc/3110/net/dev_snmp6/docker0
/proc/3111/task/3111/net/dev_snmp6/docker0
/proc/3111/net/dev_snmp6/docker0
/proc/3114/task/3114/net/dev_snmp6/docker0
/proc/3114/net/dev_snmp6/docker0
/usr/bin/pm2-docker
/usr/libexec/docker
/usr/lib/node_modules/pm2/bin/pm2-docker
/usr/lib/node_modules/pm2/node_modules/systeminformation/lib/dockerSocket.js
/usr/lib/node_modules/pm2/node_modules/systeminformation/lib/docker.js
/usr/lib/node_modules/pm2/node_modules/#pm2/io/docker-compose.yml
/usr/lib/firewalld/services/docker-swarm.xml
/usr/lib/firewalld/services/docker-registry.xml
/sys/devices/virtual/net/docker0
/sys/class/net/docker0
/var/cache/yum/x86_64/7/docker-ce-stable
/var/lib/docker-engine
/var/lib/yum/repos/x86_64/7/docker-ce-stable
/etc/yum.repos.d/docker-ce.repo
/etc/systemd/system/docker.service.d
how do i remove docker completely ? is this file inside my host are safe ?
Quick summary of my comments so far, so you can accept it as an answer:
You downloaded the script from a trustworthy source (docker.com) and via HTTPS so there is extremely little risk of your system being compromised.
If your system was compromised, uninstalling docker would likely not solve the problem.
With those two caveats out of the way: The script you ran does a lot of magic to determine your operating system, and then delegates the actual installation to the appropriate package manager, meaning you can simply uninstall it through the usual package management tools of your Linux distribution.

Why is Ruby failing to connect to my Tor network?

I’m using Ruby on Rails 4.2.7 on Mac El Capitan and just installed the Tor browser (v 6.0.4). I fired up my Tor browser, have verified its running by viewing a couple of web pages, but using this gem — https://github.com/dryruby/tor.rb , when I run my script, Ruby doesn’t believe Tor is running
require 'tor'
...
puts "avaailble: #{Tor.available?}"
puts "version: #{Tor.version}"
Returns
avaailble: false
version:
Indeed, when I try and make a Tor request using the https://github.com/brunogh/tor_requests gem, the web page request returns immediately, leading me to believe the Tor network isn’t being used because in a Tor browser it takes much longer (here is the code I’m using to amen a web page request) …
uri = URI.parse(url)
Net::HTTP.SOCKSProxy('127.0.0.1', 9150).start(uri.host, uri.port) do |http|
f = http.get(uri.path)
end
How do I make my Ruby/Rails code connect to my locally running Tor network?
Edit: In respnse to the answer given, here is what I set my PATH and DYLD_LIBRARY_PATH variables to …
localhost:myproject davea$ echo $PATH
/usr/local/opt/coreutils/libexec/gnubin:/opt/local/bin:/opt/local/sbin:/Users/davea/.rvm/gems/ruby-2.3.0/bin:/Users/davea/.rvm/gems/ruby-2.3.0#global/bin:/Users/davea/.rvm/rubies/ruby-2.3.0/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/mysql/bin/:/opt/gradle-2.7/bin:/opt/apache-maven-3.3.3/bin:/Users/ davea/.rvm/bin:/usr/local/mysql/bin:/Applications/TorBrowser.app/Contents/MacOS/Tor:/Users/davea/.rvm/bin:/usr/local/mysql/bin:/Applications/TorBrowser.app/Contents/MacOS/Tor
localhost:myproject davea$ echo $DYLD_LIBRARY_PATH
/Applications/TorBrowser.app/Contents/MacOS/Tor:/usr/local/mysql/lib:/usr/local/mysql/lib:
and here is ht output in my Rails console trying the commands listed …
localhost:myproject davea$ rails console
Running via Spring preloader in process 49987
Loading development environment (Rails 4.2.7.1)
2.3.0 :001 >
2.3.0 :002 > Tor::Config::CONFDIR = '/Applications/TorBrowser.app//Contents/MacOS/Tor'
(irb):2: warning: already initialized constant Tor::Config::CONFDIR
/Users/davea/.rvm/gems/ruby-2.3.0/gems/tor-0.1.2/lib/tor/config.rb:21: warning: previous definition of CONFDIR was here
=> "/Applications/TorBrowser.app//Contents/MacOS/Tor"
2.3.0 :003 > Tor.available?
Here is how you can make brunogh/tor_requests work with Tor Browser (easy):
require 'tor_requests'
Tor.configure do |config|
config.ip = "127.0.0.1"
config.port = "9150"
config.add_header('User-Agent', 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:48.0) Gecko/20100101 Firefox/48.0')
end
res = Tor::HTTP.get(URI('https://drew-phillips.com/ip-info/'))
p res.code
p res.body
To get dryruby/tor working involved a bit more work:
It depends on your ENV PATH variable to find the Tor binary and Tor browser has some libraries (at least on Linux) within it's path that aren't found if you try to execute it directly. Seems this should support allowing you to add the path in code instead of relying on PATH in my opinion.
Trying to run Tor Browser's tor binary from the console yields (more on this later, may not apply to Mac):
tor: symbol lookup error: tor-browser_en-US/Browser/TorBrowser/Tor/tor: undefined
symbol: evutil_secure_rng_set_urandom_device_file
Also, installing the Gem from source doesn't give us the latest version available on GitHub and there appears to be a fix to the version method that isn't included with the Gem version 0.1.2. Because of this I pulled the source and tell the program to load the Gem from a custom path.
The working code:
require 'rubygems'
$:.unshift "./tor/lib"
require 'tor'
Tor::Config::CONFDIR = '/home/me/tor-browser_en-US/Browser/TorBrowser/Data/Tor'
p Tor::Config::CONFDIR
p Tor.available?
p Tor.version
Now, in order to have it run successfully, you'll need to set your PATH and LD_LIBRARY_PATH (on Mac this is DYLD_LIBRARY_PATH I believe).
So I run the Ruby code like this:
PATH=/home/me/tor-browser_en-US/Browser/TorBrowser/Tor:$PATH \
LD_LIBRARY_PATH=/home/me/tor-browser_en-US/Browser/TorBrowser/Tor:$LD_LIBRARY_PATH \
ruby tor.rb
This puts Tor Browser as the first search path for binaries and libraries.
Then with this I was able to get the following output:
true
"0.2.8.6"
Hope that helps!

Fail when install Ruby on Rails

I use this command to install Rails.
sudo gem install rails -V
Then I got this error message. No ideas about the reason...
[root#li608-165 ~]# sudo gem install rails -V
HEAD https://api.rubygems.org/api/v1/dependencies
200 OK
GET https://api.rubygems.org/api/v1/dependencies?gems=rails
200 OK
GET https://api.rubygems.org/api/v1/dependencies?gems=actionmailer,actionpack,actionview,activemodel,activerecord,a ctivesupport,bundler,railties,sprockets-rails
200 OK
GET https://api.rubygems.org/api/v1/dependencies?gems=arel,builder,erubis,i18n,json,mail,minitest,rack,rack-test,ra ke,sprockets,thor,thread_safe,tzinfo
200 OK
GET https://api.rubygems.org/api/v1/dependencies?gems=hike,mime-types,multi_json,tilt,treetop
200 OK
GET https://api.rubygems.org/api/v1/dependencies?gems=polyglot,polyglot
200 OK
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/.gitignore
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/.travis.yml
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/CHANGES
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/COPYING
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/COPYING-json-jruby
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/GPL
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/Gemfile
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/README-json-jruby.markdown
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/README.rdoc
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/Rakefile
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/TODO
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/VERSION
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/data/example.json
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/data/index.html
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/data/prototype.js
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/diagrams/.keep
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/ext/json/ext/fbuffer/fbuffer.h
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/ext/json/ext/generator/depend
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/ext/json/ext/generator/extconf.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/ext/json/ext/generator/generator.c
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/ext/json/ext/generator/generator.h
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/ext/json/ext/parser/depend
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/ext/json/ext/parser/extconf.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/ext/json/ext/parser/parser.c
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/ext/json/ext/parser/parser.h
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/ext/json/ext/parser/parser.rl
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/install.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/java/src/json/ext/ByteListTranscoder.java
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/java/src/json/ext/Generator.java
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/java/src/json/ext/GeneratorMethods.java
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/java/src/json/ext/GeneratorService.java
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/java/src/json/ext/GeneratorState.java
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/java/src/json/ext/OptionsReader.java
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/java/src/json/ext/Parser.java
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/java/src/json/ext/Parser.rl
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/java/src/json/ext/ParserService.java
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/java/src/json/ext/RuntimeInfo.java
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/java/src/json/ext/StringDecoder.java
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/java/src/json/ext/StringEncoder.java
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/java/src/json/ext/Utils.java
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/json-java.gemspec
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/json.gemspec
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/json_pure.gemspec
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/lib/json.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/lib/json/add/bigdecimal.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/lib/json/add/complex.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/lib/json/add/core.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/lib/json/add/date.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/lib/json/add/date_time.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/lib/json/add/exception.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/lib/json/add/ostruct.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/lib/json/add/range.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/lib/json/add/rational.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/lib/json/add/regexp.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/lib/json/add/struct.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/lib/json/add/symbol.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/lib/json/add/time.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/lib/json/common.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/lib/json/ext.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/lib/json/ext/.keep
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/lib/json/generic_object.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/lib/json/pure.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/lib/json/pure/generator.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/lib/json/pure/parser.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/lib/json/version.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/fixtures/fail1.json
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/fixtures/fail10.json
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/fixtures/fail11.json
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/fixtures/fail12.json
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/fixtures/fail13.json
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/fixtures/fail14.json
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/fixtures/fail18.json
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/fixtures/fail19.json
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/fixtures/fail2.json
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/fixtures/fail20.json
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/fixtures/fail21.json
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/fixtures/fail22.json
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/fixtures/fail23.json
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/fixtures/fail24.json
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/fixtures/fail25.json
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/fixtures/fail27.json
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/fixtures/fail28.json
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/fixtures/fail3.json
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/fixtures/fail4.json
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/fixtures/fail5.json
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/fixtures/fail6.json
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/fixtures/fail7.json
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/fixtures/fail8.json
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/fixtures/fail9.json
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/fixtures/pass1.json
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/fixtures/pass15.json
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/fixtures/pass16.json
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/fixtures/pass17.json
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/fixtures/pass2.json
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/fixtures/pass26.json
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/fixtures/pass3.json
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/setup_variant.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/test_json.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/test_json_addition.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/test_json_encoding.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/test_json_fixtures.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/test_json_generate.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/test_json_generic_object.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/test_json_string_matching.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/test_json_unicode.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tools/fuzz.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tools/server.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/test_json.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/test_json_addition.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/test_json_encoding.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/test_json_fixtures.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/test_json_generate.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/test_json_generic_object.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/test_json_string_matching.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/test_json_unicode.rb
Building native extensions. This could take a while...
/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/ruby.h
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
Building has failed. See above output for more information on the failure.
extconf failed, exit code 1
Gem files will remain installed in /usr/lib64/ruby/gems/1.8/gems/json-1.8.1 for inspection.
Results logged to /usr/lib64/ruby/gems/1.8/extensions/x86_64-linux/1.8/json-1.8.1/gem_make.out
System: CentOS 6.5
Ruby: 1.8.7
Look some piece of log
can't find header files for ruby at /usr/lib/ruby/ruby.h
This mean you have not ruby-devel
install ruby-devel
on CentOS:
sudo yum install ruby-devel

Determine mysql2 server version using mysql2 Ruby gem

I'm using Rails and the mysql2 gem. Is there a way to get the mysqld server version as running the command:
$ mysqld --version
mysqld Ver 5.5.29 for osx10.8 on i386 (Source distribution)
I do not wish to execute a shell command because the database server might be running on another server.
You can get the version info in rails via ActiveRecord::Base.connection. I'm doing it in my rails console here. I'm using an old version (2.2) of rails so the syntax might be different in yours.
irb(main):001:0> ActiveRecord::Base.connection.select_rows(
"SHOW VARIABLES LIKE '%version%'"
)
=> [
["innodb_version", "5.5.34"],
["protocol_version", "10"],
["slave_type_conversions", ""],
["version", "5.5.34-0ubuntu0.12.04.1"],
["version_comment", "(Ubuntu)"],
["version_compile_machine", "x86_64"],
["version_compile_os", "debian-linux-gnu"]
]
Once you've got this you can pull out the info you want, eg:
version = ActiveRecord::Base.connection
.select_rows("SHOW VARIABLES LIKE 'version'")
.last.last
=> "5.5.34-0ubuntu0.12.04.1"
def mysql_version
mysql_version_sql = 'SHOW VARIABLES WHERE Variable_name = "version"'
ActiveRecord::Base.connection.select_rows(mysql_version_sql)[0][1]
end
mysql_version #=> "5.5.35-0+wheezy1"

Passenger gem getting updated for Rails app

I have a staging server from my client which has passenger(3.0.5 and 3.0.2) installed on it for an rails app(v=2.3.13), but when I start the server using passenger on the console it's getting updated to 3.0.5-x86_64-ruby1.8.7-linux-gcc4.4.3-1002. In my Gemfile I have mentioned
gem 'passenger', '=3.0.5'
Why is it getting updated?
Thanks in advance.
Here's the log....
when I run the command, **`**RAILS_ENV=staging passenger start**.`**
__________________________________________________________
Nginx core 0.8.54 isn't installed
Phusion Passenger Standalone will automatically install it into:
/var/lib/passenger-standalone/3.0.5-x86_64-ruby1.8.7-linux-gcc4.4.3-1002/nginx-0.8.54
This will only be done once. Please sit back and relax while installation is
in progress.
Checking for required software...
GNU C++ compiler... found at `/usr/bin/g++`
GNU make... found at `/usr/bin/make`
A download tool like 'wget' or 'curl'... found at /usr/bin/wget
Ruby development headers... found
OpenSSL support for Ruby... found
RubyGems... found
Rake... found at `/usr/local/bin/rake`
rack... found
Curl development headers with SSL support... found
OpenSSL development headers... found
Zlib development headers... found
file-tail... found
daemon_controller >= 0.2.5... found
Downloading Passenger binaries for your platform, if available...
Resolving standalone-binaries.modrails.com... 97.107.130.55
Connecting to standalone-binaries.modrails.com|97.107.130.55|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2013-10-09 08:52:00 ERROR 404: Not Found.
Looks like it's not. But don't worry, the necessary binaries will be compiled from source instead.
Downloading Nginx binaries for your platform, if available...
#
Resolving standalone-binaries.modrails.com... 97.107.130.55
Connecting to standalone-binaries.modrails.com|97.107.130.55|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2013-10-09 08:52:00 ERROR 404: Not Found.
Looks like it's not. But don't worry, the necessary binaries will be compiled from source instead.
Downloading Nginx...
# wget -O /tmp/root-passenger-standalone-21842/nginx-0.8.54.tar.gz http://nginx.org/download/nginx-0.8.54.tar.gz
--2013-10-09 08:52:00-- http://nginx.org/download/nginx-0.8.54.tar.gz
Resolving nginx.org... 206.251.255.63
Connecting to nginx.org|206.251.255.63|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 650001 (635K) [application/octet-stream]
Saving to: '/tmp/root-passenger-standalone-21842/nginx-0.8.54.tar.gz'
100%
[======================================================================================================>] 650,001 788K/s in 0.8s
2013-10-09 08:52:01 (788 KB/s) - `/tmp/root-passenger-standalone-21842/nginx-0.8.54.tar.gz' saved [650001/650001]
Installing Phusion Passenger Standalone...

Resources