librarian-chef requiring ruby2.3 fails to install on ruby2.4 - ruby-on-rails

I am trying to install a vagrant plugin "librarian-chef". When I run the command vagrant plugin install librarian-chef, I get the error:
Bundler, the underlying system Vagrant uses to install plugins,
reported an error. The error is shown below. These errors are usually
caused by misconfigured plugin installations or transient network
issues. The error from Bundler is:
chef-zero requires Ruby version >= 2.3.1.
Why does this requirement break the install?
How do I make sure my setup meets what this needs?
Details of my setup
I have ruby-2.4.0p0 on a Macbook installed under RVM. This is my only Ruby on this machine.
For reference purposes, I am trying to get started with the plos/lagotto repo.

I don't see anything in that repo telling you to install anything related to librarian. Librarian-chef has been basically abandoned by the community, but if you did want to use it for some reason the plugin to install is vagrant-librarian-chef, not librarian-chef.

Related

Trying to Install MySQL with/for Ruby on Ubuntu, keep getting an error

I am using Ubuntu 22.04.1 LTS, and I installed Ruby and Rails via rbenv as reccomended by others and the Ruby docs. I am trying to setup a MySQL server to use with an application and I first need to gem install it. Even when signed in as root, I keep getting the following error when issuing the command
gem install mysql2
error shown
I've tried un-installing and re-installing Ruby, and I've tried changing the permissions of the gems folder. Permission changes don't seem to be permanent

Installing Rails on RaspberryPi (Raspbian Buster) fails

I am still quite new to Rails(1).
Yesterday, I installed Ruby on Rails on a RaspberryPi (with a pristine SD card and fresh etched OS) the Debian way:
sudo apt-get install ruby rails
This (seemingly) successfully installed me Rails (version 5.2.2.1) and Ruby (version 2.5.5p157) and I created a new application framework without trouble. However, starting the puma server just results in a long error log.
bundle update
aborts at
installing Nokogiri 1.10.4 (was 1.10.0)
(... can't find headerr files for Ruby'...).
Not surprisingly, the server still responds with just the same error messages.
Any help in getting things up and running is highly appreciated.
Thanks!
Karsten
(1) I am absolutely sure, I am not the first and only with this question. Three weeks ago I had about the same difficulties with the installation procedure at my laptop running plain Debian. I searched for about two days without finding clear guidance (ok, not smart enough ;-). Finally I managed to get things running by manually setting GEMS versions to the pre-installed values. However, this took quite some time and because I am new, I am unaware which implications my trial-and-error settings have. Because I did not log my actions, now I would need to restart the procedure from scratch... There must be a better approach ==> sorry for redundant postings.
Try installing the headers files for ruby:
sudo apt-get install ruby-dev

ElasticBeanstalk - Rails Nokogiri Deployment Issue

I have a working rails application deployed to EC2 through ElasticBeanstalk. I update the website every few weeks without issue. Today I'm running into a problem after committing changes and running "eb deploy":
An error occurred while installing nokogiri (1.7.0.1), and Bundler cannot
continue.
Make sure that `gem install nokogiri -v '1.7.0.1'` succeeds before bundling.
I haven't changed anything aside from a few views. The host is the same and the Gemfile is the same. On my local machine, I can run that command and then bundle install/update without issue. I can SSH to the EC2 host and successfully run that command to install that version of Nokogiri, too.
When I deploy, I get that error message (with no other details). I'm stuck - Any idea what I should look into next? Note that this started happening to a working setup, so I don't think it's the host missing libxml or another dependency.
Found it. There was a line in the log file that I was missing.
"Cannot allocate memory"
Rails was using a lot more memory than I thought. Just sitting there it was using 1.7GB out of 2.0GB. I temporarily added 1GB of swap and the deployment succeeded.

How to solve a RubyMine "'ruby-debug-ide' isn't installed" error

I get the error:
Cannot start debugger. Gem 'ruby-debug-ide' isn't installed or its executable script 'rdebug-ide' doesn't exist.
but all gems were successfuly installed:
gem 'ruby-debug-ide'
gem 'debase'
I can run 'rdebug-ide' manually:
$ rdebug-ide
Using ruby-debug-base 0.2.1
Usage: rdebug-ide is supposed to be called from RDT, NetBeans, RubyMine, or
the IntelliJ IDEA Ruby plugin. The command line interface to
ruby-debug is rdebug.
But when I start debugging, RubyMine asks to install the ruby-debug-ide gem. Why?
And, after installation I get:
Cannot start debugger. Gem 'ruby-debug-ide' isn't installed or its executable script 'rdebug-ide' doesn't exist.
I'm running Mac OS X 10.11.3.
Here's the actual command that worked for me:
gem install ruby-debug-ide --pre
Complementing Ahsan Ellahi
In your terminal you're probably not running the same ruby version as inside Ruby Mine. You can check this
In Ruby Mine
Preferences --> Laguanges and Frameworks --> Ruby SDK and Gems
In Terminal
$ ruby -v
If you're not running the same version, try to set RubyMine to use the same Ruby version that you're running in your terminal. This should solve the problem. Than, if you really want to use another RubyVersion, you will need to go to your terminal, change the Ruby version and manually install both gems
I have faced this issue when debugging in a docker-compose environment. I suspect that RubyMine does not refresh the list of available gem after the SDK is added.
So if you add the SDK then add ruby-debug-ide to Gemfile you will get the error.
Instead, (re)create the SDK after adding ruby-debug-ide.
I started getting this after upgrading from 2017.x to 2018.1. In my case, it seems that RubyMine needed a newer version but its error message implied it couldn't find any version and failed to install it. I think it was trying to install it with a different SDK.
Manually installing the latest ruby-debugger-ide (in my case the --pre flag was necessary) and then restarting RubyMine did the trick for me.
Since you're using Mac OSX, I couldn't provide the same exact answer for you, but you can find a similar way of achieving this. I'm using Ubuntu with Vagrant, so you may need to adapt it just a little bit.
Copy the following gem from RubyMine/rb/gems app folder, please copy the gem related to your ruby runtime and platform, there are different gems for different ruby runtime and platforms, in my case, its:
debase-0.3.0.beta7.gem
ruby-debug-ide-0.8.0.beta6.gem
Install them inside your app host, in my case its vagrant, in your case it could be inside your container, or in your host OS using the following command:
gem install --force --local *.gem
Set breakpoint and start debugging.
It may asks you one more time to install the gem, but then the debug will works for sure.
This worked for me
gem install debase-ruby_core_source
Source: Cannot install Rubymine Debugger
You should look into RubyMine settings, which ruby version and which gemset (global/default) it is using. Check out where these required gems are installed and make sure RubyMine is using that gemset where these are installed successfully.
I fixed this after viewing the responses here: https://intellij-support.jetbrains.com/hc/en-us/community/posts/206072049-Cannot-start-debugger
The solution at the bottom suggested 'removing all my gems. removing ruby. cleaning up directories and rvm. removing ruby mine, then reinstalling everything'
I started with the easiest of these, which was to reinstall rubymine. That solved it for me.
I had this issue on Windows 11 running Ubuntu on WSL2. To solve, I manually copied the relevant files in my %AppData% directory into the corresponding directory in Ubuntu.
I found all the data at:
C:\Users[USER]\AppData\Local\JetBrains\RubyMine[VERSION]\ruby_stubs\[NUMBER]\home\[USER]\.gem\ruby\2.7.0
These files were copied to: \\wsl.localhost\Ubuntu\home\[USER]\.gem\ruby\2.7.0
After doing this, everything worked again.
I have faced this issue too with Rubymine 8, rvm 1.29.1 and Ruby version 2.3.3 And upgrading the Rubymine version from Rubymine 8 to Rubymine 2016.3 or latest resolves the issue for me.
Check ruby SDK's version is right.You can first using rails installer to install everything .
Then using gem to install rdebug for ruby 2+.
Make sure Rubymine's Ruby version is same to which you have installed.With those all done,you will be able to debug ruby.
Please check x286 vs 64 version, both Ruby and Rmine version. I had this problem runnin x86 rubyMine on 64 ruby
A combination of matching the host ide ruby version with the remote SDK version worked for me but required a few additional steps. I too am running mac os as my host (running mohave)
the remote environment setup in preferences -> ruby sdk and gems must have the same version as the remote target, including any gems installed.
NOTE: I had to re-install the bundler gem on both host and remote host to get the gem manager to install things auto-majically.
the project environment must be changed to use the same version as the remote host as well. this is in File -> preferences for new projects -> ruby sdk and gems.
NOTE: I also had to set the default RVM on my local host and remote host and unset the previous version as default in the local host preferences.
Once I did this I was able to get gems in sync and remote debugger to connect.
My solution was to go to Rubymine settings, to the available SDKs,
remove the SDK, restart Rubymine and add the SDK again.
Running Ubuntu 18 something, RubyMine version 2020.3. Had this issue. None of these suggestions worked for me, same error no matter what did. I was using RVM, and ruby 2.6 and 2.7, switched back and forth a cleaning and reinstalling gems along thew way, both debase and ruby-debug-ide were installed according to the gem list. Settings in rubymine matched "ruby -v" from the command line. VSCode worked perfectly with this setup.
In the end i removed RVM and all the ruby versions, installed ruby via rbenv, installed ruby 2.6.5 and that worked like a charm.
I think this error is generated for multiple reasons with no real way to figure out which reason for your specific instance. I would like to encourage jetbrains to generate more debug information on errors like this, or if you are generating error information, point out where it is when this happens.
Try these steps:
1. /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
2. brew install ruby
3. echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> ~/.bash_profile
if you get unshallow error on any step then first try:
1. git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow
2. git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask fetch --unshallow
3. /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
4. brew install ruby
5. echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> ~/.bash_profile
Lastly restart the terminal and check .bash_profile:
- nano ~/.bash_profile
If you see the path variable, just close it. Otherwise it means something went wrong :/.
The last step is to open
RubyMine -> Preferences -> Language and Frameworks -> Ruby SDK and Gems -> select the newest ruby version and apply.
You may need to update ruby version from the gemfile.
And it should be done!

need help installing ruby on rails

I'm installing 1.87.
I got ruby installed and ruby gems
then I tried this from the command prompt: gem install rails
and it gave me this error: http://screencast.com/t/wmBr2b1vC5I
I got the devkit like it suggested and put it in a directory on my desktop but when I went to github for instructions I got lost.
Can someone help guide me step by step? I'm used to PHP and MySQL using WAMP so running things from the command line is new to me.
A lot of gems require native code to be built and linked to as they're being installed. Unfortunately, Windows does not provide any compiling and linking tools, so you have to take one of several routes to enable building native code in Ruby gems.
I've always used Cygwin in the past to accomplish this, but there's also the Ruby Installer which may benefit you more.
Ruby Installer: http://rubyinstaller.org/
You'll probably need to remove your current Ruby install before running the installer, but it should give you everything you need to make installing Rails possible.
If you don't want to use the full installer, you can download "Development Kit", which is part of the installer, to just add the necessary build tools to your command-line environment.
Development Kit: https://github.com/downloads/oneclick/rubyinstaller/DevKit-tdm-32-4.5.2-20111229-1559-sfx.exe

Resources