Error installing rails api with postgresql - ruby-on-rails

I am trying to build a skeleton rails-api to use for future use but keep coming across an error. So i am in a folder call Rails_API_Skeleton and i run..
gem install rails-api
Which runs fine.
I then run...
rails-api new Skeleton_App -d postgresql -T
Which also runs without any issues. So i...
cd Skeleton_App/
then run...
bin/rake db:create
And get the following error, which after much googling i cant figure out how to resolve.
/Users/username/.rvm/gems/ruby-2.2.2/gems/bundler-1.12.5/lib/bundler/runtime.rb:89:in `rescue in block (2 levels) in require': There was an error while trying to load the gem 'rails-api'.
Gem Load Error is: uninitialized constant ActionController::API::RackDelegation
Backtrace for gem load error is:
/Users/username/.rvm/gems/ruby-2.2.2/gems/rails-api-0.4.0/lib/rails-api/action_controller/api.rb:131:in `<class:API>'
/Users/username/.rvm/gems/ruby-2.2.2/gems/rails-api-0.4.0/lib/rails-api/action_controller/api.rb:85:in `<module:ActionController>'
/Users/username/.rvm/gems/ruby-2.2.2/gems/rails-api-0.4.0/lib/rails-api/action_controller/api.rb:5:in `<top (required)>'
/Users/username/.rvm/gems/ruby-2.2.2/gems/rails-api-0.4.0/lib/rails-api.rb:3:in `require'
/Users/username/.rvm/gems/ruby-2.2.2/gems/rails-api-0.4.0/lib/rails-api.rb:3:in `<top (required)>'
/Users/username/.rvm/gems/ruby-2.2.2/gems/bundler-1.12.5/lib/bundler/runtime.rb:86:in `require'
/Users/username/.rvm/gems/ruby-2.2.2/gems/bundler-1.12.5/lib/bundler/runtime.rb:86:in `block (2 levels) in require'
/Users/username/.rvm/gems/ruby-2.2.2/gems/bundler-1.12.5/lib/bundler/runtime.rb:81:in `each'
/Users/username/.rvm/gems/ruby-2.2.2/gems/bundler-1.12.5/lib/bundler/runtime.rb:81:in `block in require'
/Users/username/.rvm/gems/ruby-2.2.2/gems/bundler-1.12.5/lib/bundler/runtime.rb:70:in `each'
/Users/username/.rvm/gems/ruby-2.2.2/gems/bundler-1.12.5/lib/bundler/runtime.rb:70:in `require'
/Users/username/.rvm/gems/ruby-2.2.2/gems/bundler-1.12.5/lib/bundler.rb:102:in `require'
/Users/username/Desktop/Apple_tv_movies_and_stuff/skeletons/Rails_API_Skeleton/Skeleton_App/config/application.rb:17:in `<top (required)>'
/Users/username/.rvm/gems/ruby-2.2.2/gems/spring-1.7.2/lib/spring/application.rb:82:in `require'
/Users/username/.rvm/gems/ruby-2.2.2/gems/spring-1.7.2/lib/spring/application.rb:82:in `preload'
/Users/username/.rvm/gems/ruby-2.2.2/gems/spring-1.7.2/lib/spring/application.rb:143:in `serve'
/Users/username/.rvm/gems/ruby-2.2.2/gems/spring-1.7.2/lib/spring/application.rb:131:in `block in run'
/Users/username/.rvm/gems/ruby-2.2.2/gems/spring-1.7.2/lib/spring/application.rb:125:in `loop'
/Users/username/.rvm/gems/ruby-2.2.2/gems/spring-1.7.2/lib/spring/application.rb:125:in `run'
/Users/username/.rvm/gems/ruby-2.2.2/gems/spring-1.7.2/lib/spring/application/boot.rb:19:in `<top (required)>'
/Users/username/.rvm/rubies/ruby-2.2.2/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Users/username/.rvm/rubies/ruby-2.2.2/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
-e:1:in `<main>'
Bundler Error Backtrace:
(Bundler::GemRequireError)
from /Users/username/.rvm/gems/ruby-2.2.2/gems/bundler-1.12.5/lib/bundler/runtime.rb:85:in `block (2 levels) in require'
from /Users/username/.rvm/gems/ruby-2.2.2/gems/bundler-1.12.5/lib/bundler/runtime.rb:81:in `each'
from /Users/username/.rvm/gems/ruby-2.2.2/gems/bundler-1.12.5/lib/bundler/runtime.rb:81:in `block in require'
from /Users/username/.rvm/gems/ruby-2.2.2/gems/bundler-1.12.5/lib/bundler/runtime.rb:70:in `each'
from /Users/username/.rvm/gems/ruby-2.2.2/gems/bundler-1.12.5/lib/bundler/runtime.rb:70:in `require'
from /Users/username/.rvm/gems/ruby-2.2.2/gems/bundler-1.12.5/lib/bundler.rb:102:in `require'
from /Users/username/Desktop/Apple_tv_movies_and_stuff/skeletons/Rails_API_Skeleton/Skeleton_App/config/application.rb:17:in `<top (required)>'
from /Users/username/.rvm/gems/ruby-2.2.2/gems/spring-1.7.2/lib/spring/application.rb:82:in `require'
from /Users/username/.rvm/gems/ruby-2.2.2/gems/spring-1.7.2/lib/spring/application.rb:82:in `preload'
from /Users/username/.rvm/gems/ruby-2.2.2/gems/spring-1.7.2/lib/spring/application.rb:143:in `serve'
from /Users/username/.rvm/gems/ruby-2.2.2/gems/spring-1.7.2/lib/spring/application.rb:131:in `block in run'
from /Users/username/.rvm/gems/ruby-2.2.2/gems/spring-1.7.2/lib/spring/application.rb:125:in `loop'
from /Users/username/.rvm/gems/ruby-2.2.2/gems/spring-1.7.2/lib/spring/application.rb:125:in `run'
from /Users/username/.rvm/gems/ruby-2.2.2/gems/spring-1.7.2/lib/spring/application/boot.rb:19:in `<top (required)>'
from /Users/username/.rvm/rubies/ruby-2.2.2/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/username/.rvm/rubies/ruby-2.2.2/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from -e:1:in `<main>'
Thanks for any help in advance

I suspect something changed with the gem in response to Rails 5.
Maybe its use is deprecated now?
Anyway, the new Rails API way seems to be
http://edgeguides.rubyonrails.org/api_app.html
rails new skeleton_api --api

Related

Unable to run sidekiq getting "No module named 'pandas'"

I am using Ruby version "ruby 2.5.1". My Ruby on Rails application fails with the following error even pandas installed in my machine. pandas (0.24.2) and bundler (2.0.1, default: 1.16.2) installed in my machine. What is the problem here, How can I resolve this issue?
$bundle exec sidekiq
There was an error while trying to load the gem 'pandas'.
Gem Load Error is: <class 'ModuleNotFoundError'>: No module named 'pandas'
Backtrace for gem load error is:
/home/user/.rvm/gems/ruby-2.5.1#myapp/gems/pycall-1.2.1/lib/pycall.rb:62:in `import_module'
/home/user/.rvm/gems/ruby-2.5.1#myapp/gems/pycall-1.2.1/lib/pycall.rb:62:in `import_module'
/home/user/.rvm/gems/ruby-2.5.1#myapp/gems/pandas-0.3.1/lib/pandas.rb:4:in `<main>'
/home/user/.rvm/gems/ruby-2.5.1#myapp/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
/home/user/.rvm/gems/ruby-2.5.1#myapp/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
/home/user/.rvm/gems/ruby-2.5.1#myapp/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
/home/user/.rvm/gems/ruby-2.5.1#myapp/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
/home/user/.rvm/gems/ruby-2.5.1#myapp/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
/home/user/.rvm/rubies/ruby-2.5.1/lib/ruby/site_ruby/2.5.0/bundler/runtime.rb:81:in `block (2 levels) in require'
/home/user/.rvm/rubies/ruby-2.5.1/lib/ruby/site_ruby/2.5.0/bundler/runtime.rb:76:in `each'
/home/user/.rvm/rubies/ruby-2.5.1/lib/ruby/site_ruby/2.5.0/bundler/runtime.rb:76:in `block in require'
/home/user/.rvm/rubies/ruby-2.5.1/lib/ruby/site_ruby/2.5.0/bundler/runtime.rb:65:in `each'
/home/user/.rvm/rubies/ruby-2.5.1/lib/ruby/site_ruby/2.5.0/bundler/runtime.rb:65:in `require'
/home/user/.rvm/rubies/ruby-2.5.1/lib/ruby/site_ruby/2.5.0/bundler.rb:114:in `require'
/home/user/work/projects/myapp/config/application.rb:18:in `<top (required)>'
/home/user/work/projects/myapp/config/environment.rb:2:in `require_relative'
/home/user/work/projects/myapp/config/environment.rb:2:in `<top (required)>'
/home/user/.rvm/gems/ruby-2.5.1#myapp/gems/sidekiq-5.2.5/lib/sidekiq/cli.rb:288:in `require'
/home/user/.rvm/gems/ruby-2.5.1#myapp/gems/sidekiq-5.2.5/lib/sidekiq/cli.rb:288:in `boot_system'
/home/user/.rvm/gems/ruby-2.5.1#myapp/gems/sidekiq-5.2.5/lib/sidekiq/cli.rb:46:in `run'
/home/user/.rvm/gems/ruby-2.5.1#myapp/gems/sidekiq-5.2.5/bin/sidekiq:12:in `<top (required)>'
/home/user/.rvm/gems/ruby-2.5.1#myapp/bin/sidekiq:23:in `load'
/home/user/.rvm/gems/ruby-2.5.1#myapp/bin/sidekiq:23:in `<main>'
/home/user/.rvm/gems/ruby-2.5.1#myapp/bin/ruby_executable_hooks:24:in `eval'
/home/user/.rvm/gems/ruby-2.5.1#myapp/bin/ruby_executable_hooks:24:in `<main>'
Bundler Error Backtrace:
/home/user/.rvm/rubies/ruby-2.5.1/lib/ruby/site_ruby/2.5.0/bundler/runtime.rb:84:in `rescue in block (2 levels) in require'
/home/user/.rvm/rubies/ruby-2.5.1/lib/ruby/site_ruby/2.5.0/bundler/runtime.rb:80:in `block (2 levels) in require'
/home/user/.rvm/rubies/ruby-2.5.1/lib/ruby/site_ruby/2.5.0/bundler/runtime.rb:76:in `each'
/home/user/.rvm/rubies/ruby-2.5.1/lib/ruby/site_ruby/2.5.0/bundler/runtime.rb:76:in `block in require'
/home/user/.rvm/rubies/ruby-2.5.1/lib/ruby/site_ruby/2.5.0/bundler/runtime.rb:65:in `each'
/home/user/.rvm/rubies/ruby-2.5.1/lib/ruby/site_ruby/2.5.0/bundler/runtime.rb:65:in `require'
/home/user/.rvm/rubies/ruby-2.5.1/lib/ruby/site_ruby/2.5.0/bundler.rb:114:in `require'
/home/user/work/projects/myapp/config/application.rb:18:in `<top (required)>'
/home/user/work/projects/myapp/config/environment.rb:2:in `require_relative'
/home/user/work/projects/myapp/config/environment.rb:2:in `<top (required)>'
/home/user/.rvm/gems/ruby-2.5.1#myapp/gems/sidekiq-5.2.5/lib/sidekiq/cli.rb:288:in `require'
/home/user/.rvm/gems/ruby-2.5.1#myapp/gems/sidekiq-5.2.5/lib/sidekiq/cli.rb:288:in `boot_system'
/home/user/.rvm/gems/ruby-2.5.1#myapp/gems/sidekiq-5.2.5/lib/sidekiq/cli.rb:46:in `run'
/home/user/.rvm/gems/ruby-2.5.1#myapp/gems/sidekiq-5.2.5/bin/sidekiq:12:in `<top (required)>'
/home/user/.rvm/gems/ruby-2.5.1#myapp/bin/sidekiq:23:in `load'
/home/user/.rvm/gems/ruby-2.5.1#myapp/bin/sidekiq:23:in `<main>'
The above error getting resolved after installing python3-pandas
apt-get install python3-pandas

Error installing devise gem

I'm trying to use devise gem on a rails app.
That's what I do:
rails new DeviseApp
cd ./DeviseApp
bundle install
Then I go to the gemfile inside the project and put that code:
gem 'devise'
After that, I perform another bundle install
Then I try the following: rails generate devise:install
I obtain the following error:
/Users/lechucico/.rvm/gems/ruby-2.4.0#rails5.0/gems/bundler-1.14.6/lib/bundler/runtime.rb:94:in `rescue in block (2 levels) in require': There was an error while trying to load the gem 'devise'.
Gem Load Error is: undefined method `alias_method_chain' for ActionDispatch::Routing::RouteSet:Class
Did you mean? alias_method
Backtrace for gem load error is:
/Users/lechucico/.rvm/gems/ruby-2.4.0#rails5.0/gems/devise-1.5.4/lib/devise/rails/routes.rb:14:in `<class:RouteSet>'
/Users/lechucico/.rvm/gems/ruby-2.4.0#rails5.0/gems/devise-1.5.4/lib/devise/rails/routes.rb:2:in `<module:Routing>'
/Users/lechucico/.rvm/gems/ruby-2.4.0#rails5.0/gems/devise-1.5.4/lib/devise/rails/routes.rb:1:in `<top (required)>'
/Users/lechucico/.rvm/gems/ruby-2.4.0#rails5.0/gems/activesupport-5.1.1/lib/active_support/dependencies.rb:292:in `require'
/Users/lechucico/.rvm/gems/ruby-2.4.0#rails5.0/gems/activesupport-5.1.1/lib/active_support/dependencies.rb:292:in `block in require'
/Users/lechucico/.rvm/gems/ruby-2.4.0#rails5.0/gems/activesupport-5.1.1/lib/active_support/dependencies.rb:258:in `load_dependency'
/Users/lechucico/.rvm/gems/ruby-2.4.0#rails5.0/gems/activesupport-5.1.1/lib/active_support/dependencies.rb:292:in `require'
/Users/lechucico/.rvm/gems/ruby-2.4.0#rails5.0/gems/devise-1.5.4/lib/devise/rails.rb:1:in `<top (required)>'
/Users/lechucico/.rvm/gems/ruby-2.4.0#rails5.0/gems/activesupport-5.1.1/lib/active_support/dependencies.rb:292:in `require'
/Users/lechucico/.rvm/gems/ruby-2.4.0#rails5.0/gems/activesupport-5.1.1/lib/active_support/dependencies.rb:292:in `block in require'
/Users/lechucico/.rvm/gems/ruby-2.4.0#rails5.0/gems/activesupport-5.1.1/lib/active_support/dependencies.rb:258:in `load_dependency'
/Users/lechucico/.rvm/gems/ruby-2.4.0#rails5.0/gems/activesupport-5.1.1/lib/active_support/dependencies.rb:292:in `require'
/Users/lechucico/.rvm/gems/ruby-2.4.0#rails5.0/gems/devise-1.5.4/lib/devise.rb:445:in `<top (required)>'
/Users/lechucico/.rvm/gems/ruby-2.4.0#rails5.0/gems/bundler-1.14.6/lib/bundler/runtime.rb:91:in `require'
/Users/lechucico/.rvm/gems/ruby-2.4.0#rails5.0/gems/bundler-1.14.6/lib/bundler/runtime.rb:91:in `block (2 levels) in require'
/Users/lechucico/.rvm/gems/ruby-2.4.0#rails5.0/gems/bundler-1.14.6/lib/bundler/runtime.rb:86:in `each'
/Users/lechucico/.rvm/gems/ruby-2.4.0#rails5.0/gems/bundler-1.14.6/lib/bundler/runtime.rb:86:in `block in require'
/Users/lechucico/.rvm/gems/ruby-2.4.0#rails5.0/gems/bundler-1.14.6/lib/bundler/runtime.rb:75:in `each'
/Users/lechucico/.rvm/gems/ruby-2.4.0#rails5.0/gems/bundler-1.14.6/lib/bundler/runtime.rb:75:in `require'
/Users/lechucico/.rvm/gems/ruby-2.4.0#rails5.0/gems/bundler-1.14.6/lib/bundler.rb:107:in `require'
/Users/lechucico/Documents/rails/DeviseApp/config/application.rb:7:in `<top (required)>'
/Users/lechucico/.rvm/gems/ruby-2.4.0#rails5.0/gems/spring-2.0.1/lib/spring/application.rb:82:in `require'
/Users/lechucico/.rvm/gems/ruby-2.4.0#rails5.0/gems/spring-2.0.1/lib/spring/application.rb:82:in `preload'
/Users/lechucico/.rvm/gems/ruby-2.4.0#rails5.0/gems/spring-2.0.1/lib/spring/application.rb:143:in `serve'
/Users/lechucico/.rvm/gems/ruby-2.4.0#rails5.0/gems/spring-2.0.1/lib/spring/application.rb:131:in `block in run'
/Users/lechucico/.rvm/gems/ruby-2.4.0#rails5.0/gems/spring-2.0.1/lib/spring/application.rb:125:in `loop'
/Users/lechucico/.rvm/gems/ruby-2.4.0#rails5.0/gems/spring-2.0.1/lib/spring/application.rb:125:in `run'
/Users/lechucico/.rvm/gems/ruby-2.4.0#rails5.0/gems/spring-2.0.1/lib/spring/application/boot.rb:19:in `<top (required)>'
/Users/lechucico/.rvm/rubies/ruby-2.4.0/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/Users/lechucico/.rvm/rubies/ruby-2.4.0/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
-e:1:in `<main>'
Bundler Error Backtrace:
(Bundler::GemRequireError)
from /Users/lechucico/.rvm/gems/ruby-2.4.0#rails5.0/gems/bundler-1.14.6/lib/bundler/runtime.rb:90:in `block (2 levels) in require'
from /Users/lechucico/.rvm/gems/ruby-2.4.0#rails5.0/gems/bundler-1.14.6/lib/bundler/runtime.rb:86:in `each'
from /Users/lechucico/.rvm/gems/ruby-2.4.0#rails5.0/gems/bundler-1.14.6/lib/bundler/runtime.rb:86:in `block in require'
from /Users/lechucico/.rvm/gems/ruby-2.4.0#rails5.0/gems/bundler-1.14.6/lib/bundler/runtime.rb:75:in `each'
from /Users/lechucico/.rvm/gems/ruby-2.4.0#rails5.0/gems/bundler-1.14.6/lib/bundler/runtime.rb:75:in `require'
from /Users/lechucico/.rvm/gems/ruby-2.4.0#rails5.0/gems/bundler-1.14.6/lib/bundler.rb:107:in `require'
from /Users/lechucico/Documents/rails/DeviseApp/config/application.rb:7:in `<top (required)>'
from /Users/lechucico/.rvm/gems/ruby-2.4.0#rails5.0/gems/spring-2.0.1/lib/spring/application.rb:82:in `require'
from /Users/lechucico/.rvm/gems/ruby-2.4.0#rails5.0/gems/spring-2.0.1/lib/spring/application.rb:82:in `preload'
from /Users/lechucico/.rvm/gems/ruby-2.4.0#rails5.0/gems/spring-2.0.1/lib/spring/application.rb:143:in `serve'
from /Users/lechucico/.rvm/gems/ruby-2.4.0#rails5.0/gems/spring-2.0.1/lib/spring/application.rb:131:in `block in run'
from /Users/lechucico/.rvm/gems/ruby-2.4.0#rails5.0/gems/spring-2.0.1/lib/spring/application.rb:125:in `loop'
from /Users/lechucico/.rvm/gems/ruby-2.4.0#rails5.0/gems/spring-2.0.1/lib/spring/application.rb:125:in `run'
from /Users/lechucico/.rvm/gems/ruby-2.4.0#rails5.0/gems/spring-2.0.1/lib/spring/application/boot.rb:19:in `<top (required)>'
from /Users/lechucico/.rvm/rubies/ruby-2.4.0/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/lechucico/.rvm/rubies/ruby-2.4.0/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from -e:1:in `<main>'
What I can do?
There is a fix for this in the master branch for devise. You can install it directly by having the following lines in your gemfile:
gem 'devise', git: 'https://github.com/plataformatec/devise.git', branch: 'master'
gem 'erubis'
see discussion here

Unable to run rails generate social_stream:install

It gives me following error. What should I do?
I'm using rails 4.2.5.1
C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:80:in `rescue in block (2 levels) in require': There was an error while trying to load the gem 'social_stream'. (Bundler::GemRequireError)
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:72:in `each'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:72:in `block in require'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:61:in `each'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:61:in `require'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.11.2/lib/bundler.rb:99:in `require'
from E:/messla/config/application.rb:7:in `<top (required)>'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.2.5.1/lib/rails/commands/commands_tasks.rb:141:in `require'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.2.5.1/lib/rails/commands/commands_tasks.rb:141:in `require_application_and_environment!'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.2.5.1/lib/rails/commands/commands_tasks.rb:128:in `generate_or_destroy'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.2.5.1/lib/rails/commands/commands_tasks.rb:50:in `generate'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.2.5.1/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.2.5.1/lib/rails/commands.rb:17:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
You can try:
first write your Gemfile
gem 'social_stream', :git => 'git://github.com/ging/social_stream.git'
and you can run
bundle update
Or run
rails generate social_stream:install
For explanation look this

bundle console fails w/ uninitialized constant Rails

I have create a new Rails engine using the rails plugin new Foobar --full --mountable command. When running bundle console I get uninitialized constant Rails Why is this?
Resolving dependencies...
Unfortunately, a fatal error has occurred. Please see the Bundler troubleshooting documentation at http://bit.ly/bundler-issues. Thanks!
/Users/kyledecot/Desktop/Foobar/lib/foobar/engine.rb:2:in `<module:Foobar>': uninitialized constant Rails (NameError)
from /Users/kyledecot/Desktop/Foobar/lib/foobar/engine.rb:1:in `<top (required)>'
from /Users/kyledecot/Desktop/Foobar/lib/foobar.rb:1:in `require'
from /Users/kyledecot/Desktop/Foobar/lib/foobar.rb:1:in `<top (required)>'
from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353#global/gems/bundler-1.5.1/lib/bundler/runtime.rb:76:in `require'
from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353#global/gems/bundler-1.5.1/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353#global/gems/bundler-1.5.1/lib/bundler/runtime.rb:72:in `each'
from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353#global/gems/bundler-1.5.1/lib/bundler/runtime.rb:72:in `block in require'
from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353#global/gems/bundler-1.5.1/lib/bundler/runtime.rb:61:in `each'
from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353#global/gems/bundler-1.5.1/lib/bundler/runtime.rb:61:in `require'
from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353#global/gems/bundler-1.5.1/lib/bundler.rb:131:in `require'
from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353#global/gems/bundler-1.5.1/lib/bundler/cli.rb:664:in `console'
from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353#global/gems/bundler-1.5.1/lib/bundler/vendor/thor/command.rb:27:in `run'
from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353#global/gems/bundler-1.5.1/lib/bundler/vendor/thor/invocation.rb:120:in `invoke_command'
from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353#global/gems/bundler-1.5.1/lib/bundler/vendor/thor.rb:363:in `dispatch'
from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353#global/gems/bundler-1.5.1/lib/bundler/vendor/thor/base.rb:438:in `start'
from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353#global/gems/bundler-1.5.1/lib/bundler/cli.rb:10:in `start'
from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353#global/gems/bundler-1.5.1/bin/bundle:22:in `block in <top (required)>'
from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353#global/gems/bundler-1.5.1/lib/bundler/friendly_errors.rb:5:in `with_friendly_errors'
from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353#global/gems/bundler-1.5.1/bin/bundle:22:in `<top (required)>'
from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353#global/bin/bundle:23:in `load'
from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353#global/bin/bundle:23:in `<main>'
from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353#foobar/bin/ruby_executable_hooks:15:in `eval'
from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353#foobar/bin/ruby_executable_hooks:15:in `<main>'
Adding require 'rails' in Foobar/lib/foobar/engine.rb file worked for me. I got my answer from here.

Error running rspec?

I'm working on a Rails app and testing using Rspec. Unfortunately when I try to run bundle exec rspec I'm met with a giant wall of error text (below).
The first line I see is a warning about Nokogiri, but I suspect that is unrelated to the main issue at hand.
WARNING: Nokogiri was built against LibXML version 2.8.0, but has dynamically loaded 2.7.8
Could not open library 'kernel32': dlopen(kernel32, 5): image not found.
Could not open library 'libkernel32.dylib': dlopen(libkernel32.dylib, 5): image not found (LoadError)
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/ffi-1.9.0/lib/ffi/library.rb:123:in `block in ffi_lib'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/ffi-1.9.0/lib/ffi/library.rb:90:in `map'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/ffi-1.9.0/lib/ffi/library.rb:90:in `ffi_lib'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rb-fchange-0.0.5/lib/rb-fchange/native.rb:10:in `<module:Native>'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rb-fchange-0.0.5/lib/rb-fchange/native.rb:8:in `<module:FChange>'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rb-fchange-0.0.5/lib/rb-fchange/native.rb:3:in `<top (required)>'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rb-fchange-0.0.5/lib/rb-fchange.rb:1:in `<top (required)>'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `each'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `block in require'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler.rb:132:in `require'
/Users/varunrau/Documents/curr/BPSF/config/application.rb:7:in `<top (required)>'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:45:in `require'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:45:in `require'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/spork-0.9.2/lib/spork/app_framework/rails.rb:48:in `preload_rails'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/spork-0.9.2/lib/spork/app_framework/rails.rb:7:in `preload'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/spork-0.9.2/lib/spork/test_framework.rb:134:in `block in preload'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/spork-0.9.2/lib/spork.rb:62:in `exec_prefork'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/spork-0.9.2/lib/spork/test_framework.rb:120:in `preload'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/spork-0.9.2/lib/spork/run_strategy/forking.rb:25:in `preload'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/spork-0.9.2/lib/spork/runner.rb:74:in `run'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/spork-0.9.2/lib/spork/runner.rb:10:in `run'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/spork-0.9.2/bin/spork:10:in `<top (required)>'
/usr/local/Cellar/ruby/1.9.3-p194/bin/spork:23:in `load'
/usr/local/Cellar/ruby/1.9.3-p194/bin/spork:23:in `<main>'
My system details are: OS X 10.8, Rails 3.2.13, Ruby 1.9.3p194. I tried reinstalling Ruby and the rb-fchange gem as per some advice on this site, but nothing has worked.
Thanks so much for the help!

Resources