I'm trying to use SublimeREPL with Sublime Text 2 so that I can programme with Clojure. I have installed SublimeREPL using the package manager.
I go to
Tools > SublimeREPL > Clojure
and start a repl this seems to start fine, but whatever I type in and hit enter does nothing. It does not return anything not even an error.
I have Lein installed.
I am using a Windows PC
Has anyone had this problem?
Yes, I have had this trouble with versions 2 and 3. From what I can see, it's a known issue. I have also reported it on GitHub: https://github.com/wuub/SublimeREPL/issues/356
Also, this solution worked for me: Sublime Text, SublimeREPL, Clojure & Windows 8
Related
I've been working with Clojure for few weeks now, primarily with Lein+Luminus framework. I've been looking for a way to debug code while on the REPL.
I really like the way how pry(on Ruby) works, when it comes to debugging and runtime invocation. Is there an equivalent to pry for clojure code? or probably a technique/tool that I've missed?
There are two paths to consider to improve your REPL and debugging experience:
Using a REPL and debugger integrated with your editor or IDE of choice
Using an embedded nREPL server
The first is an essential part of setting up your local Clojure development environment and should be done regardless. The second option, using an embedded nREPL server, is closer in usage to how you would use a binding.pry call in your code since it gives you access to the running application, but it isn't used to stop execution at a certain point, but rather give you a REPL with access to your running application and it doesn't provide any additional debugging features on its own.
Editor/IDE with REPL and Debugger
Text editors like Emacs and Vim have excellent Clojure support (both for editing and interacting with a REPL), and most Java IDE's have Clojure support as well.
At this point (May 2015) I'd highly recommend trying Jetbrain's Intellij IDEA with the Cursive plugin because of its excellent support for debugging. You can use the free community edition of Intellij, and the Cursive plugin is (at this point) free as well.
Intellij IDEA
To install Cursive, you go into Intellij's settings, add the correct Cursive plugin repository for the version of Intellij you have, install Cursive, and restart the IDE.
Once Cursive is active, you can simply open an existing Leiningen project in Intellij via "File > Open...". To get a REPL running, click "Run > Edit Configurations" in the main menu. In the window that appears, click the "+" button at the top left and select "Clojure REPL > Local". I'd change the name of the run configuration from "Unnamed" to something like "REPL", but otherwise keep the defaults and press "OK" to save the run configuration.
Now you have a way to run a REPL set up for the project you've opened. You can now click "Run > Run 'REPL'" (or whatever you named that run configuration) for a normal REPL, or better yet click "Run > Debug 'REPL'" to boot up the REPL in a debug mode that allows you to use Intellij's debugging features to debug your Clojure code. Set break points, add breakpoint conditions, run code and inspect frames, variables, etc., like you would in any debugger.
In your case, you'd want to click "Run > Debug 'REPL'" and then execute in that REPL the code you use to boot up your application.
Embedded nREPL Server
The above approach assumes that you first start a Clojure REPL and then boot up your application. If instead you want to have your application boot up normally and then optionally get a REPL that lives inside the running Clojure program, using nREPL directly is your best option.
From its own README:
nREPL is a Clojure network REPL that provides a REPL server and client, along with some common APIs of use to IDEs and other tools that may need to evaluate Clojure code in remote environments.
You should follow these instructions to add a running nREPL server to your application, but here is the most important part:
=> (use '[clojure.tools.nrepl.server :only (start-server stop-server)])
nil
=> (defonce server (start-server :port 7888))
#'user/server
Once you have a running nREPL server as part of your Clojure application, you can attach to it using your editor or IDE of choice (each editor/IDE has a different way of doing this, but most expose a way to attach to a running REPL by providing the host (usually localhost) and the port on which an nREPL server is running), or by invoking Leiningen directly at the command-line like this:
lein repl :connect <port>
You can specify the <port> when you configure the nREPL server as shown above. It also prints it out when it starts.
clj-debugger is a basic REPL debugger which provides features pretty similar to those available in pry-debug. You might consider it as an alternative to using the debuggers available in tools like CIDER & Cursive.
debugging is a huge problem in clojure as we are not aware of where the error occurred as well. define this macro :
(defmacro dbg[x] `(let x# ~x to understand where the eroor is thrown
My knowledge and experience in programming is still very fresh and basic, so please bear with me.
I want to be able to use C++ on my MacBook (OS 10.9.5 Mavericks) via Eclipse, which I have already been using for Java previously.
So I followed the instructions in Eclipse GDB MacOSX Mavericks
to get GDB, but now I still need the GDB command file (.gdbinit), which I can't find anywhere (I tried which .gdbinit on Terminal to no avail).
Please help me.
.gdbinit is a configuration file. You won't have one unless you've downloaded one or written one separately. It goes in your home directory and just contains a list of commands to run on startup. You don't necessarily need one. See this answer: .gdbinit file missing
However, if you are fairly new to programming, I'd suggest starting with Xcode, Clang and LLDB on the Mac for C++ rather than Eclipse, GCC and GDB. It's far easier to get setup, and well documented.
See:
How do I set up a C++ project in Xcode 4?
I'm trying to learn C++ using NetBeans but even though I have CYGWIN and everything set up in my PATH, I keep getting an error that says: "No shell found. Cannot proceed. Please install either CYGWIN or Msys."
I don't know what Msys is but since the error says "or" I assume that if I have CYGWIN that I don't need to have Msys.
I'm trying to run the basic "Hello World!" tutorial but this error from what I've seen isn't covered. I'm getting aggravated because I have a project I need to have done in a few weeks.
If anyone has any answers for me, that would be great. I can supply screenshots if you need them.
Cygwin alone is not enough, first of all you have to check if you installed C++/gcc/gdb packages in your Cygwin.
From Cygwin/Net beans docs:
Open the Control Panel (Start > Settings > Control Panel) and double-click the System program.
Select the Advanced tab and click Environment Variables.
In the System Variables panel of the Environment Variables dialog, select the Path variable and click Edit.
Add the path to the cygwin-directory\bin directory to the Path variable, and click OK. By default, cygwin-directory is C:\cygwin. Directory names must be separated with a semicolon.
Click OK in the Environment Variables dialog and the System Properties dialog.
If it fails you could try to Re-Install Netbeans from/within an cygwin/bash instance start the netbeans from a cygwin/bash instance.
Netbeans should automatically detect gdb/g++
PS: I'd prefer to use a good Gnu/Linux distro
I had the same problem with 8.1.
Adjusting the %PATH%-variable - in my case adding C:\msys64\usr\bin - solved it (as wdavilaneto's slightly verbose answer suggested).
This is not an answer but it adds to this question, I know that isn't very objective but in this case there may be a problem with Netbeans. I have 7.3 so this could be the reason. I am getting the same error but it used to work just fine, then one day it just stopped working and couldn't find the Shell. I have everything you need to make C/C++ work for Netbeans and it was working, for a while too!
It is rather old, but I've had the same issue a moment ago. It "Solved itself" by Creating a new "welcome sample" project and then made it run, then went back to my original project and made it run again. For me, it solved the problem. Probably it is related to an issue with Netbeans as Cian said.
Btw, I'm with Netbeans 8.1.
Make sure the shell is in your path! Depending whether you have Cygwin, Mingw32, Mingw32, TDM Mingw... it will be somewhere here:
c:\<installation path>\usr/bin
Hmh, I have 2 C compilers one for 64bit and one for 32bit set in NetBeans. When I had 32bit compiler without 64bit one then compiling went fine but when I have installed 64bit then NetBeans has started to do some problems, firstly everything went fine but then I started to get this problem to. For me fix is to switch from 64bit compiler back to 32bit compiler, then compile my program and then go back to 64bit compiler and now I can compile it with 64bit compile... Not sure why is this fixing it.
I have this problem with Netbeans 10.
Computer is Windows 10 x64.
Resolved by following the answer given by TNT.
Problem was when start building my project the said "no shell" (the topic of this posting) dialog box popped up. Since there was no command prompt, the build tools cannot run - process cannot spawn.
Solution was to give the correct path (environment variable). Since I am using MSYS, Since I am using MSYS, adding
F:\msys64\usr\bin
to my PATH made it work.
I am trying to use CCW + lein for clojure devl. I built a small Noir app which has page for /
with command line lein run , I am able to see the output at localhost
But how to run within CCW + Lein under eclipse , I press Run , and then open the browser
, it is not working .. ? What's the problem ? How to debug within Eclipse the web app. ie test
whether the server is running , any other web related debugging ?
Thanks
Sunil
You can start the application from the Eclipse REPL. Open the context dialog (right-click), navigate to Clojure and then click Load-file in REPL. After which write (-main) (or manually (server-start ...) in the REPL.
I mainly use Emacs for Clojure development so there is probably a better way to achieve this.
I am a college undergraduate trying to learn C++ programming on my Macbook. It is installed with Mac OSX 10.7.3.
I have been trying to build the "hello world" project on Eclipse Helios, but after I clicked on the build project button, it keeps telling me "cannot run program 'make : unknow reason".
I noticed this post but it seems to be for the Windows OS instead of MAC OS, and I don't quite follow the instructions in it either (sorry I don't have any familiarity with programming...). The description for PATH variable is "not available" and I don't know if this is a problem. I'm also confused about what to put in the "Name" slot.
Edit:
Now after some trials I have "make" in my PATH. (i.e. the command line gives the information of the make after I input "make --version") and my PATH is set to
/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/texbin
However the same problem still persists. Can anybody please help? Thank you!!
My suggestion is to install Xcode (http://itunes.apple.com/se/app/xcode/id497799835?mt=12) from the App Stor (for Mac). Xcode is (free) developer tools supplied by Apple. After installing Xcode you can go to the menu 'Xcode' -> 'Open Developer Tools' -> 'More Developer tools' that will take you to apple developer site (where you probably have to register) and where you can download 'Command Line Tools for Xcode' that will contain make etc. for unix style development.
Xcode is quit nice and if there is no demand to use Eclipse when you could probably do well with Xcode.
EDIT: Undeleted this answer as it turned out to be correct.
Yes, I'd say that $PATH was the problem.
Your system default version of $PATH should be sufficient and if not then set it correctly in your .profile or .bash_profile. You'll need to logout and back in for these changes to take effect. Doing this will mean that you can compile from the command line without going into eclipse, which is something you'll want to do at some point.
Now simply configure eclipse to avoid setting any build variables and all should be well. Under Window > Preferences > C/C++ > Build > Build Variables, the list should be empty: