grails emacs mode - "Cannot open load file" "project-mode" - grails

I am trying to use emacs for grails development. Tried on grails-emacs-mode
There are emacs and emacs23 on my ubuntu 12.04.
prayag#prayag:~$ ls -l /usr/share/emacs[tab][tab]
emacs/ emacs23/
As the grails-emacs-mode suggests, I copied grails-mode.el and primary.org files to my emacs23/site-list
prayag#prayag:~$ ls -l /usr/share/emacs23/site-lisp/
total 32
-rw-r--r-- 1 root root 3013 Nov 17 00:39 debian-startup.elc
drwxr-xr-x 2 root root 4096 Nov 17 00:39 dictionaries-common
-rw-r--r-- 1 root root 18205 Feb 14 01:11 grails-mode.el
-rw-r--r-- 1 root root 0 Feb 14 01:11 primary.org
-rw-r--r-- 1 root root 106 Sep 22 01:16 subdirs.el
Then, created init.el inside .emacs.d as there exists no .emacs file in home directory. The init.el conatains
(require 'grails-mode)
(setq grails-mode t)
(setq project-mode t)
(add-to-list 'auto-mode-alist '("\.gsp$" . nxml-mode)) ; Use whatever mode you want for views.
(project-load-all) ; Loads all saved projects. Recommended, but not required.
now, opening emacs23 doesn't show any grails in the menubar.
I also tried
M-x
load-file .emacs.d/init.el
which throws
Warning (initialization): An error occurred while loading `/home/prayag/.emacs.d/init.el':
File error: Cannot open load file, project-mode
To ensure normal operation, you should investigate and remove the
cause of the error in your initialization file. Start Emacs with
the `--debug-init' option to view a complete error backtrace.
On starting emacs23 --debug-init, following error is thrown.
Debugger entered--Lisp error: (file-error "Cannot open load file" "project-mode")
require(project-mode)
eval-buffer(#<buffer *load*<2>> nil "/usr/share/emacs/23.3/site-lisp/grails-mode.el" nil t) ; Reading at buffer position 422
load-with-code-conversion("/usr/share/emacs/23.3/site-lisp/grails-mode.el" "/usr/share/emacs/23.3/site-lisp/grails-mode.el" nil t)
require(grails-mode)
eval-buffer(#<buffer *load*> nil "/home/prayag/.emacs.d/init.el" nil t) ; Reading at buffer position 23
load-with-code-conversion("/home/prayag/.emacs.d/init.el" "/home/prayag/.emacs.d/init.el" t t)
load("/home/prayag/.emacs.d/init" t t)
#[nil "\205\264

grails-mode requires project-mode as mentioned on the emacs-grails-mode page. So, you'll also need to install project-mode.
Also grab the remaining groovy packages(all but grails-mode) from here.
emacs-grails-mode-ext is a modest contribution to grails-mode allowing you to run Grails commands directly from emacs. For a given project(project-mode), you can run Grails commands such as create-domain-class, create-service, etc.
I also use the function ido-find-file-in-tag-files from here, I bind it to C-x C-M-f .
Simple guide with emacs-grails-mode:
Create a project from the command line or eshell -> grails create-app yourapp
Using dired, go to your Grails project folder
M-x project-new -> to create a new project(project-mode)
M-x project-save -> Save the project
M-x project-load-and-select -> Your project-name as argument
There's also a Grails menu if you use the menubar
You could also use my current emacs setup here, if you have emacs24 installed. I believe that it's available for Ubuntu 12.04, but I'm not sure. I usually build emacs from source on OSX or I use emacs-snapshot in Ubuntu.
Hope this helps.

I don't know Grail-mode at all. I've just clicked your link, and they state that project-mode is a dependency:
Dependencies:
project-mode is the only dependency.
As a consequence you will also have to install it. Link to the Emacs project code.
I am hoping for you this project does not have additional dependencies...
As a side note: later, try to install the last emacs (v24) which embeds a very convenient way to deal with package installation and dealing with packages dependencies. I've just check it out, it is present on an alternative (but very know) repository: Marmalade-repo.org.

Related

E121: Undefined Variable: VundleInstalled & E15: Invalid Expression: VundleInstalled == 1 when running VIM

I'm running through the upcase courses and they've introduced me to VIM which, with the help of tmux, is slowly replacing my use of Atom. I've been trying to use some simple plugins using Vundler and every time I run Vim . from my rails directory I get the following errors:
E121: Undefined variable: VundleInstalled
E15: Invalid expression: VundleInstalled == 1
I have been up and down this mean, mean internet and cannot find a solution to this issue.
My ~/.vimrc
1 set number
2 set nocompatible
3 filetype off
4
5 syntax on
6 colorscheme Tomorrow-Night
7
8 set rtp+=~/.vim/bundle/vundle.vim
9 call vundle#begin()
10
11 Plugin 'VundleVim/Vundle.vim'
12 Plugin 'tpope/vim-fugitive'
13 Plugin 'wincent/command-t'
14 Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
15 Plugin 'vim-scripts/L9', {'name': 'newL9'}
16 Plugin 'tpope/vim-rails'
17 Plugin 'tpope/vim-rake'
18 Plugin 'tpope/vim-bundler'
19
20 " Color Schemes
21 Plugin 'chriskempson/tomorrow-theme'
22 Plugin 'flazz/vim-colorschemes'
23 Plugin 'chriskempson/base16-vim'
The error I get occurs any time I try to open a file in VIM. On top of that, when I try and work in VIM I get the following message every time I try and open a directory or run a command:
Error detected while processing FileType Auto commands for "*": │Maximum connections set to 1024
E117: Unknown function: rails#buffer_setup
Any help you could offer would be fantastic. I'm really digging VIM and tmux but I'm also discovering there's a bit of a learning curve to both of them.
Thanks!
Update: I have adjusted any issues with matching file names and, as far as I can tell it's not disrupting functionality. All the same, I would like to figure out why I"m getting this error.

CouchDB 1.3.1 on Centos 6.4

I compiled CouchDB and installed. It seems to work great except when I use views on the database, then it just spins the wheel and nothing happens and the cpu load spikes to 100% and slowly it eats away all memory and starts to swap a lot which in return increases the cpu load.
I have tried both with the js-1.70-12 that comes with centos 6.4, as well as build and install my own js-1.85-1. All erlang packages are installed from epel :
erlang-crypto-R14B-04.2.el6.x86_64
erlang-syntax_tools-R14B-04.2.el6.x86_64
erlang-mnesia-R14B-04.2.el6.x86_64
erlang-ssl-R14B-04.2.el6.x86_64
erlang-cosProperty-R14B-04.2.el6.x86_64
erlang-asn1-R14B-04.2.el6.x86_64
erlang-cosEventDomain-R14B-04.2.el6.x86_64
erlang-eunit-R14B-04.2.el6.x86_64
erlang-erl_docgen-R14B-04.2.el6.x86_64
erlang-toolbar-R14B-04.2.el6.x86_64
erlang-debugger-R14B-04.2.el6.x86_64
erlang-tools-R14B-04.2.el6.x86_64
erlang-typer-R14B-04.2.el6.x86_64
erlang-megaco-R14B-04.2.el6.x86_64
erlang-oauth-1.1.1-1.el6.x86_64
erlang-stdlib-R14B-04.2.el6.x86_64
erlang-hipe-R14B-04.2.el6.x86_64
erlang-kernel-R14B-04.2.el6.x86_64
erlang-runtime_tools-R14B-04.2.el6.x86_64
erlang-snmp-R14B-04.2.el6.x86_64
erlang-public_key-R14B-04.2.el6.x86_64
erlang-inets-R14B-04.2.el6.x86_64
erlang-ibrowse-2.2.0-4.el6.x86_64
erlang-cosEvent-R14B-04.2.el6.x86_64
erlang-cosNotification-R14B-04.2.el6.x86_64
erlang-edoc-R14B-04.2.el6.x86_64
erlang-otp_mibs-R14B-04.2.el6.x86_64
erlang-cosFileTransfer-R14B-04.2.el6.x86_64
erlang-cosTransactions-R14B-04.2.el6.x86_64
erlang-inviso-R14B-04.2.el6.x86_64
erlang-jinterface-R14B-04.2.el6.x86_64
erlang-erl_interface-R14B-04.2.el6.x86_64
erlang-diameter-R14B-04.2.el6.x86_64
erlang-gs-R14B-04.2.el6.x86_64
erlang-tv-R14B-04.2.el6.x86_64
erlang-appmon-R14B-04.2.el6.x86_64
erlang-odbc-R14B-04.2.el6.x86_64
erlang-wx-R14B-04.2.el6.x86_64
erlang-et-R14B-04.2.el6.x86_64
erlang-observer-R14B-04.2.el6.x86_64
erlang-sasl-R14B-04.2.el6.x86_64
erlang-dialyzer-R14B-04.2.el6.x86_64
erlang-common_test-R14B-04.2.el6.x86_64
erlang-os_mon-R14B-04.2.el6.x86_64
erlang-examples-R14B-04.2.el6.x86_64
erlang-compiler-R14B-04.2.el6.x86_64
erlang-erts-R14B-04.2.el6.x86_64
erlang-xmerl-R14B-04.2.el6.x86_64
erlang-orber-R14B-04.2.el6.x86_64
erlang-cosTime-R14B-04.2.el6.x86_64
erlang-ssh-R14B-04.2.el6.x86_64
erlang-docbuilder-R14B-04.2.el6.x86_64
erlang-percept-R14B-04.2.el6.x86_64
erlang-parsetools-R14B-04.2.el6.x86_64
erlang-ic-R14B-04.2.el6.x86_64
erlang-pman-R14B-04.2.el6.x86_64
erlang-webtool-R14B-04.2.el6.x86_64
erlang-test_server-R14B-04.2.el6.x86_64
erlang-reltool-R14B-04.2.el6.x86_64
erlang-R14B-04.2.el6.x86_64
erlang-mochiweb-1.4.1-5.el6.x86_64
Every thing configures and makes and installs as expected. You can dump data into the database, you can create documents and all that. But I can not run any view, temporary or not.
The only error I see in the logs is like this one, and it is a lot of these errors :
[Sun, 18 Aug 2013 23:10:38 GMT] [error] [<0.124.0>] {error_report,<0.30.0>,
{<0.124.0>,crash_report,
[[{initial_call,
{mochiweb_socket_server,init,['Argument__1']}},
{pid,<0.124.0>},
{registered_name,[]},
{error_info,
{exit,eaddrinuse,
[{gen_server,init_it,6},
{proc_lib,init_p_do_apply,3}]}},
{ancestors,
[couch_secondary_services,couch_server_sup,
<0.31.0>]},
{messages,[]},
{links,[<0.93.0>]},
{dictionary,[]},
{trap_exit,true},
{status,running},
{heap_size,987},
{stack_size,24},
{reductions,459}],
[]]}}
But I have no idea what they mean.
Do I need to compile and install erlang as well ? All the above packages or just erlang ?
Your compilation and installation looks fine. At least your error (note: eaddrinuse in traceback) is about that there is some process that listens same address and port as your CouchDB try to. Check other listening processes with netstat -anp command or change CouchDB's listen port to different.

live reload not working after upgrading yo grunt-cli bower

I Just built Nodejs and installed 0.10.6 then uninstalled yo+grunt-cli+bower+generator-webapp and reinstalled to latest using npm -g,
yo webapp
But now live reload doesnt work, cant see any errors either in chrome devtools
yo -v: 1.0beta5
grunt-cli v0.1.8 and grunt v0.4.1
bower -v: 0.9.2
node -v: 0.10.6
npm -v: 1.2.18
grunt server shows the watch task: time + the name of file changed
tried : changing the port number in Gruntfile to.. LIVERELOAD_PORT = 34729; nogo :(
my older webapp projects still work fine
Lost..
Thanks
--------------------- UPDATE
1. moved lrSnippet to 1st position in Grunfile.js
2. in index.js moved
end.call(res, res.data, encoding);
outside the if Block
Now it works Partially :
summary :
1. changes to index.html > reloads ok
2. changes to main.scss > reloads ok
3. changes to my.sass > Not OK
after 3rd step
1. changes to index.html > Not OK
2. changes to main.scss > Not OK
4. changes to hello.coffe > Not OK
After step 4
1. changes to index.html > ok
2. changes to main.scss > ok
//------------------------------------- index.html
Changes to index.html
reload ok
grunt server window logs change and issues reload command
grunt server window grab =
Running "watch" task
Waiting...OK
>> File "app/index.html" changed.
Running "watch" task
... Reload app/index.html ...
Completed in 0.002s at Sat May 18 2013 12:47:58 GMT+0530 (IST) - Waiting...
//------------------------------------- main.scss
Changes to main.scss
reload ok
grunt server window grab =
>> File "app/styles/main.scss" changed.
Running "compass:server" (compass) task
overwrite .tmp/styles/main.css
unchanged app/styles/my.sass
Running "watch" task
Completed in 1.906s at Sat May 18 2013 12:48:24 GMT+0530 (IST) - Waiting...
OK
>> File ".tmp/styles/main.css" changed.
Running "watch" task
... Reload .tmp/styles/main.css ...
Completed in 0.002s at Sat May 18 2013 12:48:24 GMT+0530 (IST) - Waiting...
//------------------------------------- my.sass
changes to my.sass
reload not ok (not reloading)
grunt server window grab =
Running "watch" task
Waiting...OK
>> File "app/styles/my.sass" changed.
Running "compass:server" (compass) task
unchanged app/styles/main.scss
unchanged .tmp/images/generated/design-s65ab268e46.png
overwrite .tmp/styles/my.css
Running "watch" task
Completed in 0.602s at Sat May 18 2013 13:00:19 GMT+0530 (IST) - Waiting...
//-------------------------------------
After the my.sass is changed
changes made to index.html or main.scss r not shown in grunt server window
the Watch command doesnt log anything.
changes r not reloaded
//-------------------------------------
Restarted Grunt Server
//------------------------------------- hello.coffee
grunt server window grab =
OK
>> File "app/scripts/hello.coffee" changed.
Running "coffee:dist" (coffee) task
File .tmp/scripts/hello.js created.
Running "watch" task
Completed in 0.011s at Sat May 18 2013 13:34:56 GMT+0530 (IST) - Waiting...
//-------------------------------------
There is a bug with the current livereload/yo setup. Here are the details alongside a fix for the problematic dependency (connect-livereload).
https://github.com/yeoman/generator-webapp/issues/63
Three things which you can make sure to diagnose the issue further.
Make sure you're on the latest version npm update -g yo
You shouldn't be using LiveReload plugin explicitly, it conflicts with Yeoman watch command while running
Your port (in gruntfile.js) might be using by some other process, try to exit from the terminal, change the port and it see it works or not.
The problem is yeoman doesn't change the port automatically in the current version, that's where it stopped working if you close it forcefully in the current terminal session.
The same issue has been discussed here - https://github.com/yeoman/yeoman/issues/938
If you still see the issue then try to run the following command and past the output here.
yo --version && echo $PATH $NODE_PATH && node -e 'console.log(process.platform, process.versions)' && cat Gruntfile.js
A commit was made to solve this problem.
https://github.com/yeoman/generator-webapp/pull/67
We'll see an update soon I guess.
in the meantime what you can do is modify your Gruntfile.js. Look near the line 61 for the connect option for livereload and replace the configuration for this snippet.
livereload: {
options: {
middleware: function (connect) {
return [
lrSnippet,
mountFolder(connect, '.tmp'),
mountFolder(connect, yeomanConfig.app)
];
}
}
},
Also, is a good idea to update the module connect-livereload to 0.1.4.
Just run npm install connect-livereload on your project directory.
I added live reload as an option under watch in the Gruntfile.js:
watch: {
options: {
nospawn: true,
livereload: true
},
Setting the livereload:port instead of livereload:options:port worked for me:
livereload: {
port: 35728
}

ActiveMQ as a service start errors

I installed ActiveMQ as a service on a Windows 2008 64bit server using commons-deamon.
When I try to start the service I get this error:
ACTIVEMQ_HOME: C:\apache-activemq-5.7.0
ACTIVEMQ_BASE: C:\apache-activemq-5.7.0
ACTIVEMQ_CONF: C:\apache-activemq-5.7.0\conf
ACTIVEMQ_DATA: C:\apache-activemq-5.7.0\data
Loading message broker from: xbean:activemq.xml
INFO | Refreshing org.apache.activemq.xbean.XBeanBrokerFactory$1#17494c8: startup date [Wed Jan 09 16:45:52 IST 2013]; root of context hierarchy
ERROR | Failed to load: class path resource [activemq.xml], reason: Could not load properties; nested exception is java.io.FileNotFoundException: ${activemq.conf}\credentials.properties (The system cannot find the path specified)
org.springframework.beans.factory.BeanInitializationException: Could not load properties; nested exception is java.io.FileNotFoundException: ${activemq.conf} \credentials.properties (The system cannot find the path specified)
It's like it can't find the file
ACTIVEMQ_HOME\conf\credentials.properties
but the file does exist in my folder.
Do I need to manually define environment variables or something of that sort?
Thanks!
There are some files that are missing in the v5.7.0 archive. You can simply copy them over from the older versions. See: Jira issue for this problem

CVS error - CVS exited with error code 1

I am seeing this error for quite sometime now.
I am running ant build on CYGWIN which inturn runs on WindowsXP.
The resolution(bad one) I found was to delete my gcct/first directory and run ant build again (which runs from another directory). It runs successfully but if I modify some code under gcct/first, I do not want to delete it because of this error.
I did see this link. The resolution here does not apply to me since I do not have .cvspass defined anywhere in the build.xml.
C:\svn\CEL_v3681\buildCore.xml:1883: cvs exited with error code 1
Command line was [Executing 'cvs' with arguments:
'checkout'
'-A'
'-rfirst_v2_126'
'gcct/first'
The ' characters around the executable and arguments are
not part of the command.
environment:
ALLUSERSPROFILE=C:\Documents and Settings\All Users
ANT_HOME=C:/Apps/Apache/apache-ant-1.7.0
APPDATA=C:\Documents and Settings\shankarc\Application Data
CLASSPATH=./;C:/Program Files/Java/jre1.5.0_07/lib/ext/QTJava.zip
COMMONPROGRAMFILES=C:\Program Files\Common Files
COMPUTERNAME=NYKPWM2035798
COMSPEC=C:\WINNT\system32\cmd.exe
CUSTPROF=Roaming700Live
CVSROOT=:pserver:shankarc#amcvs2.lehman.com:/home/eqcvs/cmte
CVS_RSH=/bin/ssh
FP_NO_HOST_CHECK=NO
HOME=C:\Apps\CYGWIN\home\shankarc
HOMEDRIVE=F:
HOMEPATH=\
HOSTNAME=nykpwm2035798
IDEA_PROPERTIES=C:\Documents and Settings\shankarc\idea.properties
INFOPATH=/usr/local/info:/usr/share/info:/usr/info:
JAVA_HOME=C:/Program Files/Java/jdk1.6.0_21/
JDK_HOME=C:\Program Files\Java\jdk1.6.0_21\
LOGONSERVER=\\NYKPSM00069
MANPATH=/usr/local/man:/usr/share/man:/usr/man::/usr/ssl/man
NUMBER_OF_PROCESSORS=2
OS=Windows_NT
PATH=C:\Apps\CYGWIN\usr\local\bin;C:\Apps\CYGWIN\bin;C:\Apps\CYGWIN\bin;C:\Apps\CYGWIN\usr\X11R6\bin;C:\Apps\Apache\apache-ant-1.7.0\bin;C:\Program Files\Java\jdk1.6.0_21\bin\;C:\Apps\CYGWIN\bin;C:\Program Files\VisualSVN Server\bin;C:\Program Files\Sudowin\Clients\Console;C:\Program Files\Fortify Software\Fortify 360 v2.5.0\bin
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.PSC1
PRINTER=\\NYKPSM04020\NYKLPR1301-03-03C05
PROCESSOR_ARCHITECTURE=x86
PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 6, GenuineIntel
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=0f06
PROFGROUP=FONP
PROGRAMFILES=C:\Program Files
PROMPT=$P$G
PWD=/cygdrive/c/svn/CEL_v3681/gcct/cel
QHOME=c:\q
QTJAVA=C:\Program Files\Java\jre1.5.0_07\lib\ext\QTJava.zip
SESSIONNAME=Console
SHLVL=1
SITECODE=NYK
SITEIDENT=NYK
SVN_ASP_DOT_NET_HACK=1
SYSTEMDRIVE=C:
SYSTEMROOT=C:\WINNT
TEMP=C:\TEMP
TERM=cygwin
TMP=C:\TEMP
UATDATA=C:\WINNT\system32\CCM\UATData\D9F8C395-CAB8-491d-B8AC-179A1FE1BE77
USER=shankarc
USERDNSDOMAIN=INTRANET.BARCAPINT.COM
USERDOMAIN=INTRANET
USERNAME=shankarc
USERPROFILE=C:\Documents and Settings\shankarc
WINDIR=C:\WINNT
CVS_PASSFILE=C:\Apps\CYGWIN\home\shankarc\.cvspass]
Total time: 58 seconds
How I resolve this?
I had the same issue and found that even though I was not using .cvspass I did have a build property of cvs.pass set which needed to be reset to OVERRIDE to function depending on how you set up your cvs access (though it looked similar from your post). This needed to be changed in build.properties and .build.properties. Hope this helps!

Resources