I am searching for simple Ruby gem that would be able to find definitions of methods.
First I installed this:
But it requires some gems(rubocop, ruby-debug-ide or solargraph) to be installed in order to work. It provides a lot of features as debugging etc, but I dont need them. I only want to be able to find methods definition.
I am using Vscode to access Rails project on network directory. So I don't want to install Ruby on my host OS (Windoiws 10 x64). Instead I provide a network directory to a guest Guiless Ubuntu (as Guest OS). The Rails server is run on the Ubuntu OS.
VSCode works perfectly well with network directories, but the extensions need Ruby environment that is pretty sad.
For example Sublime Text 3 does this painlessly and donesn't complain for gems. Even without having any Ruby stuff on the OS it is running on:
I want to stick with VSCode because it is the best I have used so far.
So the question is: Is there a Ruby extension for VSCODE that works without Ruby installed?
The only thing that can really parse Ruby is Ruby, so you need Ruby when working with Ruby code. Same goes for a lot of other languages in Visual Studio Code. Sublime provides a "good enough" reflector based on a very simplistic syntax parse. Visual Studio Code uses Solargraph which does way more.
If you don't like that requirement you can always use or write a different Ruby plugin that has no such dependencies. As someone who does a lot of Ruby work, though, the installation is a minor inconvenience for all the benefits it provides.
#Hairi have you tried the ruby-symbols extension?
https://github.com/rubyide/vscode-ruby/issues/40
Keyboard shortcut for Windows is Ctrl + Shift + O.
And for Macs, it's Cmd + Shift + O.
Related
I have some simple sinatra apps that make use of the OTA COM dll for talking to Quality Center.
I want to move those sites into docker images, so I can host them on my docker server.
It occurred to me that theoretically I should be able to get this working with strategic use of wine.
Hint: I remember reading somewhere that to get Win32OLE working in Ruby from linux you can install the windows version of ruby using wine, then run your scripts through the windows version of ruby.
https://www.ruby-forum.com/topic/88576 says
i've managed this before. i installed the one-click installer under
crossover office and the used that. another option is installing
msys, compiling ruby under that, and then using that ruby. in any
case you need to install/build another ruby under the crossover environment.
and later
In the end I installed office 2000 with Crossover, then I used the
windows installer to install windows ruby into the same bottle as
office. Finally I put the following bash script in my /usr/bin directory
so I can run my ruby files with '#> wruby some_script.rb'
==/usr/bin/wruby
#!/usr/bin/env ruby
`/opt/cxofficebeta/bin/wine --bottle myBottle --cx-app ruby.exe #{ARGV.join(" ")}`
I know nothing about Wine or crossover or bottles(?), so I'm out of my depth.
How would I do this? What would a Dockerfile I could use as a base image look like?
Note: I found some docker images that claim to install wine (which may make a good starting point)
https://registry.hub.docker.com/u/ambakshi/wine-x11-vcpython27/
https://registry.hub.docker.com/u/monokrome/wine/
https://registry.hub.docker.com/u/yantis/wine/
http://www.perlmonks.org/?node_id=430194 talks about getting Win32::OLE working under ubuntu.
Don't forget to use a USER xx in your Dockerfile as it is important to use a non privileged user in wine. You will find in registry.hub.docker.com several examples of wine with such a user.
i'm new to ruby and am trying to get it to run on windows 7 using aptana studio 3. however, i an unable to run .rb programs due to 'lack of interpreter' as aptana is unable to find a ruby executable. i saved my program with .rb extension and looked for ways i could set a path to the ruby interpreter. there is no option to set up an interpreter for ruby in aptana preferences. am i missing something here?
i searched the web, but all i found was that the exact problem happened to people in linux. although it was solved, it was sovled in terms of linux and a windows user like me couldn't quite understand how the problem was fixed.
another search gave me a bit of info that aptana had changed and was no longer offering the same interpreter management environment as it did in previous versions:
https://aptanastudio.tenderapp.com/discussions/problems/1591-cant-choose-ruby-interpreter-in-ubuntuaptana-studio-3-beta
so i'm really stuck here. i really want to work with aptana since it's much easy on the eyes with it's dark theme. eclipse, not so. overall i'd really like to run ruby on aptana.
I had the same problem on Windows 7/Aptana Studio 3/Ruby 1.9.3.
One solution that worked for me was to run RubyInstaller as administrator. If you do not do this, the PATH environment variable does not get set, and the Aptana toolset does not seem to find ruby.
(This is using the RubyInstaller from http://rubyinstaller.org/.)
I guess that it might be possible just to set the PATH environment variable to point to the correct ruby binary, but I did not try this.
Hello: I have a windows machine and a linux machine that both have the gems, ruby version, rails version, etc that I need. I want to copy the configuration for the Windows box to a couple of other windows boxes, and do the same for the Linux boxes (Ubuntu). I will move these to a studio whereby it won't have access to the internet during my stay.
I will install the same ruby version, and then I want ALL gems and configurations to be consistent and up to date across the board using the configs of the Linux and Window boxes as my guide. Can anyone advise how to do this if possible? For example, what folders/files would I need move, or can I simply copy and past the entire install of each config and paste them to the new boxes.
Thanks,
STS
You are probably looking for the Bundler. It makes such tasks very easy. Just don't forget to reinstall bundle on the different system. Everything is kept, packages are specified in the Gemfile.
Just read docs, it's very intuitive to use.
For the life of me I can't find the tool I ran across yesterday. It's not Homebrew (I already use Homebrew) what I found was a tool that I think was built in Ruby that allowed for installing regular .app applications and otherwise scripting most of an OS X config (I assume preferences and other things). I already have a script based on the Thoughtbot Ruby environment that I'm able to run successfully but I'd love the ability to script installing the other 20-30 apps that I use so that it would make reformatting a little easier.
Thanks!
You might be thinking of a configuration management tool like Chef. You can use this to bring up a system from a bare OS to the configured state defined in your recipes.
Personally I've only used it for setting up linux servers, but I think it would work just as well for launching installers and running configuration scripts on a Mac.
This is the tool I was looking for.
https://github.com/benhoskings/babushka
What's the simplest way -- ideally a single click -- to set up a ruby (not rails) runtime environment on a local Windows system (not a web site), with specific gems?
I have code for a customer that runs on their local system. I've been sending them ocra executables, and that sorta, kinda, usually works, but is showing more problems all the time.
So I want to set up a native ruby environment there -- actually I want them to set it up -- so I can just send straight ruby code. But it's got to have the specific gems I use (FxRuby, several others).
Most important, it's gotta be dead simple for them -- ideally a single click. I'm trying to avoid a physical trip to their site.
Thanks.
As they are running Windows why not go to the ruby-lang.org website and download the windows installer - depending on the edition they do come with gems - some with FXRuby (which I use myself) you can then send the app to them and they can install Ruby - It is quiite simple to do.
In the ruby code before you make it an ocra file put
`gem install mygem`
`gem install myothergem`
in backsticks...
This will run in the command line of the receiving computer. Then require the gems later in your script.
Let me know if this works.