I´m trying to run my Ruby on Rails project on my webserver, I´ve got this message from passenger:
Error message:
Could not find rake-0.9.2.2 in any of the sources (Bundler::GemNotFound)
this happens when I´m trying install budle in SSH.
passenger#web2:/var/www/clients/client11/web100/web$ bundle install .bundle
/home/passenger/.rvm/gems/ruby-1.9.3-p0#global/gems/bundler-1.0.21/lib/bundler/settings.rb:101:in `initialize': Permission denied - /var/www/clients/client11/web100/web/.bundle/config (Errno::EACCES)
from /home/passenger/.rvm/gems/ruby-1.9.3-p0#global/gems/bundler-1.0.21/lib/bundler/settings.rb:101:in `open'
from /home/passenger/.rvm/gems/ruby-1.9.3-p0#global/gems/bundler-1.0.21/lib/bundler/settings.rb:101:in `set_key'
from /home/passenger/.rvm/gems/ruby-1.9.3-p0#global/gems/bundler-1.0.21/lib/bundler/settings.rb:15:in `[]='
from /home/passenger/.rvm/gems/ruby-1.9.3-p0#global/gems/bundler-1.0.21/lib/bundler/cli.rb:211:in `install'
from /home/passenger/.rvm/gems/ruby-1.9.3-p0#global/gems/bundler-1.0.21/lib/bundler/vendor/thor/task.rb:22:in `run'
from /home/passenger/.rvm/gems/ruby-1.9.3-p0#global/gems/bundler-1.0.21/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
from /home/passenger/.rvm/gems/ruby-1.9.3-p0#global/gems/bundler-1.0.21/lib/bundler/vendor/thor.rb:263:in `dispatch'
from /home/passenger/.rvm/gems/ruby-1.9.3-p0#global/gems/bundler-1.0.21/lib/bundler/vendor/thor/base.rb:386:in `start'
from /home/passenger/.rvm/gems/ruby-1.9.3-p0#global/gems/bundler-1.0.21/bin/bundle:13:in `<top (required)>'
from /home/passenger/.rvm/gems/ruby-1.9.3-p0#global/bin/bundle:19:in `load'
from /home/passenger/.rvm/gems/ruby-1.9.3-p0#global/bin/bundle:19:in `<main>'
or when i try
passenger#web2:/var/www/clients/client11/web100/web$ bundle install
Fetching source index for https://rubygems.org/
Errno::EACCES: Permission denied - /var/www/clients/client11/web100/web/bundler/ruby/1.9.1/cache
An error occured while installing rake (0.9.2.2), and Bundler cannot continue.
Make sure that `gem install rake -v '0.9.2.2'` succeeds before bundling.
but web is coded in ruby1.9.3
i tried install rake manually as suggested
passenger#web2:/var/www/clients/client11/web100/web$ gem install rake -v '0.9.2.2'
Fetching: rake-0.9.2.2.gem (100%)
Successfully installed rake-0.9.2.2
1 gem installed
Installing ri documentation for rake-0.9.2.2...
Installing RDoc documentation for rake-0.9.2.2...
passenger#web2:/var/www/clients/client11/web100/web$ bundle install Fetching source index for https://rubygems.org/
Errno::EACCES: Permission denied - /var/www/clients/client11/web100/web/bundler/ruby/1.9.1/cache
An error occured while installing rake (0.9.2.2), and Bundler cannot continue.
Make sure that `gem install rake -v '0.9.2.2'` succeeds before bundling.
It seems you have wrong BUNDLE_PATH value.
Check this article, may be it'll help you: http://blog.ninjahideout.com/posts/the-path-to-better-rvm-and-passenger-integration
Related
I don't know what I missed in my setup. I used rbenv for installing ruby. I learn it this page link. I successfully install ruby and rails. But the problem I have now is when I am in my current project. I did try this command inside my project bundle install, but I always get this error
Traceback (most recent call last):
2: from /home/user90/.rbenv/versions/2.5.1/bin/bundle:23:in `<main>'
1: from /home/user90/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems.rb:308:in `activate_bin_path'
/home/user90/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems.rb:289:in `find_spec_for_exe': can't find gem bundler (>= 0.a) with executable bundle (Gem::GemNotFoundException)
same as doing this command in my current project rails -v
Traceback (most recent call last):
4: from bin/rails:5:in `<main>'
3: from bin/rails:5:in `load'
2: from /var/www/automated-leave-app/bin/spring:9:in `<top (required)>'
1: from /home/user90/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
/home/user90/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require': cannot load such file -- bundler (LoadError)
I also install gem install bundler in my current setup. Does the version matters? Here are my current setup version.
rails 5.2.0
ruby 2.5.1
gem 2.7.6
Solutions for 'Cant find gem bundler (>= 0.a) with executable bundle'
This is official doc on this error, you should have found this on top if you googled correctly. Gist is that there is bundler version mismatch, check gemfile.lock for bundler version and than install that version of bundler.
gem install bundler -v VERSION_FROM_GEMFILE
for example
gem install bundler -v 1.17
I'm trying to move my GitLab to mysql following this. In the process when i try -
$ cd /opt/gitlab/embedded/service/gitlab-rails
$ sudo /opt/gitlab/embedded/bin/bundle install
I get the following error -
Installing gpgme 2.0.13 with native extensions
Installing nokogiri 1.8.2 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory:
/opt/gitlab/embedded/service/gem/ruby/2.3.0/gems/allocations-1.0.5/ext/liballocations
/opt/gitlab/embedded/bin/ruby -r ./siteconf20180615-5748-1r5uwd8.rb
extconf.rb
mkmf.rb can't find header files for ruby at
/opt/gitlab/embedded/lib/ruby/include/ruby.h
extconf failed, exit code 1
Gem files will remain installed in
/opt/gitlab/embedded/service/gem/ruby/2.3.0/gems/allocations-1.0.5 for
inspection. Results logged to
/opt/gitlab/embedded/service/gem/ruby/2.3.0/extensions/x86_64-linux/2.3.0/allocations-1.0.5/gem_make.out
An error occurred while installing allocations (1.0.5), and Bundler
cannot continue. Make sure that gem install allocations -v '1.0.5'
succeeds before bundling.
I have tried sudo gem install allocations -v '1.0.5' which says one gem successfully built but gives the same error over and over. I have ruby2.5-dev installed also.
Edit:
As asked in the comments, this is the config in /opt/gitlab/embedded/service/gitlab-rails/.bundle/config -
BUNDLE_RETRY: "5"
BUNDLE_PATH: "/opt/gitlab/embedded/service/gem"
BUNDLE_JOBS: "9"
BUNDLE_DISABLE_SHARED_GEMS: "true"
BUNDLE_WITHOUT: "development:test:postgres"
If I run sudo gitlab-ctl reconfigure, I get this massive error -
There was an error running gitlab-ctl reconfigure:
bash[migrate gitlab-rails database] (gitlab::database_migrations line 49) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of "bash" "/tmp/chef-script20180618-9085-8vou2p" ----
STDOUT: bundler: failed to load command: rake (/opt/gitlab/embedded/service/gem/ruby/2.3.0/bin/rake)
Bundler::GemNotFound: Your bundle is locked to RedCloth (4.3.2), but that version could not be found in any of the sources listed in your Gemfile. If you haven't changed sources, that means the author of RedCloth (4.3.2) has removed it. You'll need to update your bundle to a different version of RedCloth (4.3.2) that hasn't been removed in order to install.
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/definition.rb:179:in `rescue in specs'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/definition.rb:173:in `specs'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/definition.rb:233:in `specs_for'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/definition.rb:222:in `requested_specs'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:118:in `block in definition_method'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:19:in `setup'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler.rb:99:in `setup'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/setup.rb:20:in `<top (required)>'
/opt/gitlab/embedded/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/opt/gitlab/embedded/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
STDERR:
I am trying to install Fedena open sourse into my windows Have follow all the steps in fedena and wiki but still i am getting error Please help me here is my command lines and I am following this link of fedena http://projectfedena.org/install in these Getting error in "bundle install --local" Here is the Commands windows
C:\Users\Devil>cd c:\Fedena
c:\Fedena>bundle install --local
Some gems seem to be missing from your vendor/cache directory.
You have requested:
mysql = 2.8.1
The bundle currently has mysql locked at 2.8.1.
Try running `bundle update mysql`
If you are updating multiple gems in your Gemfile at once,
try passing them all to `bundle update`
c:\Fedena>bundle update mysql
Fetching gem metadata from http://rubygems.org/...........
Fetching version metadata from http://rubygems.org/...
Fetching dependency metadata from http://rubygems.org/..
Resolving dependencies...
Using rake 0.8.7
Using activesupport 2.3.5
Using rack 1.0.1
Using cgi_multipart_eof_fix 2.5.0
Using daemons 1.2.4
Using declarative_authorization 0.5.1
Installing fastthread 1.0.7 with native extensions
Using fattr 2.2.1
Using gem_plugin 0.2.3
Using i18n 0.4.2
Installing mysql 2.8.1 with native extensions
Installing win32-open3 0.3.2 with native extensions
Using bundler 1.14.3
Using activerecord 2.3.5
Using activeresource 2.3.5
Using actionpack 2.3.5
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory:
C:/Ruby/lib/ruby/gems/2.3.0/gems/fastthread-1.0.7/ext/fastthread
C:/Ruby/bin/ruby.exe -r ./siteconf20170201-7960-vtf9xv.rb extconf.rb
extconf.rb:13:in `block in <main>': uninitialized constant Config (NameError)
Did you mean? RbConfig
from extconf.rb:12:in `open'
from extconf.rb:12:in `<main>'
extconf failed, exit code 1
Gem files will remain installed in
C:/Ruby/lib/ruby/gems/2.3.0/gems/fastthread-1.0.7 for inspection.
Results logged to
C:/Ruby/lib/ruby/gems/2.3.0/extensions/x64-mingw32/2.3.0/fastthread-1.0.7/gem_make.out
An error occurred while installing fastthread (1.0.7), and Bundler cannot
continue.
Make sure that `gem install fastthread -v '1.0.7'` succeeds before bundling.
c:\Fedena>gem install fastthread -v '1.0.7'
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing fastthread:
ERROR: Failed to build gem native extension.
current directory: C:/Ruby/lib/ruby/gems/2.3.0/gems/fastthread-1.0.7/ext/fastthread
C:/Ruby/bin/ruby.exe -r ./siteconf20170201-3752-fbqr51.rb extconf.rb
extconf.rb:13:in `block in <main>': uninitialized constant Config (NameError)
Did you mean? RbConfig
from extconf.rb:12:in `open'
from extconf.rb:12:in `<main>'
extconf failed, exit code 1
Gem files will remain installed in C:/Ruby/lib/ruby/gems/2.3.0/gems/fastthread-1.0.7 for inspection.
Results logged to C:/Ruby/lib/ruby/gems/2.3.0/extensions/x64-mingw32/2.3.0/fastthread-1.0.7/gem_make.out
c:\Fedena>
I just completed my installation successfully. Below are steps I followed:
sudo gem install bundler
bundle install --local
gem install rails -v 2.3.5
sudo apt-get install libmysqlclient-dev mysql-server
gem install rake -v 0.8.7
gem install declarative_authorization -v 0.5.1
gem install i18n -v 0.4.2
gem install mysql
gem install rush -v 0.6.8
gem update --system 1.3.7
rake db:create
rake db:migrate
rake fedena:plugins:install_all
Launch with script/server
Make sure your ruby version is 1.8.7 and rake is 0.8.7
To install ruby 1.8.7 and set as default:
rvm install 1.8.7
rvm use 1.8.7 --default
I have a lot of difficulties to run Ruby on Rails. Maybe you can tell me where I'm wrong ?
I'm on Linux Mint 17.2, with LAMP local server.
To install Ruby :
$ sudo apt-get install ruby
$ ruby -v
ruby 1.9.3p484
$
I didn't have to install gem, it works as shown here :
$ gem help commands
GEM commands are:
build Build a gem from a gemspec
cert Manage RubyGems certificates and signing settings
(...)
update Update the named gems (or all installed gems) in the local
repository
which Find the location of a library file you can require
For help on a particular command, use 'gem help COMMAND'.
Commands may be abbreviated, so long as they are unambiguous.
e.g. 'gem i rake' is short for 'gem install rake'.
Then I installed rails, I dont remember which of those two ways :
$ sudo gem install rails
or
$ sudo apt-get install ruby-railties-4.0
I dont find how to uninstall, so I can't test other ways to install.
Then, I made an application :
$ rails new (path)/second_app
create
create README.rdoc
create Rakefile
create config.ru
create .gitignore
create Gemfile
create app
create app/assets/javascripts/application.js
(...)
create vendor/assets/javascripts
create vendor/assets/javascripts/.keep
create vendor/assets/stylesheets
create vendor/assets/stylesheets/.keep
run bundle install
/usr/lib/ruby/1.9.1/rubygems.rb:308:in `bin_path': can't find gem bundler (>= 0) (Gem::GemNotFoundException)
from /var/lib/gems/1.9.1/gems/railties-4.0.2/lib/rails/generators/app_base.rb:268:in `bundle_command'
from /var/lib/gems/1.9.1/gems/railties-4.0.2/lib/rails/generators/app_base.rb:277:in `run_bundle'
from (eval):1:in `run_bundle'
from /var/lib/gems/1.9.1/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
from /var/lib/gems/1.9.1/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
from /var/lib/gems/1.9.1/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `block in invoke_all'
from /var/lib/gems/1.9.1/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `each'
from /var/lib/gems/1.9.1/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `map'
from /var/lib/gems/1.9.1/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `invoke_all'
from /var/lib/gems/1.9.1/gems/thor-0.19.1/lib/thor/group.rb:232:in `dispatch'
from /var/lib/gems/1.9.1/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
from /var/lib/gems/1.9.1/gems/railties-4.0.2/lib/rails/commands/application.rb:43:in `<top (required)>'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /var/lib/gems/1.9.1/gems/railties-4.0.2/lib/rails/cli.rb:15:in `<top (required)>'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /var/lib/gems/1.9.1/gems/railties-4.0.2/bin/rails:9:in `<top (required)>'
from /usr/local/bin/rails:23:in `load'
from /usr/local/bin/rails:23:in `<main>'
It looks like it was a problem running bundle install. According to tutorials, I run the command
$ bundle install
And I got
Fetching gem metadata from https://rubygems.org/............
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
Using rake (10.4.2)
Using i18n (0.7.0)
Using minitest (4.7.5)
…
Using jbuilder (1.5.3)
Using jquery-rails (3.1.3)
Installing json (1.8.3)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/usr/bin/ruby1.9.1 extconf.rb
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- mkmf (LoadError)
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from extconf.rb:1:in `<main>'
Gem files will remain installed in /home/alejandro/.bundler/tmp/9377/gems/json-1.8.3 for inspection.
Results logged to /home/alejandro/.bundler/tmp/9377/gems/json-1.8.3/ext/json/ext/generator/gem_make.out
An error occurred while installing json (1.8.3), and Bundler cannot continue.
Make sure that `gem install json -v '1.8.3'` succeeds before bundling.
I tryed to install json in several ways :
$ sudo gem install json -v '1.8.3'
$ sudo apt-get install json -v '1.8.3'
$ sudo gem install json
But it don't work. I tryed to to run de server :
$ rails server
Could not find gem 'rails (= 4.0.2) ruby' in the gems available on this machine.
Run `bundle install` to install missing gems.
I have tryed to install rvm and rbenv, but nothing works in the way tutorials says it should. My feeling is that I missed something in the begynning, but I dont know what.
Could you please help me ?
Thanks
Alex
You need to update gem lock and all dependency
For that please execute below command,
gem update --system
Now You can install json gem using ,
gem install json
Try above command and let me know if you still face same thing. Above things works fine for me:D
I am trying to work on a ruby on rails project I synced from github. Even though rake-10.0.3 gets installed successfully, 'bundle install' fails. I am new to rails and not sure how to proceed on this.I googled the error, and tried the installing different versions of rake as suggested by the solutions, but it did not help.
Here's what I am trying to do... Please help.
ruby 1.9.3p374 (2013-01-15) [i386-mingw32]
>rails s
←[31mCould not find kaminari-0.14.1 in any of the sources←[0m
←[33mRun `bundle install` to install missing gems.←[0m
>bundle install
Fetching gem metadata from https://rubygems.org/...........
Fetching gem metadata from https://rubygems.org/..
NoMethodError: private method `open' called for Gem::Package:Class
An error occurred while installing rake (10.0.3), and Bundler cannot continue.
Make sure that `gem install rake -v '10.0.3'` succeeds before bundling.
>gem install rake -v '10.0.3'
Successfully installed rake-10.0.3
Done installing documentation for rake (1 sec).
1 gem installed
>bundle install
Fetching gem metadata from https://rubygems.org/...........
Fetching gem metadata from https://rubygems.org/..
NoMethodError: private method `open' called for Gem::Package:Class
An error occurred while installing rake (10.0.3), and Bundler cannot continue.
Make sure that `gem install rake -v '10.0.3'` succeeds before bundling.
Thank you!
You should first update Rubygems:
gem update --system
And then update Bundler:
gem install bundler