How to tell if bundle install is doing anything - ruby-on-rails

I have created a vagrant instance from hashicorp/precise64 and once I logged in via putty changed to vagrant directory I ran
bundle install --verbose
however the only output I have received is...
Fetching source index for https://rubygems.org
My gemfile has approximately 150 gems and my gemfile.lock has over 500 lines. There has been no other output for half an hour and I was wondering at what point should I accept that something is wrong. I assumed with verbose specified there would be some output but nothing has appeared. Any help would be appreciated as I'm not sure if I'm just wasting my time.
Update:
Subsequent to suggestions I ran "gem install rails" and received the following output:
Fetching: i18n-0.7.0.gem (100%)
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions into the /opt/vagrant_ruby/lib/ruby/gems/1.8 directory.
Firstly why wouldnt I get some information like this returned on my bundle install and secondly should I change ownership of this directory or is there an issue with my configuration?

I am going to go with - something is wrong. bundle install --verbose is the appropriate way to get the most information out of bundler when doing an install. I would try something simpler, like a gem install rails and see if it works. This will help diagnose if it's a networking issue. Also try trimming down your Gemfile temporarily to see if it will complete with only say 10 gems.

Grant an access to /opt directory for your user, with:
chown -R `whoami` /opt
And try again

Related

Troubleshooting "Permission denied # rb_sysopen" when attempting to install an earlier version of Rails

Summarizing my problem
Details about my goal:
I want to install an older(stable) version of Rails; specifically 5.2.5.
Describing the expected and actual results:
I expect my Mac running Big Sur v11.3.1 (apple m1) to install Rails successfully.
The actual result is (presumably) a permission/ownership based error:
$ gem install rails -v 5.2.5
ERROR: While executing gem ... (Errno::EACCES)
Permission denied # rb_sysopen - /Users/ayylmao/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/concurrent-ruby-1.1.9/CHANGELOG.md
Obviously I see it's something to do with concurrent-ruby-1.1.9...though I continue to get this error with other gems throughout my efforts to install rails on this new-ish computer.
Describing what I've tried:
Both solutions here - no help
i've read this question - no help
I've read this question, but it's old
I've begun to explore my PATH:
/Users/ayylmao/.rbenv/shims:/Users/ayylmao/.rbenv/shims:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
and I've uninstalled previous installations of Rails (and railties), as well as removed rbenv and re-installed (via the usual for me, Homebrew)
I've run brew doctor, i've updated gems with gem update, i've gotten rid of seemingly superfluous gems with for i in gem list --no-versions; do gem uninstall -aIx $i; done.
Obviously, i'm at my wits end here...
My best guess
looking at my $PATH it seems super "sus"...looks like there's some redundancy...but I'm not certain how to troubleshoot it or if that's the correct place to be looking.
I've dropped most details about my system and environment throughout my question, but here's an agregate:
MacOS BigSur 11.3.1 (perhaps something to do with Apple's SIP?) smh
zsh
homebrew
rbenv
ruby 2.7.2
stating my question without any ambiguity
How do I troubleshoot this error "Permission denied # rb_sysopen" via closer inspection of my $PATH? And is that the most likely culprit?
What steps would I need to take to go completely "nuclear"?
PS - full disclosure...yes I have used sudo in some instance of installing rails...though i've quickly uninstalled those versions shortly after installation. I apologize for the irresponsibility. I was not prepared for the Apple SIP and panicked months ago....Also, ZSH was a change for me as well.
It seems like your ruby installation through rbenv was made via sudo, which will create gem structure with root privileges.
So, when you perform a gem install rails from a regular user, you won't have the privileges to write into gems directory, raising the permission denied error.
You can confirm the permission by running:
ls -la /Users/ayylmao/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/
Try to reinstall your ruby with you own user (without sudo) and the installation of rails or other gems will sould be fine.

Ruby on Rails - Errno::EACCES (Mac 10.9.1)

I installed Ruby (v. 2.1.2) and Rails (v. 4.1.4). When i try to start server (using the command rails s) I get an error:
`Could not find columnize-0.8.9 in any of the sources
Run `bundle install` to install missing gems.`
when i run the bundle install, i get:
`...Errno::EACCES: Permission denied # rb_sysopen - /Users/BBB/.rvm/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/columnize-0.8.9/.gitignore
An error occurred while installing columnize (0.8.9), and Bundler cannot continue.
Make sure that gem install columnize -v '0.8.9' succeeds before bundling.`
and then i try gem install columnize -v '0.8.9'
i get permission denied~
`ERROR:While executing gem ... (Errno::EACCES)
Permission denied # rb_sysopen - /Users/BBB/.rvm/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/columnize-0.8.9/.gitignore`
does anyone have any ideas?
The /Users/bor-shyangsheu/.rvm/ is the directory that is in user home and it is a local path for the user (that is /Users/bor-shyangsheu/) and it should really be owned by 'bor-shyangsheu' user.
Therefore, installing stuff with sudo does not make any sense.
And, I guess the setup or the gem installation had been wrong before ( you might accidentally used sudo gem install before etc.) which have led you to the permission problem later on (including this one)
I think what you should do now is.
Check what group that the user 'bor-shyangsheu' belongs to.
id bor-shyangsheu
or just type id if you're currently logged in as 'bor-shyangsheu'
Change all of the directorys and files owner to be owned by bor-shyangsheu and his group by
sudo chown -Rf bor-shyangsheu:<group name> /Users/bor-shyangsheu/.rvm/*
For instance, if the group name is 'staff', run this command
sudo chown -Rf bor-shyangsheu:staff /Users/bor-shyangsheu/.rvm/*
Always use gem install <gem name> later.
Hope this clarifies thing a bit more.
You may try deleting the "Gemfile.lock". You can learn more at Bundler.io.
After developing your application for a while, check in the application together with the Gemfile and Gemfile.lock snapshot. Now, your repository has a record of the exact versions of all of the gems that you used the last time you know for sure that the application worked. Keep in mind that while your Gemfile lists only three gems (with varying degrees of version strictness), your application depends on dozens of gems, once you take into consideration all of the implicit requirements of the gems you depend on.
This is important: the Gemfile.lock makes your application a single package of both your own code and the third-party code it ran the last time you know for sure that everything worked. Specifying exact versions of the third-party code you depend on in your Gemfile would not provide the same guarantee, because gems usually declare a range of versions for their dependencies.

Not able to view site in browser with railsinstaller due to missing Gem

I am super, super new at programming and I have been trying to get everything set-up on my computer. I have installed RailsInstaller, go to >railsinstaller_demo, and type in rails s. I get the following error though could not find gem 'uglifier <>= 1.0.3> x86-mingw32'
I looked through the forum and found how to do a gem list and i noticed it was not there. I then went to gembundler and ran $ gem install bundler. I tried again but it did not work.
I am sure the answer is on this site, but i am so new that i see all these lines of code I actually have no idea where to type it in.. I am running Windows 7.
thanks for taking the time to help out a real beginner.
Have you gone to the $ railsinstaller_demo directory and run the bundle install command? This will install the gem dependencies for the application; you will not be able to run the server until you've bundled the gems. Additionally, if you're still having issues with the uglifier gem, go ahead and remove the line in the Gemfile and then run bundle install
If you need further help with the Command Prompt, you an find out more at http://bit.ly/ZajVeW.
Thanks,
Evan

Permissions error with gem install

I had a very weird problem yesterday, where in the middle of trying to figure out some heroku problems, my whole Rails environment just disappeared. Bundle, RVM, rails, etc were no longer recognized. So I just ignored the possible cause and reinstalled everything. Mostly worked, but now I'm running into permissions problems. If I bundle install, it needs me to input my computer password for permission.
And I just ran into the following problem trying to "gem install heroku" in a new directory I wanted to deploy.
ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions into the /Library/Ruby/Gems/1.8 directory.
Any idea how I get those permissions back so things run smoothly again?
Thanks!
Use chmod on the directory something like this:
sudo chmod -R g+w /Library/Ruby/Gems/1.8
That might work.

sudo gem install rails- this doesn't give me a rails command for bash

I'm on Ubuntu. I type in sudo gem install rails. This works fine, installs railes and 7 other gems fine. Yet $ rails blog is saying this:
The program 'rails' is currently not installed. You can install it by typing:
sudo apt-get install rails
Type
gem env
It will give you the installable directory where the bins of the gems are being installed. Something like this:
EXECUTABLE DIRECTORY: /usr/bin
Make sure this directory is in your path.
how did you install rubygems, as an admin, or as a user? if you installed it as a user, it may not have the bin directory in your path.
If I were you, (assuming you installed rubygems into your home folder), I would trash that installation dir (not sure where it defaults to, maybe ~/rubygems? or ~/.rubygems?), then run setup.rb from the rubygems tarball as admin (through sudo) I've done this at least a dozen times on ubuntu, and haven't run into the issue you are hitting.
If that isn't the case, could you please link to the blog post you were following?
Make sure your gem executable path is added to your system path so that the system can find the rails executable.
I know this is an old thread but the same error had me stuck. Make sure you add
source ~/.rvm/scripts/rvm to your .bashrc file

Resources