Reputation: 6318
When I try to run any ruby code, I get a pop up that Says "Launching differences2.rb' has encountered a problem. Unable to find a Ruby executable.
When I run 'gem environment' from inside Aptana I get this:
gem environment
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.6
- RUBY VERSION: 1.9.2 (2011-07-09 patchlevel 290) [x86_64-linux]
- INSTALLATION DIRECTORY: /home/adamar/.rvm/gems/ruby-1.9.2-p290
- RUBY EXECUTABLE: /home/adamar/.rvm/rubies/ruby-1.9.2-p290/bin/ruby
- EXECUTABLE DIRECTORY: /home/adamar/.rvm/gems/ruby-1.9.2-p290/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
- /home/adamar/.rvm/gems/ruby-1.9.2-p290
- /home/adamar/.rvm/gems/ruby-1.9.2-p290@global
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
When I run 'ruby -v' from inside Aptana I get this:
ruby -v
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-linux]
When I run 'rvm use 1.9.2' from inside Aptana I get :
rvm use 1.9.2
Using /home/adamar/.rvm/gems/ruby-1.9.2-p290
I restarted and tried again after each of those commands, I also tried this:
rvm use 1.9.2 --default
Can anyone make a suggestion as to what I can do?
Upvotes: 1
Views: 7477
Reputation: 11
Aptana terminal loads the .aptanarc instead of .bashrc on start up. You can adjust the path configurations for rbenv like this
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.aptanarc
echo 'eval "$(rbenv init -)"' >> ~/.aptanarc
I found this on another site and it helped my Apatana find the ruby executable. I would cite the author, but there is no name.
Upvotes: 1
Reputation: 1697
Try going to the folder where Aptana is installed and edit the file "studio3". Add this in the begging
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session as a function
This will force it to load your rvm path when opening Aptana. You can then run open it by using ./studio3
I noticed that when running
Upvotes: 1
Reputation: 12570
I had the same problem working on Ubuntu with rvm, so I created a symbolic link, like sudo ln -s ~/progs/Aptana\ Studio\ 3/AptanaStudio3 /usr/local/bin/aptana
and from a terminal execute aptana &
Upvotes: 1
Reputation: 61
I had the same problem and "solved" it by removing all references to Cygwin from my PATH. It must not be parsing it correctly when Cygwin goes in and changes your path.
Upvotes: 1
Reputation: 2907
It's not clear from your question which version of Aptana you're using. If you're using Aptana Studio 3.x, then it should pick up your environment setup in .bashrc and your typical shell setup. We basically just search PATH for the location of the ruby executable. It'd be useful to see the output of "echo $PATH
" inside the Terminal view in the IDE and outside the IDE to see if they differ. However it seems like it's already finding it when you run the "ruby -v
" command in the shell, so I'm not really clear on what the issue might be.
You can try turning on debug level logging inside Preferences > Aptana Studio > Troubleshooting. You can up the log level to "All", and/or check "Debug specific components" and check the com.aptana.core/debug
and com.aptana.core/debug/shell
entries. That should hopefully spit out low level details on what process get run under the hood and the command lien args, executables and environment used. You can view the log by going to Help > Aptana > View Log File. We typically ask for the contents of this log when users file bugs at http://jira.appcelerator.org/secure/CreateIssue!default.jspa
Upvotes: 1