Rubymine doesn't detect Imagemagick install? - ruby-on-rails

I just installed Rubymine, and Imagemagick through the terminal for use with Rails Papercilp. For some reason if I run the Rails server through terminal everything works, but if I run the server through Rubymine, it says Imagemagick is missing.
Anyone have any thoughts? I've been trying to figure out this config issue for hours now.

It is most likely that imagemagick is not in your PATH in Rubymine. The Rubymine environment is different from shell. See http://devnet.jetbrains.net/docs/DOC-1160;jsessionid=1858A969645F39423219A415388AF557 for how to do this.

probably, not the best way to handle it in general, but quick-n-dirty solution is
from terminal:
$ rvm use [environment#you_want]
(or just cd into ruby app folder if you use .rvmrc)
$ open /Applications/RubyMine.app
(or any other valid path to RubyMine installation)
this will load all necessary environment...
cheers

Related

Rails command not working on Windows command line

I installed Ruby and Rails and set-up the PATH to "C:\Rails\Ruby2.3.0\bin", but when I try to run commands with rails, I get the error message:
The System cannot find the path specified.
I am able to run commands using ruby, and rails works if I use GitBash. How do I make it work on my normal command line?
Had the same problem here, installed the same way. Couldn't even run rails commands on GitBash, only way was going in C:\Rails\Ruby2.3.0\binthrough cmd and typing, for example, ruby rails new projectname. The rails new projectnamewouldn't work even in these conditions.
What I did was going in the Command Prompt with Ruby and Rails and entered gem install rails (which did not work on cmd). I also did gem install bundle. Both installed successfully and that fixed all consoles for me: cmd, GitBash (wasn't working for me), Command Prompt with Ruby and Rails and even cmder works with Rails now.
Hope this helps you.
Cheers.
If it's a simple question of locating the rails executable on Windows, then on later installs that use msys64 instead of DevKit, you'll find rails at the following folder:
c:\msys64\o-rdoc
Add this to your PATH or execute from that folder.
Your path may vary on 32-bit systems or if you changed the default install folder.

root:could not open file '/etc/apt/sources.list.d/passenger.list'

When I create a scaffold in terminal, I get the above error message. I have type the following command first:
echo "source \$HOME/.rvm/scripts/rvm" >> ~/.bashrc
I still get the following error:
WARNING:root:could not open file '/etc/apt/sources.list.d/passenger.list'
The program 'rails' is currently not installed. You can install it by typing:
sudo apt install ruby-railties
Any help will be greatly appreciated.
Try running the command source ~/.bashrc and then re-running rails. If that doesn't work, a different approach may be needed.
The problem is that as far as your OS is concerned, Rails doesn't exist. There could be multiple reasons for this. Seeing that you're using rvm, rvm is supposed to tell Ubuntu where to find rails.
Make sure that you are using the correct version of ruby specified in your Gemfile by typing rvm current. Make sure you are using the correct version when running bundle install, otherwise the gems will be installed under a different ruby version.
Also, make sure that the ~/.rvm directory exists and that the path specified in your .bashrc file is correct.
Let me know if any of these suggestions help.

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!

How to find my rails path?

I have rails 3 installed with rvm and today i tried to add the alias 'subl' (from Sublime Text 2) to use on terminal. The problem is the 'subl' command works and i think i messed up with the paths, because the rails command is not found anymore.
How do I find the correct rails path and fix this problem?
Thanks in advance.
Depends on your setup. If you're using rvm, it will probably be
~/.rvm/gems/<ruby version that you use>/bin/rails
If you're using the system ruby, then have a look in the gems folder of wherever your ruby install is, and add that to the path. On windows, the ruby installer generally puts it in
C:\Ruby
Or something like that. On Mac, the default system ruby is
/usr/bin/ruby

How do you configure RadRails to use Rails installed through RVM?

How do I properly setup Aptana RadRails if I've installed Rails through RVM?
I followed the install on http://railstutorial.org/ but my script paths don't work: e.g.:
'rails' path: /home/marius/.rvm/gems/ruby-1.8.7-p302#rails3gemset/bin/rails
Detected path: Not Detected
After installing ruby through rvm, I was able to get eclipse to use that install by:
In Eclipse, go to Window -> Preferences.
In the Ruby/Interpreters tab click "Search"
For me this found all of the ruby installs from rvm, and it added them to the interpreters list. I edited the "Name" field to include the version number for convenience.
try to run this in the command line. It will show you real path to the available rail script for current environment.
$ which rails
In Aptana Studio 3 (build: 3.0.8.201201201658) there is no Window -> preferences. If you have a .rvmrc in your project work directory, stating for instance:
rvm use ruby-1.9.3-p0#mygemset
... then Aptana should pick up the correct environment; in this case using ruby-1.9.3-p0 with gemset mygemset. Don't forget to run build install or build update (when you updated your Gemfile) from your project working directory path.
I must add that Aptana Studio 3 seems a bit buggy when it comes to picking up the correct environment, especially when trying to use ruby-debug-ide19.
Did you try with just /home/marius/.rvm/gems/ruby-1.8.7-p302/bin/rails ?
You have to run eclipse/aptana from a terminal session.
Without RVM :
Please type command whereis ruby in console.
you will get the path like /usr/bin/ruby or /usr/local/bin/ruby to check which is correct interpreter path /usr/bin/ruby -v if you get version. that is your interpreter.
With RVM :
Please type command: rvm info
binaries:
ruby: "/home/<USERNAME>/.rvm/rubies/ruby-2.0.0-p247/bin/ruby"
copy this path and paste wherever you need enter you interpreter path.
It worked for me. and I hope it will help others as well.
Cheers!

Resources