Question: I am trying to create new project using rails but it display error. I am working on mac and its display error.

**$rails new EMS**

```
/Users/.rvm/gems/ruby-2.2.0/bin/rails:23:in `load': cannot load such file -- /Users/.rvm/gems/ruby-2.2.0/gems/rails-4.2.0/bin/rails (LoadError)
    from /Users/.rvm/gems/ruby-2.2.0/bin/rails:23:in `<main>'
    from /Users/.rvm/gems/ruby-2.2.0/bin/ruby_executable_hooks:15:in `eval'
    from /Users/.rvm/gems/ruby-2.2.0/bin/ruby_executable_hooks:15:in `<main>'

```

Answer: 
I encourage you to read the following in detail:
<http://docs.oracle.com/javaee/6/tutorial/doc/bncih.html>

A solution could look like the following. Please keep in mind that it is not tested and I took some assumptions how your environment could look like.

```
@Stateless
@TransactionAttribute
public class SomeClass {

    @PeristenceContext
    private EntityManager em;

    @Action(Action.ACTION_TYPE.CREATE)
    public void addSVPDiscoveryService (SVPDiscovery svpDiscovery){
        try {
            em.merge(svpDiscovery);
            em.flush();
        } catch (Exception ex) {
            throw ex;
        } 
    }
}

```
You don't seem to be starting a transaction (which the error message is telling you). Before the .merge() call:

```
em.getTransaction().begin();

```

When you want to commit your changes call:

```
em.getTransaction().commit();

```

When you're done with your entity manager close it with 

```
em.close();

```

(I'd call the close inside your finally block).