Error installing gem thinreports-rails on windows 10 - ruby-on-rails

I am trying to install the gem thinreports-rails on my pc, It has windows 10 installed. But when I ran the instruccion gem install thinreports-rails I got the next error
ERROR: While executing gem ... (Errno::EACCES)
Permission denied # rb_file_s_symlink - (index.tlf, C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/thinreports-rails-0.3.0/test/test_app/app/views/orders/no_set_layout.tlf)
please I will apriciate any comment about how resolve it error. Thanks

as message from error it deals with permission,
Running the terminal as Administrator user will solve this problem, you can right click the the terminal / command prompt, then choose run as administrator, then try to run the command 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.

Unable to integrate sqlite3 with ruby and rails

Disclaimer: I checked the FAQs. I have tried Google, Reddit and YouTube and am posting here after exhausting all available options.
I'm using guides.rubyonrails.org to learn. However, SQLite3 has not downloaded on my system, despite following the instructions on the website.
So I typed 'gem install sqlite3' in the command line and it has thrown multiple errors related to mingw32, mingw64 and msys. The commonality of the errors being they are invalid or corrupted databases (PGP signatures).
The final error stated for installing sqlite3 was "failed to build gem native extension" followed by the directory and a suggestion to install it from the net.
I have installed it from sqlite.org and integrated it with the regular command prompt. Here it says "connected to a transient in memory database".
It is not integrated in the command prompt with ruby. Here it says "the term 'sqlite3' is not recognised as the name of a cmdlet, function, script file, or operable program."
I'm using a laptop using Windows 10 and have rails 6.0.3.2 and ruby 2.7.1 installed.
I tried progressing irrespective and my input was 'rails server' on the regular command prompt.
The following lines showed up -
Could not find gem 'sqlite3 (~> 1.4) x64-mingw32' in any of the gem sources listed in your Gemfile.
Run 'bundle install' to install missing gems.
Please advise how to progress or if there's anything I'm missing. Should I persist and try and fix the error in the ruby command prompt or move forward with the regular command prompt? None of them are working for me to progress my learning. Let me know if you require more information.
Thanks for your time and help.
EDIT: Here is the image for when I run gem install sqlite3.
2nd EDIT: Here is what I get when I run 'rails new blog' and 'bundle install' thereafter.
3rd EDIT: Here is the mkmf file where the problem exists as per command prompt.
4th EDIT: I followed the instructions on guides.rubyonrails.org/getting_started.html. I ran 'bundle install' only when it asked me to after I ran 'rails new blog' in the command line.
Similar error regarding mingw32, mingw64 and msys from the first image came up after I ran bundle install in blog. However, this time it stated Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

Error in Bash when installing Heroku gem

I successfully installed Heroku(3.99.1) in the terminal but then there was an error message that read:
ERROR: While executing gem ... (Errno::EACCES)
Permission denied # dir_s_mkdir -
/usr/local/lib/ruby/gems/2.4.0/doc/excon-0.59.0
I then tried to login to Heroku in the terminal and the Heroku CLI was installed. I entered my email and password that I registered on the Heroku website, but another message refers to the same error:
MODULE_NOT_FOUND: Cannot find module './lib/request'
I have no idea as to the cause of, or the solution to this problem. Any help would be much appreciated :-)

ELASTICSEARCH 2.4.1. Running on Windows 2012

I am trying to install a plugin for ELASTICSEARCH and keep getting the following error:
ERROR: Installation Aborted, message: Could not find gem
'elasticsearch-sql-master.zip (>= 0) java' in any of the gem sources
listed in your Gemfile or installed on this machine.
Does anyone know how I can fix this to get this plugin installed
Solved it - if anyone else has this problem just do the following -
1 Open a command prompt.
2. Navigate to your elasticsearch bin folder
3. Run the following command:
plugin.bat install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.4.1.0/elasticsearch-sql-2.4.1.0.zip
Should install just fine

ERROR: Could not find a valid gem 'rails' (>= 0) in any repository

I installed rvm and ruby successfully in a linux environment. When I try to install rail, that time I face following error:
$ gem install rails
/home/bathakarai/.rvm/rubies/ruby-1.9.3-p385/bin/gem:4: warning: Insecure world writable dir /home/bathakarai in PATH, mode 040777
ERROR: Could not find a valid gem 'rails' (>= 0) in any repository
ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError)
Errno::EHOSTUNREACH: No route to host - connect(2) (http://rubygems.org/latest_specs.4.8.gz)
My gem version is
1.8.25
Rvm version is "rvm 1.18.19 (stable) by Wayne E. Seguin , Michal Papis [https://rvm.io/]".
Please help me by letting me know why this error occurs.
You can use to install with below command
gem install rails --source http://rubygems.org
Yes, Finally I got the result. It seems like some sort of proxy problem. I set the proxy using export "$HTTP_PROXY=IPAddress which is given in browser:portnumber".
For any reference http://khylo.blogspot.in/2007/12/ruby-on-rails-headaches.html
Try running
sudo gem install rails
This may overcome the permission problem you are having
You also look to be having an internet connectivity problem based on the error message.
In my case the culprit was avast! Internet Security software on my MacBook Pro. I went to System Preferences, clicked on avast!, clicked on the lock to enable changes, and disabled the Web Shield and File System shield.
After that, I was able to install gems.
I have struggled to install rails for two days (I've been getting almost the same error message, but, without that "Insecure world ..." line). And at last I did it using the script below (provided at RailsGirls):
bash < <(curl -sL https://raw.github.com/railsgirls/installation-scripts/master/rails-install-ubuntu.sh)
I don't know why it worked. Just leaving it here with the hope that it will be helpful for some other soul as well. ;P
You should try disabling your IPV6 to install the required Gem file since the rails fetcher could not locate the source. If you are using a linux machine, you can check this link for the steps on how to disable your IPV6 https://www.linuxbabe.com/ubuntu/disable-ipv6-on-ubuntu

Resources