Error when loading Rails server (Rails 4) - ruby-on-rails

I had a running app with no problem and just did bundle update and bundle install and now.
I had not bundle updated for the past 4 months I think.
Now when I run $ rails s, I have this error:
".../gems/sprockets-2.12.3/lib/sprockets/manifest.rb:65:in `read': Is a directory - .../public/assets (Errno::EISDIR)"!
mathieu-To-be-filled-by-O-E-M:~/rails_projects/mathieu_app$ rails s
DEPRECATION WARNING: Support for Rails < 4.1.0 will be dropped. (called from require at /home/mathieu/.rvm/gems/ruby-2.0.0-p451#global/gems/bundler-1.5.3/lib/bundler/runtime.rb:76)
=> Booting WEBrick
=> Rails 4.0.12 application starting in development on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
DEPRECATION WARNING: Model based mass assignment security has been extracted
out of Rails into a gem. Please use the new recommended protection model for
params or add `protected_attributes` to your Gemfile to use the old one.
To disable this message remove the `whitelist_attributes` option from your
`config/application.rb` file and any `mass_assignment_sanitizer` options
from your `config/environments/*.rb` files.
See http://guides.rubyonrails.org/security.html#mass-assignment for more information.
Exiting
/home/mathieu/.rvm/gems/ruby-2.0.0-p451#rails3tutorial2ndEd/gems/sprockets-2.12.3/lib/sprockets/manifest.rb:65:in `read': Is a directory - /home/mathieu/rails_projects/mathieu_app/public/assets (Errno::EISDIR)
from /home/mathieu/.rvm/gems/ruby-2.0.0-p451#rails3tutorial2ndEd/gems/sprockets-2.12.3/lib/sprockets/manifest.rb:65:in `initialize'
from /home/mathieu/.rvm/gems/ruby-2.0.0-p451#rails3tutorial2ndEd/gems/sprockets-rails-2.2.2/lib/sprockets/railtie.rb:105:in `new'
from /home/mathieu/.rvm/gems/ruby-2.0.0-p451#rails3tutorial2ndEd/gems/sprockets-rails-2.2.2/lib/sprockets/railtie.rb:105:in `block in <class:Railtie>'
from /home/mathieu/.rvm/gems/ruby-2.0.0-p451#rails3tutorial2ndEd/gems/activesupport-4.0.12/lib/active_support/lazy_load_hooks.rb:36:in `call'
from /home/mathieu/.rvm/gems/ruby-2.0.0-p451#rails3tutorial2ndEd/gems/activesupport-4.0.12/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
from /home/mathieu/.rvm/gems/ruby-2.0.0-p451#rails3tutorial2ndEd/gems/activesupport-4.0.12/lib/active_support/lazy_load_hooks.rb:45:in `block in run_load_hooks'
from /home/mathieu/.rvm/gems/ruby-2.0.0-p451#rails3tutorial2ndEd/gems/activesupport-4.0.12/lib/active_support/lazy_load_hooks.rb:44:in `each'
from /home/mathieu/.rvm/gems/ruby-2.0.0-p451#rails3tutorial2ndEd/gems/activesupport-4.0.12/lib/active_support/lazy_load_hooks.rb:44:in `run_load_hooks'
from /home/mathieu/.rvm/gems/ruby-2.0.0-p451#rails3tutorial2ndEd/gems/railties-4.0.12/lib/rails/application/finisher.rb:62:in `block in <module:Finisher>'
from /home/mathieu/.rvm/gems/ruby-2.0.0-p451#rails3tutorial2ndEd/gems/railties-4.0.12/lib/rails/initializable.rb:30:in `instance_exec'
from /home/mathieu/.rvm/gems/ruby-2.0.0-p451#rails3tutorial2ndEd/gems/railties-4.0.12/lib/rails/initializable.rb:30:in `run'
from /home/mathieu/.rvm/gems/ruby-2.0.0-p451#rails3tutorial2ndEd/gems/railties-4.0.12/lib/rails/initializable.rb:55:in `block in run_initializers'
from /home/mathieu/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/tsort.rb:150:in `block in tsort_each'
from /home/mathieu/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/tsort.rb:183:in `block (2 levels) in each_strongly_connected_component'
from /home/mathieu/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/tsort.rb:219:in `each_strongly_connected_component_from'
from /home/mathieu/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/tsort.rb:182:in `block in each_strongly_connected_component'
from /home/mathieu/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/tsort.rb:180:in `each'
from /home/mathieu/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/tsort.rb:180:in `each_strongly_connected_component'
from /home/mathieu/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/tsort.rb:148:in `tsort_each'
from /home/mathieu/.rvm/gems/ruby-2.0.0-p451#rails3tutorial2ndEd/gems/railties-4.0.12/lib/rails/initializable.rb:54:in `run_initializers'
from /home/mathieu/.rvm/gems/ruby-2.0.0-p451#rails3tutorial2ndEd/gems/railties-4.0.12/lib/rails/application.rb:215:in `initialize!'
from /home/mathieu/.rvm/gems/ruby-2.0.0-p451#rails3tutorial2ndEd/gems/railties-4.0.12/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /home/mathieu/rails_projects/mathieu_app/config/environment.rb:5:in `<top (required)>'
from /home/mathieu/.rvm/gems/ruby-2.0.0-p451#rails3tutorial2ndEd/gems/activesupport-4.0.12/lib/active_support/dependencies.rb:229:in `require'
from /home/mathieu/.rvm/gems/ruby-2.0.0-p451#rails3tutorial2ndEd/gems/activesupport-4.0.12/lib/active_support/dependencies.rb:229:in `block in require'
from /home/mathieu/.rvm/gems/ruby-2.0.0-p451#rails3tutorial2ndEd/gems/activesupport-4.0.12/lib/active_support/dependencies.rb:214:in `load_dependency'
from /home/mathieu/.rvm/gems/ruby-2.0.0-p451#rails3tutorial2ndEd/gems/activesupport-4.0.12/lib/active_support/dependencies.rb:229:in `require'
from /home/mathieu/rails_projects/mathieu_app/config.ru:3:in `block in <main>'
from /home/mathieu/.rvm/gems/ruby-2.0.0-p451#global/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'
from /home/mathieu/.rvm/gems/ruby-2.0.0-p451#global/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'
from /home/mathieu/rails_projects/mathieu_app/config.ru:in `new'
from /home/mathieu/rails_projects/mathieu_app/config.ru:in `<main>'
from /home/mathieu/.rvm/gems/ruby-2.0.0-p451#global/gems/rack-1.5.2/lib/rack/builder.rb:49:in `eval'
from /home/mathieu/.rvm/gems/ruby-2.0.0-p451#global/gems/rack-1.5.2/lib/rack/builder.rb:49:in `new_from_string'
from /home/mathieu/.rvm/gems/ruby-2.0.0-p451#global/gems/rack-1.5.2/lib/rack/builder.rb:40:in `parse_file'
from /home/mathieu/.rvm/gems/ruby-2.0.0-p451#global/gems/rack-1.5.2/lib/rack/server.rb:277:in `build_app_and_options_from_config'
from /home/mathieu/.rvm/gems/ruby-2.0.0-p451#global/gems/rack-1.5.2/lib/rack/server.rb:199:in `app'
from /home/mathieu/.rvm/gems/ruby-2.0.0-p451#rails3tutorial2ndEd/gems/railties-4.0.12/lib/rails/commands/server.rb:48:in `app'
from /home/mathieu/.rvm/gems/ruby-2.0.0-p451#global/gems/rack-1.5.2/lib/rack/server.rb:314:in `wrapped_app'
from /home/mathieu/.rvm/gems/ruby-2.0.0-p451#rails3tutorial2ndEd/gems/railties-4.0.12/lib/rails/commands/server.rb:75:in `start'
from /home/mathieu/.rvm/gems/ruby-2.0.0-p451#rails3tutorial2ndEd/gems/railties-4.0.12/lib/rails/commands.rb:76:in `block in <top (required)>'
from /home/mathieu/.rvm/gems/ruby-2.0.0-p451#rails3tutorial2ndEd/gems/railties-4.0.12/lib/rails/commands.rb:71:in `tap'
from /home/mathieu/.rvm/gems/ruby-2.0.0-p451#rails3tutorial2ndEd/gems/railties-4.0.12/lib/rails/commands.rb:71:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
My gem list:
source 'https://rubygems.org'
ruby "2.0.0" # source: https://devcenter.heroku.com/articles/ruby-versions
# Rails 4
gem 'rails', "~> 4.0.3"
# Gems supporting Rails 4 core architecture
gem 'actionpack-action_caching'
gem 'actionpack-page_caching'
gem 'activerecord-session_store'
gem 'activeresource'
gem 'rails-observers'
gem 'turbolinks'
gem 'pg'
gem 'anjlab-bootstrap-rails', :require => 'bootstrap-rails',
:github => 'anjlab/bootstrap-rails',
:branch => '3.0.0'
gem 'devise' # authentification
gem 'cancan' # authorization
gem 'rolify', :git => 'git://github.com/EppO/rolify.git' # role management library with resource scoping, added fork due to bug source - stackoverflow.com/questions/13712012/error-pushing-to-heroku-aborting-my-rake-assetsprecompile?rq=1
gem 'figaro' # rails app configuration and keep private stuff...private
gem 'sendgrid' # sendgrid gem
gem 'faker' # to create fake user accounts
gem 'will_paginate' # pagination method
gem 'bootstrap-will_paginate' # configure will_paginate gem to bootstrap pagination style
gem 'font-awesome-rails' # pure css icons
gem 'validates_timeliness' # methods and validations for dates formats
gem 'validate_url' # for URL validations in forms
gem 'dotiw' # overrides the default distance_of_time_in_words and provides a more accurate output
gem 'friendly_id'
# Forms with formtastic
gem 'formtastic'
gem 'formtastic-bootstrap'
# Active admin stuff
gem 'activeadmin', github: 'gregbell/active_admin' # added github because of deployment issue wiht jquery ui http://stackoverflow.com/questions/16844411/rails-active-admin-deployment-couldnt-find-file-jquery-ui
gem 'sass-rails', '~> 4.0.1' # Master branch not OK with Rails 4, hence we point to branch that comply with Rails 4
gem 'kaminari' #'0.14.1' active admin needs kaminari for pagination; blocked on 0.14.1 because if not get nomethod error per_page kaminari https://github.com/sferik/rails_admin/issues/1868 and https://github.com/amatsuda/kaminari/issues/481
gem 'postgres_ext' # gives a nice set of query methods & Adds missing native PostgreSQL data types to ActiveRecord and convenient querying extensions for ActiveRecord and Arel for Rails 4.x
gem 'jquery-rails'
gem 'chosen-rails'
gem 'coffee-rails', '~> 4.0.1' # Master branch not OK with Rails 4, hence we point to branch that comply with Rails 4 by default
gem 'uglifier'
# Geocoding and locations
gem 'geocoder'
gem 'country-select'
group :production do
gem 'rails_12factor'
end
group :development do
gem 'quiet_assets' # mutes assets pipeline log messages
gem 'better_errors' # improve error pages
# retrieve binding of a method's caller in MRI 1.9.2+, only for debugging
gem 'binding_of_caller', platforms: [:mri_19, :rbx]
end
group :development, :test do
gem 'perftools.rb', require: 'perftools' # used to find tasks taking long time (ex when test are too long)
gem 'guard', '>=2.1.0'
gem 'guard-rspec'
gem 'guard-rails-assets'
gem 'rspec-rails'
gem 'factory_girl_rails'
gem 'pry-rails'
gem 'rspec-collection_matchers'
gem 'i18n-tasks'
end
group :test do
gem 'capybara'
gem 'selenium-webdriver' -ex: flash error messages...
gem 'capybara-webkit' -ex: flash error messages...
gem 'rb-inotify'
gem 'libnotify'
gem 'database_cleaner'
gem 'email_spec'
gem 'cucumber-rails', :require => false #
gem 'launchy'
gem 'shoulda-matchers'
gem 'minitest'
gem 'guard-zeus-client'

If you look in the source code of the sprockets gem (where the error is coming from) you can see that the error is being raised by these lines:
63 begin
64 if File.exist?(#path)
65 data = json_decode(File.read(#path))
66 end
67 rescue MultiJson::DecodeError => e
68 logger.error "#{#path} is invalid: #{e.class} #{e.message}"
69 end
Line 65 is the problem, specifically File.read(#path) - as shown by your error message (sprockets-2.12.3/lib/sprockets/manifest.rb:65:in `read').
Basically, #path is supposed to be a string representing a filename but it's actually pointing to a directory, which is causing File.read to fail. #path is supposed to be pointing to your asset's manifest file (usually created automatically by Sprockets) and I'm not sure why it's getting the incorrect path here - do you have anything that looks relevant to your manifest file in config/application.rb or in your environment config files? What about in app/assets/javascripts/application.js or app/assets/stylesheets/application.css?
Try editing your local copy of sprockets yourself (run "cd `bundle show sprockets`" from your app's directory to find it) and adding puts #path before line 65 above (just make sure you remember to remove it when you're done!) - what does it say?

Hmm... Is it possible that you have Sprocket and structure has been changed, or something like that?
Have you tried to remove that directory ( or just rename it )? This guy removed directory mentioned in error and it worked fine: Trying to install rails- EISDIR error .
There seems to be newer version, have you tried to update? (https://rubygems.org/gems/sprockets-rails)
NOTE: This should be comment but I don't have enough reputation for that...

Removing or commenting out this line of code in development.rb solves the problem:
config.assets.manifest = Rails.root.join("public/assets")

Related

Ruby 2.4 => 2.7: NoMethodError: undefined method `new' for BigDecimal:Class

I updated my Ruby from 2.4 to 2.7 for an existing project and now rspec is giving this error for every single spec. I cannot find the source of the error. There is no BigDecimal in my project. I did not write the tests. How do I find the gem that is causing the problem?
An error occurred while loading ./spec/views/terms_users/new.html.erb_spec.rb.
Failure/Error: require File.expand_path('../../config/environment', __FILE__)
NoMethodError:
undefined method `new' for BigDecimal:Class
# ./config/application.rb:17:in `<top (required)>'
# ./config/environment.rb:2:in `<top (required)>'
# ./spec/rails_helper.rb:4:in `<top (required)>'
# ./spec/views/terms_users/new.html.erb_spec.rb:1:in `<top (required)>'
C:/ruby27/lib/ruby/gems/2.7.0/bundler/gems/shoulda-matchers-4b160bd19ecc/lib/shoulda/matchers/active_model/validate_inclusion_of_matcher.rb:271: warning: already initialized constant Shoulda::Matchers::ActiveModel::ValidateInclusionOfMatcher::ARBITRARY_OUTSIDE_STRING
C:/ruby27/lib/ruby/gems/2.7.0/bundler/gems/shoulda-matchers-4b160bd19ecc/lib/shoulda/matchers/active_model/validate_inclusion_of_matcher.rb:271: warning: previous definition of ARBITRARY_OUTSIDE_STRING was here
C:/ruby27/lib/ruby/gems/2.7.0/bundler/gems/shoulda-matchers-4b160bd19ecc/lib/shoulda/matchers/active_model/validate_inclusion_of_matcher.rb:272: warning: already initialized constant Shoulda::Matchers::ActiveModel::ValidateInclusionOfMatcher::ARBITRARY_OUTSIDE_FIXNUM
C:/ruby27/lib/ruby/gems/2.7.0/bundler/gems/shoulda-matchers-4b160bd19ecc/lib/shoulda/matchers/active_model/validate_inclusion_of_matcher.rb:272: warning: previous definition of ARBITRARY_OUTSIDE_FIXNUM was here
This is application.rb:17:
Bundler.require(*Rails.groups)
This is my Gemfile for :test:
ruby '~>2.7.0'
gem 'rails', '~> 5.0.2'
group :test do
# Acceptance test framework for web applications
gem 'capybara'
# Strategies for cleaning databases
gem 'database_cleaner'#, '~> 1.6.1.0'
# Factories
gem 'fabrication'#, '~> 2.16.1'
# Tool for writing automated tests of websites
gem 'selenium-webdriver'#, '~> 3.4'
# Code coverage
gem 'simplecov', require: false
# One-liners that test common Rails functionality
gem 'shoulda-matchers', git: 'https://github.com/thoughtbot/shoulda-matchers.git', branch: 'rails-5'
# Stubbing and setting expectations on HTTP requests
gem 'webmock', require: false
end
group :development, :test do
# Annotate Rails classes with schema and routes info
gem 'annotate', '~> 2.7'
# Call 'byebug' anywhere to stop execution and get a debugger console
gem 'byebug' #, platform: :mri
# Load environment variables from `.env`
gem 'dotenv-rails', '~> 2.2'
# `rails c` alternative and runtime developer console
gem 'pry-rails', '~> 0.3'
# Launch a pry session when a test fails
gem 'pry-rescue'
# Move up and down the stack with pry
gem 'pry-stack_explorer'
# Testing
gem 'rspec-rails'#, '~> 3.5'
# Ruby static code analyzer
gem 'rubocop', '~> 0.49.1', require: false
gem 'rubocop-rspec'#, '~> 1.15', require: false
end
The app runs and loads and works.
This tracked it down:
>set RAILS_ENV=test
>echo %RAILS_ENV%
test
>rails console
Traceback (most recent call last):
58: from bin/rails:9:in `<main>'
57: from C:/ruby27/lib/ruby/gems/2.7.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
...
1: from C:/ruby27/lib/ruby/gems/2.7.0/bundler/gems/shoulda-matchers-4b160bd19ecc/lib/shoulda/matchers/active_model/validate_inclusion_of_matcher.rb:270:in `<module:ActiveModel>'
C:/ruby27/lib/ruby/gems/2.7.0/bundler/gems/shoulda-matchers-4b160bd19ecc/lib/shoulda/matchers/active_model/validate_inclusion_of_matcher.rb:273:in `<class:ValidateInclusionOfMatcher>': undefined method `new' for BigDecimal:Class (NoMethodError)
This solved it:
`Gemfile`
gem 'shoulda-matchers'#, git: 'https://github.com/thoughtbot/shoulda-matchers.git', branch: 'rails-5'
> bundle update
Installing shoulda-matchers 4.5.1 (was 3.1.2)
> rails console
[1] pry(main)>

Incompatible library version with Ruby 2.5.8 and Rails 5.2.4

I have an installed Ruby on Rails app running in production and on my local dev machine. I recently spun up a new beta server in order to upgrade my OS. However, when I completed the setup of the server and started it up, I got the following error from Passenger.
incompatible library version - /home/deploy/EstimatorHiQ/beta/shared/bundle/ruby/2.5.0/gems/msgpack-1.3.3/lib/msgpack/msgpack.so (LoadError)
/home/deploy/EstimatorHiQ/beta/shared/bundle/ruby/2.5.0/gems/msgpack-1.3.3/lib/msgpack.rb:11:in `require'
/home/deploy/EstimatorHiQ/beta/shared/bundle/ruby/2.5.0/gems/msgpack-1.3.3/lib/msgpack.rb:11:in `rescue in <top (required)>'
/home/deploy/EstimatorHiQ/beta/shared/bundle/ruby/2.5.0/gems/msgpack-1.3.3/lib/msgpack.rb:8:in `<top (required)>'
/home/deploy/EstimatorHiQ/beta/shared/bundle/ruby/2.5.0/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache/store.rb:4:in `require'
/home/deploy/EstimatorHiQ/beta/shared/bundle/ruby/2.5.0/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache/store.rb:4:in `block in <top (required)>'
/home/deploy/EstimatorHiQ/beta/shared/bundle/ruby/2.5.0/gems/bootsnap-1.4.8/lib/bootsnap/explicit_require.rb:44:in `rescue in with_gems'
/home/deploy/EstimatorHiQ/beta/shared/bundle/ruby/2.5.0/gems/bootsnap-1.4.8/lib/bootsnap/explicit_require.rb:40:in `with_gems'
/home/deploy/EstimatorHiQ/beta/shared/bundle/ruby/2.5.0/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache/store.rb:4:in `<top (required)>'
/home/deploy/EstimatorHiQ/beta/shared/bundle/ruby/2.5.0/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache.rb:74:in `require_relative'
/home/deploy/EstimatorHiQ/beta/shared/bundle/ruby/2.5.0/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache.rb:74:in `<top (required)>'
/home/deploy/EstimatorHiQ/beta/shared/bundle/ruby/2.5.0/gems/bootsnap-1.4.8/lib/bootsnap.rb:5:in `require_relative'
/home/deploy/EstimatorHiQ/beta/shared/bundle/ruby/2.5.0/gems/bootsnap-1.4.8/lib/bootsnap.rb:5:in `<top (required)>'
/home/deploy/EstimatorHiQ/beta/shared/bundle/ruby/2.5.0/gems/bootsnap-1.4.8/lib/bootsnap/setup.rb:2:in `require_relative'
/home/deploy/EstimatorHiQ/beta/shared/bundle/ruby/2.5.0/gems/bootsnap-1.4.8/lib/bootsnap/setup.rb:2:in `<top (required)>'
/home/deploy/EstimatorHiQ/beta/releases/20201220204711/config/boot.rb:4:in `require'
/home/deploy/EstimatorHiQ/beta/releases/20201220204711/config/boot.rb:4:in `<top (required)>'
/home/deploy/EstimatorHiQ/beta/releases/20201220204711/config/application.rb:1:in `require_relative'
/home/deploy/EstimatorHiQ/beta/releases/20201220204711/config/application.rb:1:in `<top (required)>'
/home/deploy/EstimatorHiQ/beta/releases/20201220204711/config/environment.rb:2:in `require_relative'
/home/deploy/EstimatorHiQ/beta/releases/20201220204711/config/environment.rb:2:in `<top (required)>'
config.ru:3:in `require'
config.ru:3:in `block in <main>'
/home/deploy/EstimatorHiQ/beta/shared/bundle/ruby/2.5.0/gems/rack-2.2.3/lib/rack/builder.rb:125:in `instance_eval'
/home/deploy/EstimatorHiQ/beta/shared/bundle/ruby/2.5.0/gems/rack-2.2.3/lib/rack/builder.rb:125:in `initialize'
config.ru:1:in `new'
config.ru:1:in `<main>'
/usr/share/passenger/helper-scripts/rack-preloader.rb:101:in `eval'
/usr/share/passenger/helper-scripts/rack-preloader.rb:101:in `preload_app'
/usr/share/passenger/helper-scripts/rack-preloader.rb:189:in `block in <module:App>'
/usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:382:in `run_block_and_record_step_progress'
/usr/share/passenger/helper-scripts/rack-preloader.rb:188:in `<module:App>'
/usr/share/passenger/helper-scripts/rack-preloader.rb:30:in `<module:PhusionPassenger>'
/usr/share/passenger/helper-scripts/rack-preloader.rb:29:in `<main>'
I have tried
uninstalling msgpack gem and reinstalling
running gem pristine --all
bundle install --redownload
and nothing makes any difference whatsoever. I am about to lose my mind. As far as I have been able to see, the setup on my dev, beta, and production machines are identical as is the code being run. However, since I only get an error on the beta server, that cannot possibly be true.
Does anyone see something that I am missing? Any help at all, even simply pointing me in a direction would be most welcome. I simply don't have any more threads to pull on and am at the end of my rope. Help!
As requested in the first comment, here are the results of running ldd at the command line. I am running Linux.
~$ ldd /home/deploy/EstimatorHiQ/beta/shared/bundle/ruby/2.5.0/gems/msgpack-1.3.3/lib/msgpack/msgpack.so
linux-vdso.so.1 (0x00007ffeaa5b8000)
libruby.so.2.5 => /home/deploy/.rbenv/versions/2.5.8/lib/libruby.so.2.5 (0x00007fd84b412000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fd84b021000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fd84ae02000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fd84abfe000)
libcrypt.so.1 => /lib/x86_64-linux-gnu/libcrypt.so.1 (0x00007fd84a9c6000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fd84a628000)
/lib64/ld-linux-x86-64.so.2 (0x00007fd84bb57000)
Here are the location and contents of my gems directory:
deploy#estimator-cloud-beta:~$ cd /home/deploy/EstimatorHiQ/beta/shared/bundle/ruby/2.5.0/gems/
deploy#estimator-cloud-beta:~/EstimatorHiQ/beta/shared/bundle/ruby/2.5.0/gems$ ls
actioncable-5.2.4 ffi-1.13.1 rails-dom-testing-2.0.3
actionmailer-5.2.4 globalid-0.4.2 rails-html-sanitizer-1.3.0
actionpack-5.2.4 htmlentities-4.3.4 railties-5.2.4
actionview-5.2.4 i18n-1.8.5 rake-13.0.1
activejob-5.2.4 jbuilder-2.10.1 rb-fsevent-0.10.4
activemodel-5.2.4 jquery-rails-4.4.0 rb-inotify-0.10.1
activerecord-5.2.4 jquery-turbolinks-2.1.0 rdoc-4.3.0
activestorage-5.2.4 json-1.8.6 record_tag_helper-1.0.1
activesupport-5.2.4 less-2.6.0 rubyzip-1.1.7
acts_as_xlsx-1.0.6 less-rails-5.0.0 sass-3.7.4
arel-9.0.0 loofah-2.7.0 sass-listen-4.0.0
axlsx-2.1.0.pre mail-2.7.1 sass-rails-5.1.0
axlsx_rails-0.5.2 marcel-0.3.3 sdoc-0.4.2
axlsx_styler-0.2.0 method_source-1.0.0 sprockets-3.7.2
barby-0.6.8 mimemagic-0.3.5 sprockets-rails-3.2.2
bcrypt-3.1.16 mini_mime-1.0.2 thor-1.0.1
bootsnap-1.4.8 mini_portile2-2.4.0 thread_safe-0.3.6
builder-3.2.4 minitest-5.14.2 tilt-2.0.10
chunky_png-1.3.12 momentjs-rails-2.5.1 turbolinks-5.2.1
coffee-rails-5.0.0 msgpack-1.3.3 turbolinks-source-5.2.0
coffee-script-2.4.1 mysql2-0.5.3 twitter-bootstrap-rails-3.2.2
coffee-script-source-1.12.2 nio4r-2.5.4 tzinfo-1.2.7
commonjs-0.2.7 nokogiri-1.10.10 uglifier-4.2.0
concurrent-ruby-1.1.7 pagy-3.8.3 websocket-driver-0.7.3
crass-1.0.6 rack-2.2.3 websocket-extensions-0.1.5
erubi-1.9.0 rack-test-1.1.0
execjs-2.7.0 rails-5.2.4
I spent a few more hours trying to figure out the problem. I used 'gem remove msgpack' to remove the gem. Then I used 'bundle install' and it showed as installed. Then I tried to remove the gem again, and it said it wasn't in the gem file.
After each change above, I also restarted the nginx server to test. The outcome was the same.
I am so frustrated. I am ready to start over, but if there is an error in my configuration, I will got through the whole process and end up with the same problem.
How do I make sure that I completely remove the msgpack gem and then reinstall it from scratch? I'm also open to any other helpful ideas anyone may have on how to proceed. Thanks!
As requested, here are the contents my Gemfile:
source 'https://rubygems.org'
# Export data to spreadsheets
gem 'axlsx', '2.1.0.pre'
gem 'axlsx_rails'
gem 'acts_as_xlsx'
gem 'axlsx_styler'
# Barby barcode generator
gem 'barby', '~> 0.6.6'
gem 'bootsnap'
gem 'msgpack'
# gem 'bigdecimal', '>=1.4', '<2.0.0'
gem 'chunky_png'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '5.2.4'
gem 'railties', '5.2.4'
# Use mysql as the database for Active Record
gem 'mysql2', '>= 0.4.4'
# gem 'rails_12factor', group: :production
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails', '>= 4.2.0'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
gem 'jquery-turbolinks', '~> 2.1'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
# Use ActiveModel has_secure_password
gem 'bcrypt', '~> 3.1.7'
# gem 'bootstrap-sass', '~> 3.3.5.1'
gem 'momentjs-rails', '~> 2.5.0'
# gem 'bootstrap3-datetimepicker-rails', '~> 3.0.0.1'
gem 'twitter-bootstrap-rails', '~> 3.2'
# for paginating ActiveRecord search results
gem 'pagy'
# to continue to use div_for which has been deprecated
gem 'record_tag_helper', '~> 1.0'
# Use Unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug'
# Access an IRB console on exception pages or by using <%= console %> in views
gem 'web-console'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
# Formtastic - making form creation easier
gem 'formtastic', '~>3.1.2'
# Responders for AJAX
gem 'responders', '~> 2.0'
gem 'capistrano', '~> 3.4.0'
gem 'capistrano-bundler', '~> 1.1', '>= 1.1.4'
gem 'capistrano-rails', '~> 1.1', '>= 1.1.5'
#gem 'capistrano-rbenv', github: "capistrano/rbenv"
gem 'capistrano-rbenv', '~> 2.0', '>= 2.0.3'
gem 'rspec-rails', '~> 3.0'
# gem 'capybara'
gem 'pry-rails'
end
My environments.rb:
# Load the Rails application.
require File.expand_path('../application', __FILE__)
# Initialize the Rails application.
Rails.application.initialize!

block error learning ruby on rails

i am teaching myself Ruby on rails i have got up to the tutorial on running the local web server. i have done everything up to this step and when i run rails server i get this error can someone explain what is going on in this error.
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.4/lib/bundler/d
sl.rb:159:in `group': no block given (yield) (LocalJumpError)
from C:/Users/rto/Desktop/rails_projects/first_app/Gemfile:23:in `eval_g
emfile'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.4/
lib/bundler/dsl.rb:30:in `instance_eval'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.4/
lib/bundler/dsl.rb:30:in `eval_gemfile'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.4/
lib/bundler/dsl.rb:9:in `evaluate'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.4/
lib/bundler/definition.rb:19:in `build'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.4/
lib/bundler.rb:148:in `definition'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.4/
lib/bundler.rb:116:in `setup'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.4/
lib/bundler/setup.rb:7:in `<top (required)>'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/site_ruby/1.9.1/rubygems/core_
ext/kernel_require.rb:116:in `require'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/site_ruby/1.9.1/rubygems/core_
ext/kernel_require.rb:116:in `rescue in require'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/site_ruby/1.9.1/rubygems/core_
ext/kernel_require.rb:122:in `require'
from C:/Users/rto/Desktop/rails_projects/first_app/config/boot.rb:6:in `
<top (required)>'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/site_ruby/1.9.1/rubygems/core_
ext/kernel_require.rb:51:in `require'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/site_ruby/1.9.1/rubygems/core_
ext/kernel_require.rb:51:in `require'
from script/rails:5:in `<main>'
source 'https://rubygems.org'
gem 'rails', '3.2.13'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3',
# Gems used only for assets and not required
# in production environments by default.
group =>assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
# See https://github.com/sstephenson/execjs
#readme for more supported runtimes
# gem 'therubyracer', :platforms => :ruby
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# To use Jbuilder templates for JSON
# gem 'jbuilder'
# Use unicorn as the app server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'debugger'
group =>assets do
you are missing a colon in gemfile. Should read:
group :assets do
This is bundler complaining about missing blocks. I'd guess that your Gemfile is messed up. That is, you have there something like this
group :development
Whereas you are supposed to provide a block
group :development do
gem 'pry'
# other gems
end
Update:
You have several errors in your Gemfile
gem 'sqlite3',
This shouldn't have a comma
group =>assets do
This should be group :assets do
This error will occur when working with blocks.
When you used the 'yield' statement inside the method and didn't pass block as parameter then it will raise the 'no block given (yield) (LocalJumpError)' error.
def my_method
yield
end
puts my_method
In the above method call we are not passing parameter as a block so it will throw '(LocalJumpError) error'.
Here is the correct way to pass block as a parameter
def my_method
yield
end
puts my_method{puts 'something'}

Error when trying to run rails server after migrating from 3.0.10 to 3.1.19

I tried to follow this railscast to migrate my 3.0.10 rails app to 3.1.10, but things didn't go as smoothly for me as they did for Ryan. After working through some gemset dependency problems I now hit the following error when trying to launch the development server:
[nw0.0.1master (migrate_to_31)]$ rails s
=> Booting WEBrick
=> Rails 3.1.10 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/Users/charlesweinberger/.rvm/gems/ruby-1.9.2-p290#global/gems/rake-0.8.7/lib/rake.rb:2503:in `const_missing': uninitialized constant Sass::Plugin (NameError)
from /Users/charlesweinberger/.rvm/gems/ruby-1.9.2-p290#rails31/gems/aws-s3-0.6.3/lib/aws/s3/extensions.rb:212:in `const_missing_from_s3_library'
from /Users/charlesweinberger/rails_projects/nw0.0.1master/config/initializers/active_admin.rb:2:in `<top (required)>'
from /Users/charlesweinberger/.rvm/gems/ruby-1.9.2-p290#rails31/gems/railties-3.1.10/lib/rails/engine.rb:556:in `block (2 levels) in <class:Engine>'
from /Users/charlesweinberger/.rvm/gems/ruby-1.9.2-p290#rails31/gems/railties-3.1.10/lib/rails/engine.rb:555:in `each'
from /Users/charlesweinberger/.rvm/gems/ruby-1.9.2-p290#rails31/gems/railties-3.1.10/lib/rails/engine.rb:555:in `block in <class:Engine>'
from /Users/charlesweinberger/.rvm/gems/ruby-1.9.2-p290#rails31/gems/railties-3.1.10/lib/rails/initializable.rb:30:in `instance_exec'
from /Users/charlesweinberger/.rvm/gems/ruby-1.9.2-p290#rails31/gems/railties-3.1.10/lib/rails/initializable.rb:30:in `run'
from /Users/charlesweinberger/.rvm/gems/ruby-1.9.2-p290#rails31/gems/railties-3.1.10/lib/rails/initializable.rb:55:in `block in run_initializers'
from /Users/charlesweinberger/.rvm/gems/ruby-1.9.2-p290#rails31/gems/railties-3.1.10/lib/rails/initializable.rb:54:in `each'
from /Users/charlesweinberger/.rvm/gems/ruby-1.9.2-p290#rails31/gems/railties-3.1.10/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/charlesweinberger/.rvm/gems/ruby-1.9.2-p290#rails31/gems/railties-3.1.10/lib/rails/application.rb:96:in `initialize!'
from /Users/charlesweinberger/.rvm/gems/ruby-1.9.2-p290#rails31/gems/railties-3.1.10/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /Users/charlesweinberger/rails_projects/nw0.0.1master/config/environment.rb:7:in `<top (required)>'
from /Users/charlesweinberger/rails_projects/nw0.0.1master/config.ru:3:in `block in <main>'
from /Users/charlesweinberger/.rvm/gems/ruby-1.9.2-p290#rails31/gems/rack-1.3.8/lib/rack/builder.rb:51:in `instance_eval'
from /Users/charlesweinberger/.rvm/gems/ruby-1.9.2-p290#rails31/gems/rack-1.3.8/lib/rack/builder.rb:51:in `initialize'
from /Users/charlesweinberger/rails_projects/nw0.0.1master/config.ru:in `new'
from /Users/charlesweinberger/rails_projects/nw0.0.1master/config.ru:in `<main>'
from /Users/charlesweinberger/.rvm/gems/ruby-1.9.2-p290#rails31/gems/rack-1.3.8/lib/rack/builder.rb:40:in `eval'
from /Users/charlesweinberger/.rvm/gems/ruby-1.9.2-p290#rails31/gems/rack-1.3.8/lib/rack/builder.rb:40:in `parse_file'
from /Users/charlesweinberger/.rvm/gems/ruby-1.9.2-p290#rails31/gems/rack-1.3.8/lib/rack/server.rb:200:in `app'
from /Users/charlesweinberger/.rvm/gems/ruby-1.9.2-p290#rails31/gems/railties-3.1.10/lib/rails/commands/server.rb:46:in `app'
from /Users/charlesweinberger/.rvm/gems/ruby-1.9.2-p290#rails31/gems/rack-1.3.8/lib/rack/server.rb:304:in `wrapped_app'
from /Users/charlesweinberger/.rvm/gems/ruby-1.9.2-p290#rails31/gems/rack-1.3.8/lib/rack/server.rb:254:in `start'
from /Users/charlesweinberger/.rvm/gems/ruby-1.9.2-p290#rails31/gems/railties-3.1.10/lib/rails/commands/server.rb:70:in `start'
from /Users/charlesweinberger/.rvm/gems/ruby-1.9.2-p290#rails31/gems/railties-3.1.10/lib/rails/commands.rb:54:in `block in <top (required)>'
from /Users/charlesweinberger/.rvm/gems/ruby-1.9.2-p290#rails31/gems/railties-3.1.10/lib/rails/commands.rb:49:in `tap'
from /Users/charlesweinberger/.rvm/gems/ruby-1.9.2-p290#rails31/gems/railties-3.1.10/lib/rails/commands.rb:49:in `<top (required)>'
from script/rails:37:in `require'
from script/rails:37:in `<main>'
Here is my current Gemfile:
gem "pg"
gem 'pg_search'
gem 'rails', '3.1.10'
gem 'nokogiri', '1.5.5'
gem 'geocoder', '1.0.2'
gem 'devise', '1.5.3'
gem 'acts_as_api', '0.3.8'
gem 'paperclip', '~>2.4.1'
gem 'rake', '0.8.7'
gem 'omniauth', :git => 'https://github.com/intridea/omniauth.git'
gem 'fb_graph', '1.9.5'
gem 'twitter', :git => 'https://github.com/sferik/twitter.git'
gem 'jquery-rails', '>= 1.0.12'
gem 'aws-s3'
gem 'remotipart', '~> 1.0'
gem 'activeadmin'
gem 'formtastic', '~> 2.1.0'
gem "browser"
gem "httparty"
gem "thin"
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', " ~> 3.1.0"
gem 'coffee-rails', "~> 3.1.0"
gem 'uglifier'
end
group :production, :staging do
end
group :development do
gem 'rspec-rails'
gem 'annotate', '2.4.0'
gem 'faker', '0.3.1'
gem 'ruby-debug19', '0.11.6'
gem 'nifty-generators', '0.4.6'
gem 'silent-postgres'
end
group :test do
gem 'rspec'
gem 'webrat', '0.7.1'
gem 'factory_girl_rails'
gem "mocha", '0.9.12'
gem 'silent-postgres'
end
And, I've enabled the asset pipeline in application.rb. Here is application.rb:
require File.expand_path('../boot', __FILE__)
require 'rails/all'
# If you precompile assets before deploying to production, use this line
Bundler.require *Rails.groups(:assets => %w(development test))
# If you want your assets lazily compiled in production, use this line
# Bundler.require(:default, :assets, Rails.env)
module Nw001
class Application < Rails::Application
# Enable the asset pipeline
config.assets.enabled = true
# Version of your assets, change this if you want to expire all your assets
config.assets.version = '1.0'
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
# Custom directories with classes and modules you want to be autoloadable.
# config.autoload_paths += %W(#{config.root}/extras)
# Only load the plugins named here, in the order given (default is alphabetical).
# :all can be used as a placeholder for all plugins not explicitly named.
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
# Activate observers that should always be running.
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
# config.time_zone = 'Central Time (US & Canada)'
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
# config.i18n.default_locale = :de
# JavaScript files you want as :defaults (application.js is always included).
# config.action_view.javascript_expansions[:defaults] = %w(jquery rails)
# Configure the default encoding used in templates for Ruby 1.9.
config.encoding = "utf-8"
# Configure sensitive parameters which will be filtered from the log file.
config.filter_parameters += [:password]
# Use SQL instead of Active Record's schema dumper when creating the database.
# This is necessary if your schema can't be completely dumped by the schema dumper,
# like if you have constraints or database-specific column types
# Note, the migration that I use to install the unaccented module for pgs requires SQL
# config.active_record.schema_format = :sql
#uncomment to force ssl on localhost
# config.middleware.insert_before ActionDispatch::Static, "Rack::SSL"
end
end
And, made the suggested additions to my config/environments files.
Any idea how to get passed the uninitialized constant Sass::Plugin (NameError)???
I've also tried to use rails 3.1.0, which throws the same error. I also ran rails generate active_admin:assets to update the active_admin assets, but no love.
UPDATE
On the suggestion of #andrew I created a new sample rails3.1.10 application. Actually, what I did was delete my previous gemset for 3.1; create a new gemset using rvm; installed rails 3.1.10 into the new gemset; started using that new 3.1 gemset; and then created a new rails 3.1.10 app. The app ran as expected.
I then took things one step further by replacing the new apps gemfile with the gemfile from the app that I'm trying to migrate to 3.1.10. After working through a couple of dependency issues and reinserting the sqlite3 gem into the gemfile, again the new test app ran just as expected.
I then copied the test apps' gemfile back into the app that I'm trying to migrate and, still using the new 3.1 gemset, tried to load the development server. I still got an error, and it is similar to the error listed above, but it is somewhat different. Check it out:
[nw0.0.1master (master)]$ rails s
=> Booting WEBrick
=> Rails 3.1.10 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/Users/charlesweinberger/.rvm/gems/ruby-1.9.2-p290#rails31/gems/aws-s3-0.6.3/lib/aws/s3/extensions.rb:212:in `const_missing_from_s3_library': uninitialized constant Sass::Plugin (NameError)
from /Users/charlesweinberger/rails_projects/nw0.0.1master/config/initializers/active_admin.rb:2:in `<top (required)>'
from /Users/charlesweinberger/.rvm/gems/ruby-1.9.2-p290#rails31/gems/railties-3.1.10/lib/rails/engine.rb:556:in `block (2 levels) in <class:Engine>'
from /Users/charlesweinberger/.rvm/gems/ruby-1.9.2-p290#rails31/gems/railties-3.1.10/lib/rails/engine.rb:555:in `each'
from /Users/charlesweinberger/.rvm/gems/ruby-1.9.2-p290#rails31/gems/railties-3.1.10/lib/rails/engine.rb:555:in `block in <class:Engine>'
from /Users/charlesweinberger/.rvm/gems/ruby-1.9.2-p290#rails31/gems/railties-3.1.10/lib/rails/initializable.rb:30:in `instance_exec'
from /Users/charlesweinberger/.rvm/gems/ruby-1.9.2-p290#rails31/gems/railties-3.1.10/lib/rails/initializable.rb:30:in `run'
from /Users/charlesweinberger/.rvm/gems/ruby-1.9.2-p290#rails31/gems/railties-3.1.10/lib/rails/initializable.rb:55:in `block in run_initializers'
from /Users/charlesweinberger/.rvm/gems/ruby-1.9.2-p290#rails31/gems/railties-3.1.10/lib/rails/initializable.rb:54:in `each'
from /Users/charlesweinberger/.rvm/gems/ruby-1.9.2-p290#rails31/gems/railties-3.1.10/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/charlesweinberger/.rvm/gems/ruby-1.9.2-p290#rails31/gems/railties-3.1.10/lib/rails/application.rb:96:in `initialize!'
from /Users/charlesweinberger/.rvm/gems/ruby-1.9.2-p290#rails31/gems/railties-3.1.10/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /Users/charlesweinberger/rails_projects/nw0.0.1master/config/environment.rb:7:in `<top (required)>'
from /Users/charlesweinberger/rails_projects/nw0.0.1master/config.ru:3:in `block in <main>'
from /Users/charlesweinberger/.rvm/gems/ruby-1.9.2-p290#rails31/gems/rack-1.3.8/lib/rack/builder.rb:51:in `instance_eval'
from /Users/charlesweinberger/.rvm/gems/ruby-1.9.2-p290#rails31/gems/rack-1.3.8/lib/rack/builder.rb:51:in `initialize'
from /Users/charlesweinberger/rails_projects/nw0.0.1master/config.ru:in `new'
from /Users/charlesweinberger/rails_projects/nw0.0.1master/config.ru:in `<main>'
from /Users/charlesweinberger/.rvm/gems/ruby-1.9.2-p290#rails31/gems/rack-1.3.8/lib/rack/builder.rb:40:in `eval'
from /Users/charlesweinberger/.rvm/gems/ruby-1.9.2-p290#rails31/gems/rack-1.3.8/lib/rack/builder.rb:40:in `parse_file'
from /Users/charlesweinberger/.rvm/gems/ruby-1.9.2-p290#rails31/gems/rack-1.3.8/lib/rack/server.rb:200:in `app'
from /Users/charlesweinberger/.rvm/gems/ruby-1.9.2-p290#rails31/gems/railties-3.1.10/lib/rails/commands/server.rb:46:in `app'
from /Users/charlesweinberger/.rvm/gems/ruby-1.9.2-p290#rails31/gems/rack-1.3.8/lib/rack/server.rb:304:in `wrapped_app'
from /Users/charlesweinberger/.rvm/gems/ruby-1.9.2-p290#rails31/gems/rack-1.3.8/lib/rack/server.rb:254:in `start'
from /Users/charlesweinberger/.rvm/gems/ruby-1.9.2-p290#rails31/gems/railties-3.1.10/lib/rails/commands/server.rb:70:in `start'
from /Users/charlesweinberger/.rvm/gems/ruby-1.9.2-p290#rails31/gems/railties-3.1.10/lib/rails/commands.rb:54:in `block in <top (required)>'
from /Users/charlesweinberger/.rvm/gems/ruby-1.9.2-p290#rails31/gems/railties-3.1.10/lib/rails/commands.rb:49:in `tap'
from /Users/charlesweinberger/.rvm/gems/ruby-1.9.2-p290#rails31/gems/railties-3.1.10/lib/rails/commands.rb:49:in `<top (required)>'
from script/rails:37:in `require'
from script/rails:37:in `<main>'
Does this new info trigger any ideas???
Thanks!
Problem was caused by me specifying gem 'rake', "0.8.7" in the gemfile. Changed it to gem 'rake', and that solved the problem. Note, you probably don't even need to include rake in the gemfile as it will be included as a dependency.

Can't run new application

I've installed RoR in my MacOS X using this guide
http://ryanbigg.com/2010/12/ubuntu-ruby-rvm-rails-and-you/
Here my versions:
$ ruby --version
ruby 1.8.7 (2010-01-10 patchlevel 249) [universal-darwin11.0]
$ rails --version
Rails 3.2.3
$ gem --version
1.8.23
I was unable to run my app so I've googled and modified Gemfile using this tutorial: http://ruby.railstutorial.org/ruby-on-rails-tutorial-book
Now this is my Gemfile:
source 'https://rubygems.org'
gem 'rails', '3.2.3'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
group :development do
gem 'sqlite3', '1.3.5'
end
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '3.2.4'
gem 'coffee-rails', '3.2.2'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platform => :ruby
gem 'uglifier', '1.2.3'
end
gem 'jquery-rails', '2.0.0'
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# To use Jbuilder templates for JSON
# gem 'jbuilder'
# Use unicorn as the app server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'ruby-debug19', :require => 'ruby-debug'
When I run the app using
rails server
I got this:
=> Booting WEBrick
=> Rails 3.2.3 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/Library/Ruby/Gems/1.8/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:245:in `load': /Users/giacomo/websrc/rubyrails-app/config/initializers/session_store.rb:3: syntax error, unexpected ':', expecting $end (SyntaxError)
...sion_store :cookie_store, key: '_rubyrails-app_session'
^
from /Library/Ruby/Gems/1.8/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:245:in `load'
from /Library/Ruby/Gems/1.8/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:236:in `load_dependency'
from /Library/Ruby/Gems/1.8/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:245:in `load'
from /Library/Ruby/Gems/1.8/gems/railties-3.2.3/lib/rails/engine.rb:588
from /Library/Ruby/Gems/1.8/gems/railties-3.2.3/lib/rails/engine.rb:587:in `each'
from /Library/Ruby/Gems/1.8/gems/railties-3.2.3/lib/rails/engine.rb:587
from /Library/Ruby/Gems/1.8/gems/railties-3.2.3/lib/rails/initializable.rb:30:in `instance_exec'
from /Library/Ruby/Gems/1.8/gems/railties-3.2.3/lib/rails/initializable.rb:30:in `run'
from /Library/Ruby/Gems/1.8/gems/railties-3.2.3/lib/rails/initializable.rb:55:in `run_initializers'
from /Library/Ruby/Gems/1.8/gems/railties-3.2.3/lib/rails/initializable.rb:54:in `each'
from /Library/Ruby/Gems/1.8/gems/railties-3.2.3/lib/rails/initializable.rb:54:in `run_initializers'
from /Library/Ruby/Gems/1.8/gems/railties-3.2.3/lib/rails/application.rb:136:in `initialize!'
from /Library/Ruby/Gems/1.8/gems/railties-3.2.3/lib/rails/railtie/configurable.rb:30:in `send'
from /Library/Ruby/Gems/1.8/gems/railties-3.2.3/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /Users/giacomo/websrc/rubyrails-app/config/environment.rb:5
from /Users/giacomo/websrc/rubyrails-app/config.ru:4:in `require'
from /Users/giacomo/websrc/rubyrails-app/config.ru:4
from /Library/Ruby/Gems/1.8/gems/rack-1.4.1/lib/rack/builder.rb:51:in `instance_eval'
from /Library/Ruby/Gems/1.8/gems/rack-1.4.1/lib/rack/builder.rb:51:in `initialize'
from /Users/giacomo/websrc/rubyrails-app/config.ru:1:in `new'
from /Users/giacomo/websrc/rubyrails-app/config.ru:1
How can I solve the problem?
By using Ruby 1.9.x instead of 1.8.7.
Or by opening /Users/giacomo/websrc/rubyrails-app/config/initializers/session_store.rb and replacing:
key: '_rubyrails-app_session'
With:
:key => '_rubyrails-app_session'
And opening /Users/giacomo/websrc/rubyrails-app/config/initializers/wrap_parameters.rb and replacing:
wrap_parameters format: [:json]
With:
wrap_parameters :format => [:json]
The error occurs because the new ruby has another syntax for hash. Tutorial that you used is outdated, I would suggest to try this: http://railsapps.github.com/installing-rails.html
This is the best I could find. And also it is constantly updated.
In your case you need just to install new version of ruby and then reinstall rails.

Resources