I am installing passenger + nginx on ubuntu 14.04 & ruby 2.2.4. There are bundler errors with passenger-install-nginx-module
$passenger-install-nginx-module
/home/ubuntu/.rvm/gems/ruby-2.2.4/gems/bundler-1.13.1/lib/bundler/rubygems_ext.rb:45:in `full_gem_path': uninitialized constant Bundler::Plugin::API::Source (NameError)
from /home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/basic_specification.rb:144:in `block in full_require_paths'
from /home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/basic_specification.rb:143:in `map'
from /home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/basic_specification.rb:143:in `full_require_paths'
from /home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/basic_specification.rb:76:in `contains_requirable_file?'
from /home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/specification.rb:949:in `block in find_in_unresolved'
from /home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/specification.rb:949:in `each'
from /home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/specification.rb:949:in `find_all'
from /home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/specification.rb:949:in `find_in_unresolved'
from /home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:74:in `require'
from /home/ubuntu/.rvm/gems/ruby-2.2.4/gems/bundler-1.13.1/lib/bundler/plugin/api/source.rb:2:in `<top (required)>'
from /home/ubuntu/.rvm/gems/ruby-2.2.4/gems/bundler-1.13.1/lib/bundler/rubygems_ext.rb:45:in `full_gem_path'
from /home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/basic_specification.rb:144:in `block in full_require_paths'
from /home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/basic_specification.rb:143:in `map'
from /home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/basic_specification.rb:143:in `full_require_paths'
from /home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/specification.rb:1370:in `add_self_to_load_path'
from /home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/specification.rb:1283:in `activate'
from /home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_gem.rb:67:in `block in gem'
from /home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_gem.rb:66:in `synchronize'
from /home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_gem.rb:66:in `gem'
from /home/ubuntu/.rvm/gems/ruby-2.2.4/bin/passenger-install-nginx-module:22:in `<main>'
from /home/ubuntu/.rvm/gems/ruby-2.2.4/bin/ruby_executable_hooks:15:in `eval'
from /home/ubuntu/.rvm/gems/ruby-2.2.4/bin/ruby_executable_hooks:15:in `<main>'
Before that, gem passenger (v5.0.30) and rails 4.2.0 have been installed. What causes the error?
Had the same problem,
What I did:
gem uninstall bundler -v1.13.1
(or gem uninstall bundler -v1.13)
Then
gem install bundler -v 1.12
Then passenger-install-apache2-module works.
Suggestions here:
https://github.com/fastlane/fastlane/issues/6203
https://github.com/fastlane/fastlane/issues/6066
Check if you have the right version of RubyGems
$ gem -v
2.6.5 (or superior)
If you have not, upgrade your RubyGems:
$ gem update --system
If you can't use sudo like this:
$ sudo gem update --system
Now check you have the last bundler version:
$ bundle -v
Bundler version 1.13.0 (or superior)
If you have not, upgrade your Bundler:
$ gem install bundler
Related
I'm using Ubuntu 18.04, Ruby 2.6.3, and Rails 6. I'm working on a new rails project, and when i start the server, i have the following error :
> rails s
=> Booting Puma
=> Rails 6.0.2.1 application starting in development
=> Run `rails server --help` for more startup options
Exiting
Traceback (most recent call last):
[...]
72: from ./bin/rails:3:in `<main>'
71: from ./bin/rails:3:in `load'
70: from /home/franck/code/BTC1M/app-test/bin/spring:15:in `<top (required)>'
69: from /home/franck/.rbenv/versions/2.6.3/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
68: from /home/franck/.rbenv/versions/2.6.3/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
67: from /home/franck/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/binstub.rb:11:in `<top (required)>'
66: from /home/franck/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/binstub.rb:11:in `load'
[...]
5: from /home/franck/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.2.1/lib/active_support/lazy_load_hooks.rb:69:in `block in execute_hook'
4: from /home/franck/.rvm/gems/ruby-2.6.3/gems/less-rails-2.6.0/lib/less/rails/railtie.rb:17:in `block in <class:Railtie>'
3: from /home/franck/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/active_support.rb:58:in `load_missing_constant'
2: from /home/franck/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/active_support.rb:79:in `rescue in load_missing_constant'
1: from /home/franck/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/active_support.rb:8:in `without_bootsnap_cache'
/home/franck/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/active_support.rb:79:in `block in load_missing_constant': uninitialized constant Sprockets::Engines (NameError)
I tried to uninstall and re-install rails and ruby (through those steps) :
rvm implode
rm -rf ~/.rvm
rm -rf ~/.rbenv
sudo apt install -y build-essential tklib zlib1g-dev libssl-dev libffi-dev libxml2 libxml2-dev libxslt1-dev libreadline-dev
sudo apt clean
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
rbenv install 2.6.3
rbenv global 2.6.3
gem install rails
I also tried spring stop, and updating sprockets and sprockets-rails : gem update (my sprockets-rails version is 3.2.1), and updating the sprockets-rails version in Gemfile.lock : sprockets-rails (3.2.1). My sprockets version is 4.0.0.
I also added gem 'sprockets', git: 'git://github.com/rails/sprockets' in my gemfile + bundle install (as it was told on this thread : https://github.com/rails/sass-rails/issues/48 ) but it doesn't fix my issue.
I still have the same error. I don't understand what is going on. Any idea ?
By the way, why do i have a /home/franck/.rvm folder (that i deleted before) as i'm not using RVM but RBENV ?
The github repo is here : https://github.com/BTC1M/app-test
Try removing one by one those old dependencies that might not be compatible with rails > 5, and bundle again:
Start with gem 'less-rails-bootstrap' which last commit is 5 years ago, and which is referenced in your error stack.
Also look at those other dependencies:
gem 'jquery-easing-rails' last commit is 5 yo
gem "font-awesome-rails" last commit 3 yo
Also note that bootstrap-sass and font-awesome-rails doesn't support latest versions of those libraries, and might need some hacking to work on Rails 6, you'd better use those librairies with webpack which is the new standard (Sprocket does not handle JS by default anymore, everything happens in app/javascript which is compiled by webpack).
And, you might not need therubyracer anymore (last commit 3 yo and a lot of recent issues).
Recently I have installed rbenv and specified ruby to 2.3.1 and rails to 5.1.1 but I couldn't run my projects because I got:
Ignoring json-2.1.0 because its extensions are not built. Try: gem pristine json --version 2.1.0
Ignoring nokogiri-1.8.1 because its extensions are not built. Try: gem pristine nokogiri --version 1.8.1
Ignoring unf_ext-0.0.7.4 because its extensions are not built. Try: gem pristine unf_ext --version 0.0.7.4
Ignoring yajl-ruby-1.3.1 because its extensions are not built. Try: gem pristine yajl-ruby --version 1.3.1
/var/lib/gems/2.3.0/gems/bundler-1.16.1/lib/bundler/spec_set.rb:88:in `block in materialize': Could not find unf_ext-0.0.7.4 in any of the sources (Bundler::GemNotFound)
from /var/lib/gems/2.3.0/gems/bundler-1.16.1/lib/bundler/spec_set.rb:82:in `map!'
...
from /home/alex/pnv/vendor/bundle/ruby/2.3.0/gems/spring-2.0.2/bin/spring:49:in `<main>'
I ran:
bundle install
Installation passed successfully, but... Now I get:
/home/alex/pnv/vendor/bundle/ruby/2.3.0/gems/ffi-1.9.18/lib/ffi.rb:6:in `require': incompatible library version - /home/alex/pnv/vendor/bundle/ruby/2.3.0/gems/ffi-1.9.18/lib/ffi_c.so (LoadError)
from /home/alex/pnv/vendor/bundle/ruby/2.3.0/gems/ffi-1.9.18/lib/ffi.rb:6:in `rescue in <top (required)>'
from /home/alex/pnv/vendor/bundle/ruby/2.3.0/gems/ffi-1.9.18/lib/ffi.rb:3:in `<top (required)>'
from /home/alex/pnv/vendor/bundle/ruby/2.3.0/gems/rb-inotify-0.9.8/lib/rb-inotify/native.rb:1:in `require'
from /home/alex/pnv/vendor/bundle/ruby/2.3.0/gems/rb-inotify-0.9.8/lib/rb-inotify/native.rb:1:in `<top (required)>'
from /home/alex/pnv/vendor/bundle/ruby/2.3.0/gems/rb-inotify-0.9.8/lib/rb-inotify.rb:1:in `require'
from /home/alex/pnv/vendor/bundle/ruby/2.3.0/gems/rb-inotify-0.9.8/lib/rb-inotify.rb:1:in `<top (required)>'
from /home/alex/pnv/vendor/bundle/ruby/2.3.0/gems/listen-3.0.8/lib
...
from /home/alex/.rbenv/versions/2.3.1/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:59:in `require'
from -e:1:in `<main>'
And I have no idea how to resolve this. Any help is appreciated!
UPDATE 1:
Finally, I've found source of the evil bug - nevertheless, I specify Rails 5.1.1, when I run rails new app_name, it installs 5.1.6! And seems like it uses 5.1.6 gem dependencies... Still don't know how to resolve instead of upgrading to >= 5.1.6
Add the following line to your Gemfile.
gem 'rails', '5.1.1'
Run bundle install
Using Mac OS 13, rbenv.
ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-darwin17]
Rails 5.1.4
Bundler version 1.16.1
rbenv 1.1.1
I'm trying to start a new Rails application and then getting this:
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems.rb:241:in `bin_path': can't find gem bundler (>= 0) (Gem::GemNotFoundException)
from /Library/Ruby/Gems/2.3.0/gems/railties-5.1.4/lib/rails/generators/app_base.rb:382:in `bundle_command'
from /Library/Ruby/Gems/2.3.0/gems/railties-5.1.4/lib/rails/generators/app_base.rb:416:in `run_bundle'
from (eval):1:in `run_bundle'
from /Library/Ruby/Gems/2.3.0/gems/thor-0.20.0/lib/thor/command.rb:27:in `run'
from /Library/Ruby/Gems/2.3.0/gems/thor-0.20.0/lib/thor/invocation.rb:126:in `invoke_command'
from /Library/Ruby/Gems/2.3.0/gems/thor-0.20.0/lib/thor/invocation.rb:133:in `block in invoke_all'
from /Library/Ruby/Gems/2.3.0/gems/thor-0.20.0/lib/thor/invocation.rb:133:in `each'
from /Library/Ruby/Gems/2.3.0/gems/thor-0.20.0/lib/thor/invocation.rb:133:in `map'
from /Library/Ruby/Gems/2.3.0/gems/thor-0.20.0/lib/thor/invocation.rb:133:in `invoke_all'
from /Library/Ruby/Gems/2.3.0/gems/thor-0.20.0/lib/thor/group.rb:232:in `dispatch'
from /Library/Ruby/Gems/2.3.0/gems/thor-0.20.0/lib/thor/base.rb:466:in `start'
from /Library/Ruby/Gems/2.3.0/gems/railties-5.1.4/lib/rails/commands/application/application_command.rb:24:in `perform'
from /Library/Ruby/Gems/2.3.0/gems/thor-0.20.0/lib/thor/command.rb:27:in `run'
from /Library/Ruby/Gems/2.3.0/gems/thor-0.20.0/lib/thor/invocation.rb:126:in `invoke_command'
from /Library/Ruby/Gems/2.3.0/gems/thor-0.20.0/lib/thor.rb:387:in `dispatch'
from /Library/Ruby/Gems/2.3.0/gems/railties-5.1.4/lib/rails/command/base.rb:63:in `perform'
from /Library/Ruby/Gems/2.3.0/gems/railties-5.1.4/lib/rails/command.rb:44:in `invoke'
from /Library/Ruby/Gems/2.3.0/gems/railties-5.1.4/lib/rails/cli.rb:16:in `<top (required)>'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:127:in `require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:127:in `rescue in require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:40:in `require'
from /Library/Ruby/Gems/2.3.0/gems/railties-5.1.4/exe/rails:9:in `<top (required)>'
from /usr/local/bin/rails:22:in `load'
from /usr/local/bin/rails:22:in `<main>'
As I understand it has something to do with a version of Ruby but I have no idea how to resolve the issue.
It looks like you may need to do a gem install bundler and get the bundler gem to get rails up and running.
STEP (1): install the bundler gem:
sudo gem install bundler
Once completed, you should get a message similar to this:
Fetching: bundler-1.16.1.gem (100%)
Successfully installed bundler-1.16.1
Parsing documentation for bundler-1.16.1
Installing ri documentation for bundler-1.16.1
Done installing documentation for bundler after 6 seconds
1 gem installed
STEP (2): try checking the bundler version:
bundle -v
You should get a version number like this:
Bundler version 1.16.1
STEP (3): now you can use bundle install:
bundle install
I hope my answer helps.
I'm new to Ruby on Rails and was following Lynda's Ruby on Rails essential training guide videos.
In the getting started set of videos, we are shown how the 'rails generator' command works. I have followed all the steps, but every time I type in '$ rails generate' I get the following error:
Warning: You're using Rubygems 2.0.14 with Spring. Upgrade to at least Rubygems 2.1.0 and run `gem pristine --all` for better startup performance.
/Users/waleedrahamtullah/.rbenv/versions/2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- bundler/setup (LoadError)
from /Users/waleedrahamtullah/.rbenv/versions/2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Library/Ruby/Gems/2.0.0/gems/spring-1.1.3/lib/spring/commands.rb:33:in `<module:Spring>'
from /Library/Ruby/Gems/2.0.0/gems/spring-1.1.3/lib/spring/commands.rb:4:in `<top (required)>'
from /Users/waleedrahamtullah/.rbenv/versions/2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/waleedrahamtullah/.rbenv/versions/2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Library/Ruby/Gems/2.0.0/gems/spring-1.1.3/lib/spring/application.rb:77:in `preload'
from /Library/Ruby/Gems/2.0.0/gems/spring-1.1.3/lib/spring/application.rb:140:in `serve'
from /Library/Ruby/Gems/2.0.0/gems/spring-1.1.3/lib/spring/application.rb:128:in `block in run'
from /Library/Ruby/Gems/2.0.0/gems/spring-1.1.3/lib/spring/application.rb:122:in `loop'
from /Library/Ruby/Gems/2.0.0/gems/spring-1.1.3/lib/spring/application.rb:122:in `run'
from /Library/Ruby/Gems/2.0.0/gems/spring-1.1.3/lib/spring/application/boot.rb:18:in `<top (required)>'
from /Users/waleedrahamtullah/.rbenv/versions/2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/waleedrahamtullah/.rbenv/versions/2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from -e:1:in `<main>'
How do you suppose I get around this?
The answer is in the Error:
You're using Rubygems 2.0.14 with Spring. Upgrade to at least Rubygems 2.1.0 and run `gem pristine --all`
Update with this:
gem install rubygems-update
Then run:
gem pristine --all
All should be well.
When I update
gem install rubygems-update
and then
gem pristine --all
it didn't work for me.
But answer from How to upgrade rubygems helped to fix issue, but after that for some reason I had to install rails again and install all gems.
Install rubygems-update
gem install rubygems-update
update_rubygems
gem update --system
run this commands as root or use sudo.
I am using ruby with rbenv so I could run those as normal user.
However, generating new rails site
rails new blog
Shows warning about old rubygems.
Warning: You're using Rubygems 2.0.14 with Spring.
Hmm. Checking the environment:
gem env
shows
RubyGems Environment:
- RUBYGEMS VERSION: 2.0.14
which is no good. As suggested on the internets I run:
gem install rubygems-update
gem pristine --all
update_rubygems
I am not sure if gem pristine --all was needed, but it can't harm anything. Checking the update status now
gem env
shows
RubyGems Environment:
- RUBYGEMS VERSION: 2.4.6
which is good. Calling
rails new blog
and everything went ok. No warning at all.
I'm a beginner in Rails and I've followed ruby.railstutorials.org until I stuck with this section http://ruby.railstutorial.org/ruby-on-rails-tutorial-book#sec:1.4.1
after I installed heroku gem by gem install heruku
I typed heroku keys:add then I got these errors.
/Users/xxx/.rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.4/lib/bundler/resolver.rb:287:in `resolve': Could not find gem 'jquery-rails (= 2.0.0) ruby' in the gems available on this machine. (Bundler::GemNotFound)
from /Users/xxx/.rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.4/lib/bundler/resolver.rb:161:in `start'
from /Users/xxx/.rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.4/lib/bundler/resolver.rb:128:in `block in resolve'
from /Users/xxx/.rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.4/lib/bundler/resolver.rb:127:in `catch'
from /Users/xxx/.rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.4/lib/bundler/resolver.rb:127:in `resolve'
from /Users/xxx/.rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.4/lib/bundler/definition.rb:192:in `resolve'
from /Users/xxx/.rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.4/lib/bundler/definition.rb:127:in `specs'
from /Users/xxx/.rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.4/lib/bundler/environment.rb:27:in `specs'
from /Users/xxx/.rvm/gems/ruby-1.9.3-p194#global/gems/rubygems-bundler-1.0.2/lib/rubygems-bundler/noexec.rb:41:in `candidate?'
from /Users/xxx/.rvm/gems/ruby-1.9.3-p194#global/gems/rubygems-bundler-1.0.2/lib/rubygems-bundler/noexec.rb:60:in `setup'
from /Users/xxx/.rvm/gems/ruby-1.9.3-p194#global/gems/rubygems-bundler-1.0.2/lib/rubygems-bundler/noexec.rb:75:in `<top (required)>'
from /Users/xxx/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `require'
from /Users/xxx/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `rescue in require'
from /Users/xxx/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
from /Users/xxx/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/bin/ruby_noexec_wrapper:9:in `<main>'
abcs-MacBook-Pro-2:first_app xxx$
Could you please let me know how to fix it.
Thanks
Try installing the gem again with the right spelling:
gem install heroku
Check the version of the ruby you are using with
rvm list
ruby -v
gem list
You need to switch to the right ruby with
rvm use <ruby version>
And then install heroku again.
Get Home Brew then run the command "brew doctor". If it tells you that you have errors, fix those errors.
I'm guessing you are on a Mac and that you might be running MacPorts. There are problems with this because MacPorts uses older libs that rvm tries to access. You need to remove opt and a bunch of stuff from your paths where brew doctor complans.