Closed ryan-sattler closed 7 years ago
I'm unable to get tiny_tds
installed locally to reproduce this
I also couldn't get tiny_tds
installed locally until I did brew install freetds
. After brew installing, I was able to successfully bundle install
.
Hmm, so I'm not able to reproduce this nokogiri error. But, I made an example rails app with @ryan-sattler's Gemfile. After brew install freetds
and bundle install
-ing, when I try to run rails s
, I was getting this stacktrace:
➜ example git:(master) ✗ rails s
/Users/Patricia/.rvm/gems/ruby-2.4.1/gems/roxml-3.3.1/lib/roxml/definition.rb:156: warning: constant ::Fixnum is deprecated
/Users/Patricia/.rvm/gems/ruby-2.4.1/gems/bundler-1.16.0.pre.1/lib/bundler/runtime.rb:86:in `rescue in block (2 levels) in require': There was an error while trying to load the gem 'roar-rails'. (Bundler::GemRequireError)
Gem Load Error is: uninitialized constant ActionController::Responder
Did you mean? ActionController::Renderer
Backtrace for gem load error is:
/Users/Patricia/.rvm/gems/ruby-2.4.1/gems/roar-rails-1.1.0/lib/roar/rails/rails4_0_strategy.rb:2:in `<module:Rails>'
/Users/Patricia/.rvm/gems/ruby-2.4.1/gems/roar-rails-1.1.0/lib/roar/rails/rails4_0_strategy.rb:1:in `<top (required)>'
/Users/Patricia/.rvm/gems/ruby-2.4.1/gems/roar-rails-1.1.0/lib/roar-rails.rb:40:in `require'
/Users/Patricia/.rvm/gems/ruby-2.4.1/gems/roar-rails-1.1.0/lib/roar-rails.rb:40:in `<module:Rails>'
/Users/Patricia/.rvm/gems/ruby-2.4.1/gems/roar-rails-1.1.0/lib/roar-rails.rb:20:in `<module:Roar>'
/Users/Patricia/.rvm/gems/ruby-2.4.1/gems/roar-rails-1.1.0/lib/roar-rails.rb:19:in `<top (required)>'
/Users/Patricia/.rvm/gems/ruby-2.4.1/gems/bundler-1.16.0.pre.1/lib/bundler/runtime.rb:83:in `require'
/Users/Patricia/.rvm/gems/ruby-2.4.1/gems/bundler-1.16.0.pre.1/lib/bundler/runtime.rb:83:in `block (2 levels) in require'
/Users/Patricia/.rvm/gems/ruby-2.4.1/gems/bundler-1.16.0.pre.1/lib/bundler/runtime.rb:78:in `each'
/Users/Patricia/.rvm/gems/ruby-2.4.1/gems/bundler-1.16.0.pre.1/lib/bundler/runtime.rb:78:in `block in require'
/Users/Patricia/.rvm/gems/ruby-2.4.1/gems/bundler-1.16.0.pre.1/lib/bundler/runtime.rb:67:in `each'
/Users/Patricia/.rvm/gems/ruby-2.4.1/gems/bundler-1.16.0.pre.1/lib/bundler/runtime.rb:67:in `require'
/Users/Patricia/.rvm/gems/ruby-2.4.1/gems/bundler-1.16.0.pre.1/lib/bundler.rb:114:in `require'
/Users/Patricia/workspace/bundler-rails/example/config/application.rb:7:in `<top (required)>'
/Users/Patricia/.rvm/gems/ruby-2.4.1/gems/railties-5.1.3/lib/rails/commands/server/server_command.rb:129:in `require'
/Users/Patricia/.rvm/gems/ruby-2.4.1/gems/railties-5.1.3/lib/rails/commands/server/server_command.rb:129:in `block in perform'
/Users/Patricia/.rvm/gems/ruby-2.4.1/gems/railties-5.1.3/lib/rails/commands/server/server_command.rb:126:in `tap'
/Users/Patricia/.rvm/gems/ruby-2.4.1/gems/railties-5.1.3/lib/rails/commands/server/server_command.rb:126:in `perform'
/Users/Patricia/.rvm/gems/ruby-2.4.1/gems/thor-0.20.0/lib/thor/command.rb:27:in `run'
/Users/Patricia/.rvm/gems/ruby-2.4.1/gems/thor-0.20.0/lib/thor/invocation.rb:126:in `invoke_command'
/Users/Patricia/.rvm/gems/ruby-2.4.1/gems/thor-0.20.0/lib/thor.rb:387:in `dispatch'
/Users/Patricia/.rvm/gems/ruby-2.4.1/gems/railties-5.1.3/lib/rails/command/base.rb:63:in `perform'
/Users/Patricia/.rvm/gems/ruby-2.4.1/gems/railties-5.1.3/lib/rails/command.rb:44:in `invoke'
/Users/Patricia/.rvm/gems/ruby-2.4.1/gems/railties-5.1.3/lib/rails/commands.rb:16:in `<top (required)>'
bin/rails:9:in `require'
bin/rails:9:in `<main>'
Bundler Error Backtrace:
from /Users/Patricia/.rvm/gems/ruby-2.4.1/gems/bundler-1.16.0.pre.1/lib/bundler/runtime.rb:82:in `block (2 levels) in require'
from /Users/Patricia/.rvm/gems/ruby-2.4.1/gems/bundler-1.16.0.pre.1/lib/bundler/runtime.rb:78:in `each'
from /Users/Patricia/.rvm/gems/ruby-2.4.1/gems/bundler-1.16.0.pre.1/lib/bundler/runtime.rb:78:in `block in require'
from /Users/Patricia/.rvm/gems/ruby-2.4.1/gems/bundler-1.16.0.pre.1/lib/bundler/runtime.rb:67:in `each'
from /Users/Patricia/.rvm/gems/ruby-2.4.1/gems/bundler-1.16.0.pre.1/lib/bundler/runtime.rb:67:in `require'
from /Users/Patricia/.rvm/gems/ruby-2.4.1/gems/bundler-1.16.0.pre.1/lib/bundler.rb:114:in `require'
from /Users/Patricia/workspace/bundler-rails/example/config/application.rb:7:in `<top (required)>'
from /Users/Patricia/.rvm/gems/ruby-2.4.1/gems/railties-5.1.3/lib/rails/commands/server/server_command.rb:129:in `require'
from /Users/Patricia/.rvm/gems/ruby-2.4.1/gems/railties-5.1.3/lib/rails/commands/server/server_command.rb:129:in `block in perform'
from /Users/Patricia/.rvm/gems/ruby-2.4.1/gems/railties-5.1.3/lib/rails/commands/server/server_command.rb:126:in `tap'
from /Users/Patricia/.rvm/gems/ruby-2.4.1/gems/railties-5.1.3/lib/rails/commands/server/server_command.rb:126:in `perform'
from /Users/Patricia/.rvm/gems/ruby-2.4.1/gems/thor-0.20.0/lib/thor/command.rb:27:in `run'
from /Users/Patricia/.rvm/gems/ruby-2.4.1/gems/thor-0.20.0/lib/thor/invocation.rb:126:in `invoke_command'
from /Users/Patricia/.rvm/gems/ruby-2.4.1/gems/thor-0.20.0/lib/thor.rb:387:in `dispatch'
from /Users/Patricia/.rvm/gems/ruby-2.4.1/gems/railties-5.1.3/lib/rails/command/base.rb:63:in `perform'
from /Users/Patricia/.rvm/gems/ruby-2.4.1/gems/railties-5.1.3/lib/rails/command.rb:44:in `invoke'
from /Users/Patricia/.rvm/gems/ruby-2.4.1/gems/railties-5.1.3/lib/rails/commands.rb:16:in `<top (required)>'
from bin/rails:9:in `require'
from bin/rails:9:in `<main>'
I read up on the roar-rails
docs that if you're using >= Rails 4.2, you need gem "responders"
before gem "roar-rails"
in your Gemfile. Since this is Rails 5, I added it in. @ryan-sattler maybe you need to add in the gem "responders"
to your Gemfile? I bundle install
-ed again and got further. I tried restarting my server, but then got another stacktrace, mentioning that I needed the listen
gem:
/Users/Patricia/.rvm/gems/ruby-2.4.1/gems/activesupport-5.1.3/lib/active_support/dependencies.rb:292:in `require':
Could not load the 'listen' gem. Add `gem 'listen'` to the development group of your Gemfile (LoadError)
I added listen
to the Gemfile in the development group section, bundle install
-ed again, and was able to start the server finally with bundle exec rails s
. I tried a rake
command and it worked for me.
This works just fine for me, bundle exec ruby -e 'p(true)'
succeeds
@arbonap Thanks, but adding those gems didn't make any difference. I still get the could-not-find-Nokogiri error, including from @segiddins example of bundle exec ruby -e 'p(true)'
which presumably doesn't invoke Rails.
Is it possible something is corrupt on my box and needs to be removed? I tried the various rm statements given in the troubleshooting guide, but they didn't seem to have any effect (gems did not even need to be reinstalled). Is there a way to blow away all the relevant gems/caches/indexes/etc and try again? (Just uninstalling all versions of Nokogiri and bundling again does not work).
Update: After changing bundler to install with a local --path option, I've now got past the nokogiri error. I assume there is something wrong with my global gems. At any rate, I got the same problems as @arbonap, implemented her fixes, and was able to run the tests.
Thanks for your help.
edit: however bundle exec ruby -e 'p(true)' is still giving the Nokogiri error :(. But I've been able to run the unit tests which is probably good enough.
Glad you got things sorted!
I am an instructor at Wyncode Academy. I was recently verifying multiple rails apps created by students.
One student's app would produce the error described above.
The student's repo is here: https://github.com/zmunir93/rails-practice
The commit I used is 04de31717500fdac4927cd4265e8f6a5855faea6
The output of bundle install
is
Fetching gem metadata from https://rubygems.org/.........
Could not find rack-test-0.7.1 in any of the sources
Out of around 15 rails apps, his was the only one that produced this error on my environment which is as follows:
ruby 2.4.2p198 (2017-09-14 revision 59899) [x86_64-linux]
@dm-wyncode What version of Ruby is he running? I just switched to 2.4.2 and got the same error.
Could not find rack-test-0.7.1 in any of the sources
Switching back to 2.3.1, I can run bundle install
on the same gem file without any complaints.
I got the same issue as above and landed here. Switched to Ruby 2.4.2 and got "Could not find rack" issue. Went back to 2.3.1, bundle install gave me then "Could not find nokogiri-1.7.0.1 in any of the sources". Now I am stuck between a rock and a hard place.
msfconsole
2019-05-06 22:46:19.770 SAST [21222] LOG: received fast shutdown request
waiting for server to shut down....2019-05-06 22:46:19.775 SAST [21222] LOG: aborting any active transactions
2019-05-06 22:46:19.780 SAST [21222] LOG: background worker "logical replication launcher" (PID 21235) exited with exit code 1
2019-05-06 22:46:19.784 SAST [21230] LOG: shutting down
2019-05-06 22:46:19.942 SAST [21222] LOG: database system is shut down
done
server stopped
waiting for server to start....2019-05-06 22:46:20.238 SAST [22670] LOG: listening on IPv4 address "127.0.0.1", port 5432 2019-05-06 22:46:20.253 SAST [22670] LOG: listening on Unix socket "/data/data/com.termux/files/usr/tmp/.s.PGSQL.5432"
2019-05-06 22:46:20.416 SAST [22674] LOG: database system was shut down at 2019-05-06 22:46:19 SAST
2019-05-06 22:46:20.444 SAST [22670] LOG: database system is ready to accept connections
done
server started
Could not find rake-12.3.2 in any of the sources
Run bundle install
to install missing gems.
Could not find rake-12.3.2 in any of the sources
Run bundle install
to install missing gems.
Run bundle install
to install missing gems.
$ bundle install Could not locate Gemfile
$
Gemfile: factory_bot_rails was resolved to 5.0.2, which depends on railties was resolved to 4.2.11.1, which depends on actionpack was resolved to 4.2.11.1, which depends on actionview was resolved to 4.2.11.1, which depends on rails-dom-testing was resolved to 1.0.9, which depends on nokogiri dpkg: error processing package metasploit (--configure): installed metasploit package post-installation script subprocess returned error exit status 5 Errors were encountered while processing: metasploit E: Sub-process /data/data/com.termux/files/usr/bin/dpkg returned an error code (1) $
An error occurred while installing nokogiri
(1.10.2), and Bundler cannot continue.
Make sure that gem install nokogiri -v '1.10.2' --source 'https://rubygems.org/'
succeeds before
bundling.
This issue seems to be the same problem as https://github.com/bundler/bundler/issues/5046 , but that one has already been marked as closed and I have been unable to solve it.
Details: When trying to run
bundle exec rake start
(or other uses ofbundle exec
, or justrake start
) in a Rails project, I get this error:However,
bundle install
seemed to have worked correctly, including installing Nokogiri successfully. Usinggem
to manually uninstall and reinstall Nokogiri did not help.This issue happens with both bundler 1.14.4 and 1.16.0.pre.1, and for various versions of Nokogiri (1.7.0.1, 1.7.2, 1.8.0).
Here's my env:
Environment
Bundler Build Metadata
Gemfile
Gemfile
Gemfile.lock